From 5a0b27c1ee8591f8e76e0e5a9ab4277b89e041cf Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 7 May 2026 16:08:03 +0000 Subject: [PATCH] Regenerate client from commit 6fe9b33 of spec repo --- .generator/schemas/v2/openapi.yaml | 381 ++++++++++++++++++ .../CreateEmailTransportWebhookIntake.rb | 86 ++++ features/scenarios_model_mapping.rb | 3 + features/v2/email_transport.feature | 22 + features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 14 + .../v2/api/email_transport_api.rb | 101 +++++ .../v2/models/transport_webhook_log.rb | 230 +++++++++++ .../transport_webhook_log_attributes.rb | 227 +++++++++++ .../v2/models/transport_webhook_log_email.rb | 137 +++++++ .../transport_webhook_log_ip_attribute.rb | 117 ++++++ .../models/transport_webhook_log_message.rb | 165 ++++++++ .../transport_webhook_log_message_auth.rb | 105 +++++ ...ansport_webhook_log_message_custom_args.rb | 145 +++++++ .../transport_webhook_log_message_id.rb | 125 ++++++ .../transport_webhook_log_message_response.rb | 125 ++++++ ...transport_webhook_log_message_timestamp.rb | 135 +++++++ .../models/transport_webhook_log_network.rb | 105 +++++ .../transport_webhook_log_network_ip.rb | 119 ++++++ .../transport_webhook_log_org_metadata.rb | 255 ++++++++++++ 21 files changed, 2604 insertions(+) create mode 100644 examples/v2/email-transport/CreateEmailTransportWebhookIntake.rb create mode 100644 features/v2/email_transport.feature create mode 100644 lib/datadog_api_client/v2/api/email_transport_api.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_email.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_ip_attribute.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message_auth.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message_custom_args.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message_id.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message_response.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_message_timestamp.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_network.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_network_ip.rb create mode 100644 lib/datadog_api_client/v2/models/transport_webhook_log_org_metadata.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 440627d7e6b3..ecadd5414e63 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -79306,6 +79306,321 @@ components: type: string x-enum-varnames: - SECRET + TransportWebhookLog: + description: A single email transport webhook log event. + properties: + attributes: + $ref: "#/components/schemas/TransportWebhookLogAttributes" + date: + description: The ISO 8601 timestamp of the event. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + log_id: + description: The unique log event identifier. + example: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR" + type: string + source: + description: The email transport provider. + example: "sendgrid" + type: string + status: + description: The log status level. + example: "info" + type: string + tags: + description: A list of tags associated with the event. + example: ["env:production"] + items: + description: A tag in key:value or key-only form (for example, env:production). + type: string + type: array + required: + - date + - log_id + - source + - status + - tags + - attributes + type: object + TransportWebhookLogAttributes: + description: Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. + properties: + category: + description: The event categories. + example: ["transactional"] + items: + description: An event category assigned by the transport provider. + type: string + type: array + email: + $ref: "#/components/schemas/TransportWebhookLogEmail" + email_id: + description: The unique email identifier. + example: "abc123-def456" + type: string + email_type_display_name: + description: The human-readable email type name. + example: "Monitor Alert" + type: string + message: + $ref: "#/components/schemas/TransportWebhookLogMessage" + network: + $ref: "#/components/schemas/TransportWebhookLogNetwork" + org: + description: The numeric organization identifier. + example: 1234 + format: int64 + type: integer + org_metadata: + $ref: "#/components/schemas/TransportWebhookLogOrgMetadata" + org_uuid: + description: The organization UUID. + example: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" + type: string + queue_time: + description: The timestamp when the email was queued. + example: "2024-01-15T10:29:00Z" + type: string + sg_machine_open: + description: Indicates whether the open event was triggered by automated machine activity rather than a human recipient (SendGrid-specific). + type: boolean + subject: + description: The email subject line. + example: "[Monitor Alert] CPU usage is high" + type: string + useragent: + description: The user agent string for open events. + example: "Mozilla/5.0" + type: string + type: object + TransportWebhookLogBatchRequest: + description: A batch of email transport webhook log events. + items: + $ref: "#/components/schemas/TransportWebhookLog" + type: array + TransportWebhookLogEmail: + description: The email address details. + properties: + address: + description: The recipient email address. + example: "user@example.com" + type: string + domain: + description: The recipient domain. + example: "example.com" + type: string + subject: + description: The email subject line. + example: "[Monitor Alert] CPU usage is high" + type: string + type: + description: Email categorization tags applied by the transport provider (for example, "transactional", "marketing"). + example: ["transactional"] + items: + description: An email type classification (for example, "transactional", "user"). + type: string + type: array + type: object + TransportWebhookLogIpAttribute: + description: An IP attribute with its sources. + properties: + ip: + description: The IP address. + example: "192.168.1.1" + type: string + source: + description: The transport providers or systems that reported this IP address. + example: ["sendgrid"] + items: + description: A transport provider or system that reported this IP address. + type: string + type: array + type: object + TransportWebhookLogMessage: + description: The message delivery event details. + properties: + auth: + $ref: "#/components/schemas/TransportWebhookLogMessageAuth" + custom_args: + $ref: "#/components/schemas/TransportWebhookLogMessageCustomArgs" + id: + $ref: "#/components/schemas/TransportWebhookLogMessageId" + name: + description: The delivery event type emitted by the transport provider (for example, "delivered", "dropped", "bounced"). + example: "delivered" + type: string + response: + $ref: "#/components/schemas/TransportWebhookLogMessageResponse" + sender_ip: + description: The IP address of the sending server. + example: "192.168.1.1" + type: string + timestamp: + $ref: "#/components/schemas/TransportWebhookLogMessageTimestamp" + type: object + TransportWebhookLogMessageAuth: + description: The message authentication details. + properties: + delivered_with_tls: + description: The TLS version or negotiation information. + example: "TLSv1.2" + type: string + type: object + TransportWebhookLogMessageCustomArgs: + description: Custom arguments passed through the email transport provider for tracking. + properties: + email_id: + description: The unique email identifier. + example: "abc123-def456" + type: string + email_type_display_name: + description: The human-readable email type name. + example: "Monitor Alert" + type: string + org_uuid: + description: The organization UUID. + example: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" + type: string + queue_time: + description: The timestamp when the email was queued. + example: "2024-01-15T10:29:00Z" + type: string + subject: + description: The email subject line. + example: "[Monitor Alert] CPU usage is high" + type: string + type: object + TransportWebhookLogMessageId: + description: The message identifiers. + properties: + message_id: + description: The RFC 5322 Message-ID. + example: "" + type: string + smtp_id: + description: The SMTP transaction identifier. + example: "" + type: string + transport_event_id: + description: The transport provider event identifier. + example: "evt_abc123" + type: string + type: object + TransportWebhookLogMessageResponse: + description: The SMTP response information. + properties: + enhanced_smtp_code: + description: The enhanced SMTP status code. + example: "2.0.0" + type: string + reason: + description: The SMTP response message. + example: "250 2.0.0 OK" + type: string + smtp_code: + description: The SMTP status code. + example: "250" + type: string + type: object + TransportWebhookLogMessageTimestamp: + description: The message delivery timing information. + properties: + event_timestamp: + description: The Unix timestamp of the event. + example: 1705312200.0 + format: double + type: number + lifetime: + description: The total delivery time in seconds. + example: 3.2 + format: double + type: number + queue_time: + description: Number of seconds the message spent in the delivery queue. + example: 1.5 + format: double + type: number + scheduled_time: + description: The scheduled delivery time as a Unix timestamp. + example: 1705312190.0 + format: double + type: number + type: object + TransportWebhookLogNetwork: + description: The network information for the event. + properties: + ip: + $ref: "#/components/schemas/TransportWebhookLogNetworkIp" + type: object + TransportWebhookLogNetworkIp: + description: The IP address information. + properties: + attributes: + description: Per-IP attribute records, each pairing an IP address with the providers that observed it. + items: + $ref: "#/components/schemas/TransportWebhookLogIpAttribute" + type: array + list: + description: The list of IP addresses. + example: ["192.168.1.1"] + items: + description: An IP address observed during message delivery. + type: string + type: array + type: object + TransportWebhookLogOrgMetadata: + description: Metadata about the organization that sent the email. + properties: + billing_country: + description: Country code or name used for billing purposes. + type: string + billing_plan: + description: The Datadog billing plan for the organization (for example, "pro", "enterprise"). + type: string + customer_tier: + description: Support or account tier assigned to the organization (for example, "tier-1"). + type: string + domain: + description: Primary email domain associated with the organization (for example, "example.com"). + type: string + industry: + description: Industry classification of the organization (for example, "technology", "finance"). + type: string + is_bugbounty: + description: Whether the organization is enrolled in the Datadog bug bounty program. + type: string + is_msp: + description: Whether the organization operates as a Managed Service Provider managing child orgs. + type: string + name: + description: Display name of the organization as configured in Datadog account settings. + type: string + org_uuid: + description: Globally unique identifier for the Datadog organization (UUID v1 format). + type: string + parent_org_id: + description: Identifier of the immediate parent organization, if this is a child org. + type: string + premium_support: + description: Whether the organization has a premium support plan with Datadog. + type: string + root_org_id: + description: Identifier of the top-level parent organization in a multi-org account hierarchy. + type: string + root_org_name: + description: Display name of the top-level parent organization in a multi-org account hierarchy. + type: string + shipping_country: + description: Country code or name used for shipping or regional assignment. + type: string + website: + description: Website URL provided during organization registration. + type: string + when_created: + description: ISO 8601 timestamp of when the Datadog organization was created. + type: string + type: object Trigger: description: "One of the triggers that can start the execution of a workflow." oneOf: @@ -99657,6 +99972,70 @@ paths: operator: OR permissions: - monitors_downtime + /api/v2/email/transport/webhook_intake: + post: + description: |- + Receives a batch of email transport webhook log events and emits an audit trail entry + for each event with a final delivery status (delivered, dropped, or bounced). + Only authorized organizations can submit events. + operationId: CreateEmailTransportWebhookIntake + requestBody: + content: + application/json: + examples: + default: + value: + - attributes: + email: + address: "user@example.com" + domain: "example.com" + email_id: "abc123-def456" + email_type_display_name: "Monitor Alert" + message: + id: + message_id: "" + smtp_id: "" + name: "delivered" + response: + reason: "250 2.0.0 OK" + smtp_code: "250" + timestamp: + event_timestamp: 1705312200.0 + org: 1234 + org_uuid: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" + subject: "[Monitor Alert] CPU usage is high" + date: "2024-01-15T10:30:00Z" + log_id: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR" + source: "sendgrid" + status: "info" + tags: + - "env:production" + schema: + $ref: "#/components/schemas/TransportWebhookLogBatchRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Ingest email transport webhook events + tags: + - Email Transport + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/error-tracking/issues/search: post: description: Search issues endpoint allows you to programmatically search for issues within your organization. This endpoint returns a list of issues that match a given search query, following the event search syntax. The search results are limited to a maximum of 100 issues per request. @@ -145653,6 +146032,8 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes + - description: Endpoints for receiving email transport webhook events for audit trail processing. + name: Email Transport - description: Retrieves security risk scores for entities in your organization. name: Entity Risk Scores - description: View and manage issues within Error Tracking. See the [Error Tracking page](https://docs.datadoghq.com/error_tracking/) for more information. diff --git a/examples/v2/email-transport/CreateEmailTransportWebhookIntake.rb b/examples/v2/email-transport/CreateEmailTransportWebhookIntake.rb new file mode 100644 index 000000000000..18c14e16cc20 --- /dev/null +++ b/examples/v2/email-transport/CreateEmailTransportWebhookIntake.rb @@ -0,0 +1,86 @@ +# Ingest email transport webhook events returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_email_transport_webhook_intake".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EmailTransportAPI.new + +body = [ + DatadogAPIClient::V2::TransportWebhookLog.new({ + attributes: DatadogAPIClient::V2::TransportWebhookLogAttributes.new({ + category: [ + "transactional", + ], + email: DatadogAPIClient::V2::TransportWebhookLogEmail.new({ + address: "user@example.com", + domain: "example.com", + subject: "[Monitor Alert] CPU usage is high", + type: [ + "transactional", + ], + }), + email_id: "abc123-def456", + email_type_display_name: "Monitor Alert", + message: DatadogAPIClient::V2::TransportWebhookLogMessage.new({ + auth: DatadogAPIClient::V2::TransportWebhookLogMessageAuth.new({ + delivered_with_tls: "TLSv1.2", + }), + custom_args: DatadogAPIClient::V2::TransportWebhookLogMessageCustomArgs.new({ + email_id: "abc123-def456", + email_type_display_name: "Monitor Alert", + org_uuid: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", + queue_time: "2024-01-15T10:29:00Z", + subject: "[Monitor Alert] CPU usage is high", + }), + id: DatadogAPIClient::V2::TransportWebhookLogMessageId.new({ + message_id: "", + smtp_id: "", + transport_event_id: "evt_abc123", + }), + name: "delivered", + response: DatadogAPIClient::V2::TransportWebhookLogMessageResponse.new({ + enhanced_smtp_code: "2.0.0", + reason: "250 2.0.0 OK", + smtp_code: "250", + }), + sender_ip: "192.168.1.1", + timestamp: DatadogAPIClient::V2::TransportWebhookLogMessageTimestamp.new({ + event_timestamp: 1705312200.0, + lifetime: 3.2, + queue_time: 1.5, + scheduled_time: 1705312190.0, + }), + }), + network: DatadogAPIClient::V2::TransportWebhookLogNetwork.new({ + ip: DatadogAPIClient::V2::TransportWebhookLogNetworkIp.new({ + attributes: [ + DatadogAPIClient::V2::TransportWebhookLogIpAttribute.new({ + ip: "192.168.1.1", + source: [ + "sendgrid", + ], + }), + ], + list: [ + "192.168.1.1", + ], + }), + }), + org: 1234, + org_metadata: DatadogAPIClient::V2::TransportWebhookLogOrgMetadata.new({}), + org_uuid: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", + queue_time: "2024-01-15T10:29:00Z", + subject: "[Monitor Alert] CPU usage is high", + useragent: "Mozilla/5.0", + }), + date: "2024-01-15T10:30:00Z", + log_id: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR", + source: "sendgrid", + status: "info", + tags: [ + "env:production", + ], + }), +] +api_instance.create_email_transport_webhook_intake(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f88a3c3f133f..a0c4193084bc 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2434,6 +2434,9 @@ "page_offset" => "Integer", "page_limit" => "Integer", }, + "v2.CreateEmailTransportWebhookIntake" => { + "body" => "Array", + }, "v2.SearchIssues" => { "include" => "Array", "body" => "IssuesSearchRequest", diff --git a/features/v2/email_transport.feature b/features/v2/email_transport.feature new file mode 100644 index 000000000000..f2b014905edd --- /dev/null +++ b/features/v2/email_transport.feature @@ -0,0 +1,22 @@ +@endpoint(email-transport) @endpoint(email-transport-v2) +Feature: Email Transport + Endpoints for receiving email transport webhook events for audit trail + processing. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EmailTransport" API + And operation "CreateEmailTransportWebhookIntake" enabled + And new "CreateEmailTransportWebhookIntake" request + And body with value [{"attributes": {"category": ["transactional"], "email": {"address": "user@example.com", "domain": "example.com", "subject": "[Monitor Alert] CPU usage is high", "type": ["transactional"]}, "email_id": "abc123-def456", "email_type_display_name": "Monitor Alert", "message": {"auth": {"delivered_with_tls": "TLSv1.2"}, "custom_args": {"email_id": "abc123-def456", "email_type_display_name": "Monitor Alert", "org_uuid": "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", "queue_time": "2024-01-15T10:29:00Z", "subject": "[Monitor Alert] CPU usage is high"}, "id": {"message_id": "", "smtp_id": "", "transport_event_id": "evt_abc123"}, "name": "delivered", "response": {"enhanced_smtp_code": "2.0.0", "reason": "250 2.0.0 OK", "smtp_code": "250"}, "sender_ip": "192.168.1.1", "timestamp": {"event_timestamp": 1705312200.0, "lifetime": 3.2, "queue_time": 1.5, "scheduled_time": 1705312190.0}}, "network": {"ip": {"attributes": [{"ip": "192.168.1.1", "source": ["sendgrid"]}], "list": ["192.168.1.1"]}}, "org": 1234, "org_metadata": {}, "org_uuid": "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", "queue_time": "2024-01-15T10:29:00Z", "subject": "[Monitor Alert] CPU usage is high", "useragent": "Mozilla/5.0"}, "date": "2024-01-15T10:30:00Z", "log_id": "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR", "source": "sendgrid", "status": "info", "tags": ["env:production"]}] + + @generated @skip @team:DataDog/dogmail + Scenario: Ingest email transport webhook events returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dogmail + Scenario: Ingest email transport webhook events returns "No Content" response + When the request is sent + Then the response status is 204 No Content diff --git a/features/v2/undo.json b/features/v2/undo.json index d5a8323e2702..96d9f3eb5d14 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1863,6 +1863,12 @@ "type": "idempotent" } }, + "CreateEmailTransportWebhookIntake": { + "tag": "Email Transport", + "undo": { + "type": "safe" + } + }, "SearchIssues": { "tag": "Error Tracking", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index eb82106f5652..5ecf38d58d02 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -317,6 +317,7 @@ def initialize "v2.trigger_deployment_gates_evaluation": false, "v2.update_deployment_gate": false, "v2.update_deployment_rule": false, + "v2.create_email_transport_webhook_intake": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, "v2.create_global_incident_handle": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3ba1b16d4765..fe048900613d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6068,6 +6068,19 @@ def overrides "v2.timeseries_response_attributes" => "TimeseriesResponseAttributes", "v2.timeseries_response_series" => "TimeseriesResponseSeries", "v2.token_type" => "TokenType", + "v2.transport_webhook_log" => "TransportWebhookLog", + "v2.transport_webhook_log_attributes" => "TransportWebhookLogAttributes", + "v2.transport_webhook_log_email" => "TransportWebhookLogEmail", + "v2.transport_webhook_log_ip_attribute" => "TransportWebhookLogIpAttribute", + "v2.transport_webhook_log_message" => "TransportWebhookLogMessage", + "v2.transport_webhook_log_message_auth" => "TransportWebhookLogMessageAuth", + "v2.transport_webhook_log_message_custom_args" => "TransportWebhookLogMessageCustomArgs", + "v2.transport_webhook_log_message_id" => "TransportWebhookLogMessageId", + "v2.transport_webhook_log_message_response" => "TransportWebhookLogMessageResponse", + "v2.transport_webhook_log_message_timestamp" => "TransportWebhookLogMessageTimestamp", + "v2.transport_webhook_log_network" => "TransportWebhookLogNetwork", + "v2.transport_webhook_log_network_ip" => "TransportWebhookLogNetworkIp", + "v2.transport_webhook_log_org_metadata" => "TransportWebhookLogOrgMetadata", "v2.trigger" => "Trigger", "v2.trigger_attributes" => "TriggerAttributes", "v2.trigger_investigation_request" => "TriggerInvestigationRequest", @@ -6412,6 +6425,7 @@ def overrides "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", "v2.downtimes_api" => "DowntimesAPI", + "v2.email_transport_api" => "EmailTransportAPI", "v2.entity_risk_scores_api" => "EntityRiskScoresAPI", "v2.error_tracking_api" => "ErrorTrackingAPI", "v2.events_api" => "EventsAPI", diff --git a/lib/datadog_api_client/v2/api/email_transport_api.rb b/lib/datadog_api_client/v2/api/email_transport_api.rb new file mode 100644 index 000000000000..66cf3b7e297b --- /dev/null +++ b/lib/datadog_api_client/v2/api/email_transport_api.rb @@ -0,0 +1,101 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class EmailTransportAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Ingest email transport webhook events. + # + # @see #create_email_transport_webhook_intake_with_http_info + def create_email_transport_webhook_intake(body, opts = {}) + create_email_transport_webhook_intake_with_http_info(body, opts) + nil + end + + # Ingest email transport webhook events. + # + # Receives a batch of email transport webhook log events and emits an audit trail entry + # for each event with a final delivery status (delivered, dropped, or bounced). + # Only authorized organizations can submit events. + # + # @param body [Array] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_email_transport_webhook_intake_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_email_transport_webhook_intake".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_email_transport_webhook_intake") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_email_transport_webhook_intake")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EmailTransportAPI.create_email_transport_webhook_intake ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EmailTransportAPI.create_email_transport_webhook_intake" + end + # resource path + local_var_path = '/api/v2/email/transport/webhook_intake' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_email_transport_webhook_intake, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EmailTransportAPI#create_email_transport_webhook_intake\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log.rb b/lib/datadog_api_client/v2/models/transport_webhook_log.rb new file mode 100644 index 000000000000..1a6b19482a8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log.rb @@ -0,0 +1,230 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single email transport webhook log event. + class TransportWebhookLog + include BaseGenericModel + + # Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. + attr_reader :attributes + + # The ISO 8601 timestamp of the event. + attr_reader :date + + # The unique log event identifier. + attr_reader :log_id + + # The email transport provider. + attr_reader :source + + # The log status level. + attr_reader :status + + # A list of tags associated with the event. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'date' => :'date', + :'log_id' => :'log_id', + :'source' => :'source', + :'status' => :'status', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TransportWebhookLogAttributes', + :'date' => :'Time', + :'log_id' => :'String', + :'source' => :'String', + :'status' => :'String', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLog` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'log_id') + self.log_id = attributes[:'log_id'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @date.nil? + return false if @log_id.nil? + return false if @source.nil? + return false if @status.nil? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param date [Object] Object to be assigned + # @!visibility private + def date=(date) + if date.nil? + fail ArgumentError, 'invalid value for "date", date cannot be nil.' + end + @date = date + end + + # Custom attribute writer method with validation + # @param log_id [Object] Object to be assigned + # @!visibility private + def log_id=(log_id) + if log_id.nil? + fail ArgumentError, 'invalid value for "log_id", log_id cannot be nil.' + end + @log_id = log_id + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + date == o.date && + log_id == o.log_id && + source == o.source && + status == o.status && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, date, log_id, source, status, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_attributes.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_attributes.rb new file mode 100644 index 000000000000..db90bbbd160c --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_attributes.rb @@ -0,0 +1,227 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. + class TransportWebhookLogAttributes + include BaseGenericModel + + # The event categories. + attr_accessor :category + + # The email address details. + attr_accessor :email + + # The unique email identifier. + attr_accessor :email_id + + # The human-readable email type name. + attr_accessor :email_type_display_name + + # The message delivery event details. + attr_accessor :message + + # The network information for the event. + attr_accessor :network + + # The numeric organization identifier. + attr_accessor :org + + # Metadata about the organization that sent the email. + attr_accessor :org_metadata + + # The organization UUID. + attr_accessor :org_uuid + + # The timestamp when the email was queued. + attr_accessor :queue_time + + # Indicates whether the open event was triggered by automated machine activity rather than a human recipient (SendGrid-specific). + attr_accessor :sg_machine_open + + # The email subject line. + attr_accessor :subject + + # The user agent string for open events. + attr_accessor :useragent + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'email' => :'email', + :'email_id' => :'email_id', + :'email_type_display_name' => :'email_type_display_name', + :'message' => :'message', + :'network' => :'network', + :'org' => :'org', + :'org_metadata' => :'org_metadata', + :'org_uuid' => :'org_uuid', + :'queue_time' => :'queue_time', + :'sg_machine_open' => :'sg_machine_open', + :'subject' => :'subject', + :'useragent' => :'useragent' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'Array', + :'email' => :'TransportWebhookLogEmail', + :'email_id' => :'String', + :'email_type_display_name' => :'String', + :'message' => :'TransportWebhookLogMessage', + :'network' => :'TransportWebhookLogNetwork', + :'org' => :'Integer', + :'org_metadata' => :'TransportWebhookLogOrgMetadata', + :'org_uuid' => :'String', + :'queue_time' => :'String', + :'sg_machine_open' => :'Boolean', + :'subject' => :'String', + :'useragent' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + if (value = attributes[:'category']).is_a?(Array) + self.category = value + end + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'email_id') + self.email_id = attributes[:'email_id'] + end + + if attributes.key?(:'email_type_display_name') + self.email_type_display_name = attributes[:'email_type_display_name'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'network') + self.network = attributes[:'network'] + end + + if attributes.key?(:'org') + self.org = attributes[:'org'] + end + + if attributes.key?(:'org_metadata') + self.org_metadata = attributes[:'org_metadata'] + end + + if attributes.key?(:'org_uuid') + self.org_uuid = attributes[:'org_uuid'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'sg_machine_open') + self.sg_machine_open = attributes[:'sg_machine_open'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'useragent') + self.useragent = attributes[:'useragent'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + email == o.email && + email_id == o.email_id && + email_type_display_name == o.email_type_display_name && + message == o.message && + network == o.network && + org == o.org && + org_metadata == o.org_metadata && + org_uuid == o.org_uuid && + queue_time == o.queue_time && + sg_machine_open == o.sg_machine_open && + subject == o.subject && + useragent == o.useragent && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, email, email_id, email_type_display_name, message, network, org, org_metadata, org_uuid, queue_time, sg_machine_open, subject, useragent, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_email.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_email.rb new file mode 100644 index 000000000000..0801c236254c --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_email.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The email address details. + class TransportWebhookLogEmail + include BaseGenericModel + + # The recipient email address. + attr_accessor :address + + # The recipient domain. + attr_accessor :domain + + # The email subject line. + attr_accessor :subject + + # Email categorization tags applied by the transport provider (for example, "transactional", "marketing"). + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'address' => :'address', + :'domain' => :'domain', + :'subject' => :'subject', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'address' => :'String', + :'domain' => :'String', + :'subject' => :'String', + :'type' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogEmail` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'type') + if (value = attributes[:'type']).is_a?(Array) + self.type = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address == o.address && + domain == o.domain && + subject == o.subject && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [address, domain, subject, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_ip_attribute.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_ip_attribute.rb new file mode 100644 index 000000000000..242c4a67a973 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_ip_attribute.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An IP attribute with its sources. + class TransportWebhookLogIpAttribute + include BaseGenericModel + + # The IP address. + attr_accessor :ip + + # The transport providers or systems that reported this IP address. + attr_accessor :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ip' => :'ip', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ip' => :'String', + :'source' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogIpAttribute` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ip') + self.ip = attributes[:'ip'] + end + + if attributes.key?(:'source') + if (value = attributes[:'source']).is_a?(Array) + self.source = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ip == o.ip && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ip, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message.rb new file mode 100644 index 000000000000..9b66e80266ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The message delivery event details. + class TransportWebhookLogMessage + include BaseGenericModel + + # The message authentication details. + attr_accessor :auth + + # Custom arguments passed through the email transport provider for tracking. + attr_accessor :custom_args + + # The message identifiers. + attr_accessor :id + + # The delivery event type emitted by the transport provider (for example, "delivered", "dropped", "bounced"). + attr_accessor :name + + # The SMTP response information. + attr_accessor :response + + # The IP address of the sending server. + attr_accessor :sender_ip + + # The message delivery timing information. + attr_accessor :timestamp + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth' => :'auth', + :'custom_args' => :'custom_args', + :'id' => :'id', + :'name' => :'name', + :'response' => :'response', + :'sender_ip' => :'sender_ip', + :'timestamp' => :'timestamp' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth' => :'TransportWebhookLogMessageAuth', + :'custom_args' => :'TransportWebhookLogMessageCustomArgs', + :'id' => :'TransportWebhookLogMessageId', + :'name' => :'String', + :'response' => :'TransportWebhookLogMessageResponse', + :'sender_ip' => :'String', + :'timestamp' => :'TransportWebhookLogMessageTimestamp' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'auth') + self.auth = attributes[:'auth'] + end + + if attributes.key?(:'custom_args') + self.custom_args = attributes[:'custom_args'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'response') + self.response = attributes[:'response'] + end + + if attributes.key?(:'sender_ip') + self.sender_ip = attributes[:'sender_ip'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth == o.auth && + custom_args == o.custom_args && + id == o.id && + name == o.name && + response == o.response && + sender_ip == o.sender_ip && + timestamp == o.timestamp && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth, custom_args, id, name, response, sender_ip, timestamp, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message_auth.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message_auth.rb new file mode 100644 index 000000000000..5715fb9c3fea --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message_auth.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The message authentication details. + class TransportWebhookLogMessageAuth + include BaseGenericModel + + # The TLS version or negotiation information. + attr_accessor :delivered_with_tls + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'delivered_with_tls' => :'delivered_with_tls' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'delivered_with_tls' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessageAuth` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'delivered_with_tls') + self.delivered_with_tls = attributes[:'delivered_with_tls'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + delivered_with_tls == o.delivered_with_tls && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [delivered_with_tls, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message_custom_args.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message_custom_args.rb new file mode 100644 index 000000000000..5a5d604670e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message_custom_args.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Custom arguments passed through the email transport provider for tracking. + class TransportWebhookLogMessageCustomArgs + include BaseGenericModel + + # The unique email identifier. + attr_accessor :email_id + + # The human-readable email type name. + attr_accessor :email_type_display_name + + # The organization UUID. + attr_accessor :org_uuid + + # The timestamp when the email was queued. + attr_accessor :queue_time + + # The email subject line. + attr_accessor :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email_id' => :'email_id', + :'email_type_display_name' => :'email_type_display_name', + :'org_uuid' => :'org_uuid', + :'queue_time' => :'queue_time', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email_id' => :'String', + :'email_type_display_name' => :'String', + :'org_uuid' => :'String', + :'queue_time' => :'String', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessageCustomArgs` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email_id') + self.email_id = attributes[:'email_id'] + end + + if attributes.key?(:'email_type_display_name') + self.email_type_display_name = attributes[:'email_type_display_name'] + end + + if attributes.key?(:'org_uuid') + self.org_uuid = attributes[:'org_uuid'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email_id == o.email_id && + email_type_display_name == o.email_type_display_name && + org_uuid == o.org_uuid && + queue_time == o.queue_time && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email_id, email_type_display_name, org_uuid, queue_time, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message_id.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message_id.rb new file mode 100644 index 000000000000..1e8028854bf4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message_id.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The message identifiers. + class TransportWebhookLogMessageId + include BaseGenericModel + + # The RFC 5322 Message-ID. + attr_accessor :message_id + + # The SMTP transaction identifier. + attr_accessor :smtp_id + + # The transport provider event identifier. + attr_accessor :transport_event_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message_id' => :'message_id', + :'smtp_id' => :'smtp_id', + :'transport_event_id' => :'transport_event_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message_id' => :'String', + :'smtp_id' => :'String', + :'transport_event_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessageId` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] + end + + if attributes.key?(:'smtp_id') + self.smtp_id = attributes[:'smtp_id'] + end + + if attributes.key?(:'transport_event_id') + self.transport_event_id = attributes[:'transport_event_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message_id == o.message_id && + smtp_id == o.smtp_id && + transport_event_id == o.transport_event_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message_id, smtp_id, transport_event_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message_response.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message_response.rb new file mode 100644 index 000000000000..25f71b42a3db --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The SMTP response information. + class TransportWebhookLogMessageResponse + include BaseGenericModel + + # The enhanced SMTP status code. + attr_accessor :enhanced_smtp_code + + # The SMTP response message. + attr_accessor :reason + + # The SMTP status code. + attr_accessor :smtp_code + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enhanced_smtp_code' => :'enhanced_smtp_code', + :'reason' => :'reason', + :'smtp_code' => :'smtp_code' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enhanced_smtp_code' => :'String', + :'reason' => :'String', + :'smtp_code' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessageResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enhanced_smtp_code') + self.enhanced_smtp_code = attributes[:'enhanced_smtp_code'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'smtp_code') + self.smtp_code = attributes[:'smtp_code'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enhanced_smtp_code == o.enhanced_smtp_code && + reason == o.reason && + smtp_code == o.smtp_code && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enhanced_smtp_code, reason, smtp_code, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_message_timestamp.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_message_timestamp.rb new file mode 100644 index 000000000000..22a6071b5ab3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_message_timestamp.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The message delivery timing information. + class TransportWebhookLogMessageTimestamp + include BaseGenericModel + + # The Unix timestamp of the event. + attr_accessor :event_timestamp + + # The total delivery time in seconds. + attr_accessor :lifetime + + # Number of seconds the message spent in the delivery queue. + attr_accessor :queue_time + + # The scheduled delivery time as a Unix timestamp. + attr_accessor :scheduled_time + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'event_timestamp' => :'event_timestamp', + :'lifetime' => :'lifetime', + :'queue_time' => :'queue_time', + :'scheduled_time' => :'scheduled_time' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'event_timestamp' => :'Float', + :'lifetime' => :'Float', + :'queue_time' => :'Float', + :'scheduled_time' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogMessageTimestamp` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'event_timestamp') + self.event_timestamp = attributes[:'event_timestamp'] + end + + if attributes.key?(:'lifetime') + self.lifetime = attributes[:'lifetime'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'scheduled_time') + self.scheduled_time = attributes[:'scheduled_time'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_timestamp == o.event_timestamp && + lifetime == o.lifetime && + queue_time == o.queue_time && + scheduled_time == o.scheduled_time && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [event_timestamp, lifetime, queue_time, scheduled_time, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_network.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_network.rb new file mode 100644 index 000000000000..c91229b63137 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_network.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The network information for the event. + class TransportWebhookLogNetwork + include BaseGenericModel + + # The IP address information. + attr_accessor :ip + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ip' => :'ip' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ip' => :'TransportWebhookLogNetworkIp' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogNetwork` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ip') + self.ip = attributes[:'ip'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ip == o.ip && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ip, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_network_ip.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_network_ip.rb new file mode 100644 index 000000000000..ebaa7c4621d1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_network_ip.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The IP address information. + class TransportWebhookLogNetworkIp + include BaseGenericModel + + # Per-IP attribute records, each pairing an IP address with the providers that observed it. + attr_accessor :attributes + + # The list of IP addresses. + attr_accessor :list + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'list' => :'list' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'Array', + :'list' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogNetworkIp` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + if (value = attributes[:'attributes']).is_a?(Array) + self.attributes = value + end + end + + if attributes.key?(:'list') + if (value = attributes[:'list']).is_a?(Array) + self.list = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + list == o.list && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, list, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/transport_webhook_log_org_metadata.rb b/lib/datadog_api_client/v2/models/transport_webhook_log_org_metadata.rb new file mode 100644 index 000000000000..b1a7546abf53 --- /dev/null +++ b/lib/datadog_api_client/v2/models/transport_webhook_log_org_metadata.rb @@ -0,0 +1,255 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata about the organization that sent the email. + class TransportWebhookLogOrgMetadata + include BaseGenericModel + + # Country code or name used for billing purposes. + attr_accessor :billing_country + + # The Datadog billing plan for the organization (for example, "pro", "enterprise"). + attr_accessor :billing_plan + + # Support or account tier assigned to the organization (for example, "tier-1"). + attr_accessor :customer_tier + + # Primary email domain associated with the organization (for example, "example.com"). + attr_accessor :domain + + # Industry classification of the organization (for example, "technology", "finance"). + attr_accessor :industry + + # Whether the organization is enrolled in the Datadog bug bounty program. + attr_accessor :is_bugbounty + + # Whether the organization operates as a Managed Service Provider managing child orgs. + attr_accessor :is_msp + + # Display name of the organization as configured in Datadog account settings. + attr_accessor :name + + # Globally unique identifier for the Datadog organization (UUID v1 format). + attr_accessor :org_uuid + + # Identifier of the immediate parent organization, if this is a child org. + attr_accessor :parent_org_id + + # Whether the organization has a premium support plan with Datadog. + attr_accessor :premium_support + + # Identifier of the top-level parent organization in a multi-org account hierarchy. + attr_accessor :root_org_id + + # Display name of the top-level parent organization in a multi-org account hierarchy. + attr_accessor :root_org_name + + # Country code or name used for shipping or regional assignment. + attr_accessor :shipping_country + + # Website URL provided during organization registration. + attr_accessor :website + + # ISO 8601 timestamp of when the Datadog organization was created. + attr_accessor :when_created + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'billing_country' => :'billing_country', + :'billing_plan' => :'billing_plan', + :'customer_tier' => :'customer_tier', + :'domain' => :'domain', + :'industry' => :'industry', + :'is_bugbounty' => :'is_bugbounty', + :'is_msp' => :'is_msp', + :'name' => :'name', + :'org_uuid' => :'org_uuid', + :'parent_org_id' => :'parent_org_id', + :'premium_support' => :'premium_support', + :'root_org_id' => :'root_org_id', + :'root_org_name' => :'root_org_name', + :'shipping_country' => :'shipping_country', + :'website' => :'website', + :'when_created' => :'when_created' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'billing_country' => :'String', + :'billing_plan' => :'String', + :'customer_tier' => :'String', + :'domain' => :'String', + :'industry' => :'String', + :'is_bugbounty' => :'String', + :'is_msp' => :'String', + :'name' => :'String', + :'org_uuid' => :'String', + :'parent_org_id' => :'String', + :'premium_support' => :'String', + :'root_org_id' => :'String', + :'root_org_name' => :'String', + :'shipping_country' => :'String', + :'website' => :'String', + :'when_created' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TransportWebhookLogOrgMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'billing_country') + self.billing_country = attributes[:'billing_country'] + end + + if attributes.key?(:'billing_plan') + self.billing_plan = attributes[:'billing_plan'] + end + + if attributes.key?(:'customer_tier') + self.customer_tier = attributes[:'customer_tier'] + end + + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'industry') + self.industry = attributes[:'industry'] + end + + if attributes.key?(:'is_bugbounty') + self.is_bugbounty = attributes[:'is_bugbounty'] + end + + if attributes.key?(:'is_msp') + self.is_msp = attributes[:'is_msp'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_uuid') + self.org_uuid = attributes[:'org_uuid'] + end + + if attributes.key?(:'parent_org_id') + self.parent_org_id = attributes[:'parent_org_id'] + end + + if attributes.key?(:'premium_support') + self.premium_support = attributes[:'premium_support'] + end + + if attributes.key?(:'root_org_id') + self.root_org_id = attributes[:'root_org_id'] + end + + if attributes.key?(:'root_org_name') + self.root_org_name = attributes[:'root_org_name'] + end + + if attributes.key?(:'shipping_country') + self.shipping_country = attributes[:'shipping_country'] + end + + if attributes.key?(:'website') + self.website = attributes[:'website'] + end + + if attributes.key?(:'when_created') + self.when_created = attributes[:'when_created'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + billing_country == o.billing_country && + billing_plan == o.billing_plan && + customer_tier == o.customer_tier && + domain == o.domain && + industry == o.industry && + is_bugbounty == o.is_bugbounty && + is_msp == o.is_msp && + name == o.name && + org_uuid == o.org_uuid && + parent_org_id == o.parent_org_id && + premium_support == o.premium_support && + root_org_id == o.root_org_id && + root_org_name == o.root_org_name && + shipping_country == o.shipping_country && + website == o.website && + when_created == o.when_created && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [billing_country, billing_plan, customer_tier, domain, industry, is_bugbounty, is_msp, name, org_uuid, parent_org_id, premium_support, root_org_id, root_org_name, shipping_country, website, when_created, additional_properties].hash + end + end +end