diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index abac03b8a87..1d7a005fe3d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41237,6 +41237,114 @@ components: type: string x-enum-varnames: - PROCESS + ProductAnalyticsServerSideEventError: + description: Error details. + properties: + detail: + description: Error message. + example: Malformed payload + type: string + status: + description: Error code. + example: '400' + type: string + title: + description: Error title. + example: Bad Request + type: string + type: object + ProductAnalyticsServerSideEventErrors: + description: Error response. + properties: + errors: + description: Structured errors. + items: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventError' + type: array + type: object + ProductAnalyticsServerSideEventItem: + description: A Product Analytics server-side event. + properties: + account: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemAccount' + application: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemApplication' + event: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemEvent' + session: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemSession' + type: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemType' + usr: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItemUsr' + required: + - application + - event + - type + type: object + ProductAnalyticsServerSideEventItemAccount: + description: The account linked to your event. + properties: + id: + description: The account ID used in Datadog. + example: account-67890 + type: string + required: + - id + type: object + ProductAnalyticsServerSideEventItemApplication: + description: The application in which you want to send your events. + properties: + id: + description: 'The application ID of your application. It can be found in + your + + [application management page](https://app.datadoghq.com/rum/list).' + example: 123abcde-123a-123b-1234-123456789abc + type: string + required: + - id + type: object + ProductAnalyticsServerSideEventItemEvent: + description: Fields used for the event. + properties: + name: + description: The name of your event, which is used for search in the same + way as view or action names. + example: payment.processed + type: string + required: + - name + type: object + ProductAnalyticsServerSideEventItemSession: + description: The session linked to your event. + properties: + id: + description: The session ID captured by the SDK. + example: session-abcdef + type: string + required: + - id + type: object + ProductAnalyticsServerSideEventItemType: + description: The type of Product Analytics event. Must be `server` for server-side + events. + enum: + - server + example: server + type: string + x-enum-varnames: + - SERVER + ProductAnalyticsServerSideEventItemUsr: + description: The user linked to your event. + properties: + id: + description: The user ID used in Datadog. + example: user-12345 + type: string + required: + - id + type: object Project: description: A Project properties: @@ -78009,6 +78117,218 @@ paths: x-permission: operator: OPEN permissions: [] + /api/v2/prodlytics: + post: + description: 'Send server-side events to Product Analytics. Server-side events + are retained for 15 months. + + + Server-Side events in Product Analytics are helpful for tracking events that + occur on the server, + + as opposed to client-side events, which are captured by Real User Monitoring + (RUM) SDKs. + + This allows for a more comprehensive view of the user journey by including + actions that happen on the server. + + Typical examples could be `checkout.completed` or `payment.processed`. + + + Ingested server-side events are integrated into Product Analytics to allow + users to select and filter + + these events in the event picker, similar to how views or actions are handled. + + + **Requirements:** + + - At least one of `usr`, `account`, or `session` must be provided with a valid + ID. + + - The `application.id` must reference a Product Analytics-enabled application. + + + **Custom Attributes:** + + Any additional fields in the payload are flattened and searchable as facets. + + For example, a payload with `{"customer": {"tier": "premium"}}` is searchable + with + + the syntax `@customer.tier:premium` in Datadog. + + + The status codes answered by the HTTP API are: + + - 202: Accepted: The request has been accepted for processing + + - 400: Bad request (likely an issue in the payload formatting) + + - 401: Unauthorized (likely a missing API Key) + + - 403: Permission issue (likely using an invalid API Key) + + - 408: Request Timeout, request should be retried after some time + + - 413: Payload too large (batch is above 5MB uncompressed) + + - 429: Too Many Requests, request should be retried after some time + + - 500: Internal Server Error, the server encountered an unexpected condition + that prevented it from fulfilling the request, request should be retried after + some time + + - 503: Service Unavailable, the server is not ready to handle the request + probably because it is overloaded, request should be retried after some time' + operationId: SubmitProductAnalyticsEvent + requestBody: + content: + application/json: + examples: + event-with-account: + description: Send a server-side event linked to an account. + summary: Event with account ID + value: + account: + id: account-456 + application: + id: 123abcde-123a-123b-1234-123456789abc + event: + name: checkout.completed + type: server + event-with-custom-attributes: + description: Send a server-side event with additional custom attributes. + summary: Event with custom attributes + value: + application: + id: 123abcde-123a-123b-1234-123456789abc + customer: + tier: premium + event: + name: payment.processed + type: server + usr: + id: '123' + event-with-session: + description: Send a server-side event linked to a session. + summary: Event with session ID + value: + application: + id: 123abcde-123a-123b-1234-123456789abc + event: + name: form.submitted + session: + id: session-789 + type: server + simple-event-with-user: + description: Send a server-side event linked to a user. + summary: Simple event with user ID + value: + application: + id: 123abcde-123a-123b-1234-123456789abc + event: + name: payment.processed + type: server + usr: + id: '123' + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventItem' + description: Server-side event to send (JSON format). + required: true + responses: + '202': + content: + application/json: + schema: + type: object + description: Request accepted for processing (always 202 empty JSON). + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Forbidden + '408': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Request Timeout + '413': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Payload Too Large + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors' + description: Service Unavailable + security: + - apiKeyAuth: [] + servers: + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The regional site for customers. + enum: + - datadoghq.com + - us3.datadoghq.com + - us5.datadoghq.com + - ap1.datadoghq.com + - ap2.datadoghq.com + - datadoghq.eu + subdomain: + default: browser-intake + description: The subdomain where the API is deployed. + - url: '{protocol}://{name}' + variables: + name: + default: browser-intake-datadoghq.com + description: Full site DNS name. + protocol: + default: https + description: The protocol for accessing the API. + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: Any Datadog deployment. + subdomain: + default: browser-intake + description: The subdomain where the API is deployed. + summary: Send server-side events + tags: + - Product Analytics + x-codegen-request-body-name: body /api/v2/product-analytics/accounts/facet_info: post: description: Get facet information for account attributes including possible @@ -90205,6 +90525,18 @@ tags: See the [Live Processes page](https://docs.datadoghq.com/infrastructure/process/) for more information. name: Processes +- description: 'Send server-side events to Product Analytics. Server-Side Events Ingestion + allows you to collect custom events + + from any server-side source, and retains events for 15 months. Server-side events + are helpful for understanding + + causes of a funnel drop-off which are external to the client-side (for example, + payment processing error). + + See the [Product Analytics page](https://docs.datadoghq.com/product_analytics/) + for more information.' + name: Product Analytics - description: Manage your Real User Monitoring (RUM) applications, and search or aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information diff --git a/examples/v2/product-analytics/SubmitProductAnalyticsEvent.rb b/examples/v2/product-analytics/SubmitProductAnalyticsEvent.rb new file mode 100644 index 00000000000..b9afa87019b --- /dev/null +++ b/examples/v2/product-analytics/SubmitProductAnalyticsEvent.rb @@ -0,0 +1,24 @@ +# Send server-side events returns "Request accepted for processing (always 202 empty JSON)." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsServerSideEventItem.new({ + account: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemAccount.new({ + id: "account-67890", + }), + application: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemApplication.new({ + id: "123abcde-123a-123b-1234-123456789abc", + }), + event: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemEvent.new({ + name: "payment.processed", + }), + session: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemSession.new({ + id: "session-abcdef", + }), + type: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemType::SERVER, + usr: DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemUsr.new({ + id: "user-12345", + }), +}) +p api_instance.submit_product_analytics_event(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 5980fcaf991..a1c4c68b197 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2825,6 +2825,9 @@ "page_limit" => "Integer", "page_cursor" => "String", }, + "v2.SubmitProductAnalyticsEvent" => { + "body" => "ProductAnalyticsServerSideEventItem", + }, "v2.GetAccountFacetInfo" => { "body" => "FacetInfoRequest", }, diff --git a/features/v2/product_analytics.feature b/features/v2/product_analytics.feature new file mode 100644 index 00000000000..a915c213041 --- /dev/null +++ b/features/v2/product_analytics.feature @@ -0,0 +1,35 @@ +@endpoint(product-analytics) @endpoint(product-analytics-v2) +Feature: Product Analytics + Send server-side events to Product Analytics. Server-Side Events Ingestion + allows you to collect custom events from any server-side source, and + retains events for 15 months. Server-side events are helpful for + understanding causes of a funnel drop-off which are external to the + client-side (for example, payment processing error). See the [Product + Analytics page](https://docs.datadoghq.com/product_analytics/) for more + information. + + Background: + Given a valid "apiKeyAuth" key in the system + And an instance of "ProductAnalytics" API + And new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Send server-side events returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Send server-side events returns "Payload Too Large" response + When the request is sent + Then the response status is 413 Payload Too Large + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Send server-side events returns "Request Timeout" response + When the request is sent + Then the response status is 408 Request Timeout + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Send server-side events returns "Request accepted for processing (always 202 empty JSON)." response + When the request is sent + Then the response status is 202 Request accepted for processing (always 202 empty JSON). diff --git a/features/v2/undo.json b/features/v2/undo.json index eb43f26dbec..0867c10cd71 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3133,6 +3133,12 @@ "type": "safe" } }, + "SubmitProductAnalyticsEvent": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "GetAccountFacetInfo": { "tag": "Rum Audience Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 95ddf1221cd..3257b422c9b 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -906,6 +906,58 @@ def operation_server_settings } } ], + "v2.submit_product_analytics_event": [ + { + url: +"https://{subdomain}.{site}", + description: "No description provided", + variables: { + site: { + description: "The regional site for customers.", + default_value: "datadoghq.com", + enum_values: [ + "datadoghq.com", + "us3.datadoghq.com", + "us5.datadoghq.com", + "ap1.datadoghq.com", + "ap2.datadoghq.com", + "datadoghq.eu" + ] + }, + subdomain: { + description: "The subdomain where the API is deployed.", + default_value: "browser-intake", + } + } + }, + { + url: +"{protocol}://{name}", + description: "No description provided", + variables: { + name: { + description: "Full site DNS name.", + default_value: "browser-intake-datadoghq.com", + }, + protocol: { + description: "The protocol for accessing the API.", + default_value: "https", + } + } + }, + { + url: +"https://{subdomain}.{site}", + description: "No description provided", + variables: { + site: { + description: "Any Datadog deployment.", + default_value: "datadoghq.com", + }, + subdomain: { + description: "The subdomain where the API is deployed.", + default_value: "browser-intake", + } + } + } + ], } end diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 94cccd52c2b..5aacc4f79d7 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3523,6 +3523,15 @@ def overrides "v2.process_summary" => "ProcessSummary", "v2.process_summary_attributes" => "ProcessSummaryAttributes", "v2.process_summary_type" => "ProcessSummaryType", + "v2.product_analytics_server_side_event_error" => "ProductAnalyticsServerSideEventError", + "v2.product_analytics_server_side_event_errors" => "ProductAnalyticsServerSideEventErrors", + "v2.product_analytics_server_side_event_item" => "ProductAnalyticsServerSideEventItem", + "v2.product_analytics_server_side_event_item_account" => "ProductAnalyticsServerSideEventItemAccount", + "v2.product_analytics_server_side_event_item_application" => "ProductAnalyticsServerSideEventItemApplication", + "v2.product_analytics_server_side_event_item_event" => "ProductAnalyticsServerSideEventItemEvent", + "v2.product_analytics_server_side_event_item_session" => "ProductAnalyticsServerSideEventItemSession", + "v2.product_analytics_server_side_event_item_type" => "ProductAnalyticsServerSideEventItemType", + "v2.product_analytics_server_side_event_item_usr" => "ProductAnalyticsServerSideEventItemUsr", "v2.project" => "Project", "v2.project_attributes" => "ProjectAttributes", "v2.project_create" => "ProjectCreate", @@ -4778,6 +4787,7 @@ def overrides "v2.organizations_api" => "OrganizationsAPI", "v2.powerpack_api" => "PowerpackAPI", "v2.processes_api" => "ProcessesAPI", + "v2.product_analytics_api" => "ProductAnalyticsAPI", "v2.reference_tables_api" => "ReferenceTablesAPI", "v2.restriction_policies_api" => "RestrictionPoliciesAPI", "v2.roles_api" => "RolesAPI", diff --git a/lib/datadog_api_client/v2/api/product_analytics_api.rb b/lib/datadog_api_client/v2/api/product_analytics_api.rb new file mode 100644 index 00000000000..1c2ba60db28 --- /dev/null +++ b/lib/datadog_api_client/v2/api/product_analytics_api.rb @@ -0,0 +1,121 @@ +=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 ProductAnalyticsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Send server-side events. + # + # @see #submit_product_analytics_event_with_http_info + def submit_product_analytics_event(body, opts = {}) + data, _status_code, _headers = submit_product_analytics_event_with_http_info(body, opts) + data + end + + # Send server-side events. + # + # Send server-side events to Product Analytics. Server-side events are retained for 15 months. + # + # Server-Side events in Product Analytics are helpful for tracking events that occur on the server, + # as opposed to client-side events, which are captured by Real User Monitoring (RUM) SDKs. + # This allows for a more comprehensive view of the user journey by including actions that happen on the server. + # Typical examples could be `checkout.completed` or `payment.processed`. + # + # Ingested server-side events are integrated into Product Analytics to allow users to select and filter + # these events in the event picker, similar to how views or actions are handled. + # + # **Requirements:** + # - At least one of `usr`, `account`, or `session` must be provided with a valid ID. + # - The `application.id` must reference a Product Analytics-enabled application. + # + # **Custom Attributes:** + # Any additional fields in the payload are flattened and searchable as facets. + # For example, a payload with `{"customer": {"tier": "premium"}}` is searchable with + # the syntax `@customer.tier:premium` in Datadog. + # + # The status codes answered by the HTTP API are: + # - 202: Accepted: The request has been accepted for processing + # - 400: Bad request (likely an issue in the payload formatting) + # - 401: Unauthorized (likely a missing API Key) + # - 403: Permission issue (likely using an invalid API Key) + # - 408: Request Timeout, request should be retried after some time + # - 413: Payload too large (batch is above 5MB uncompressed) + # - 429: Too Many Requests, request should be retried after some time + # - 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time + # - 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time + # + # @param body [ProductAnalyticsServerSideEventItem] Server-side event to send (JSON format). + # @param opts [Hash] the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def submit_product_analytics_event_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.submit_product_analytics_event ...' + 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 ProductAnalyticsAPI.submit_product_analytics_event" + end + # resource path + local_var_path = '/api/v2/prodlytics' + + # 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(['application/json']) + # 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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth] + + new_options = opts.merge( + :operation => :submit_product_analytics_event, + :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: ProductAnalyticsAPI#submit_product_analytics_event\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/product_analytics_server_side_event_error.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_error.rb new file mode 100644 index 00000000000..089130eee68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_error.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 + # Error details. + class ProductAnalyticsServerSideEventError + include BaseGenericModel + + # Error message. + attr_accessor :detail + + # Error code. + attr_accessor :status + + # Error title. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'detail' => :'detail', + :'status' => :'status', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'detail' => :'String', + :'status' => :'String', + :'title' => :'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::ProductAnalyticsServerSideEventError` 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?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 && + detail == o.detail && + status == o.status && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [detail, status, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_errors.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_errors.rb new file mode 100644 index 00000000000..fcb567994fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_errors.rb @@ -0,0 +1,107 @@ +=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 + # Error response. + class ProductAnalyticsServerSideEventErrors + include BaseGenericModel + + # Structured errors. + attr_accessor :errors + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'errors' => :'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::ProductAnalyticsServerSideEventErrors` 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?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = 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 && + errors == o.errors && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [errors, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item.rb new file mode 100644 index 00000000000..cebf50b1a2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item.rb @@ -0,0 +1,195 @@ +=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 Product Analytics server-side event. + class ProductAnalyticsServerSideEventItem + include BaseGenericModel + + # The account linked to your event. + attr_accessor :account + + # The application in which you want to send your events. + attr_reader :application + + # Fields used for the event. + attr_reader :event + + # The session linked to your event. + attr_accessor :session + + # The type of Product Analytics event. Must be `server` for server-side events. + attr_reader :type + + # The user linked to your event. + attr_accessor :usr + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account' => :'account', + :'application' => :'application', + :'event' => :'event', + :'session' => :'session', + :'type' => :'type', + :'usr' => :'usr' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account' => :'ProductAnalyticsServerSideEventItemAccount', + :'application' => :'ProductAnalyticsServerSideEventItemApplication', + :'event' => :'ProductAnalyticsServerSideEventItemEvent', + :'session' => :'ProductAnalyticsServerSideEventItemSession', + :'type' => :'ProductAnalyticsServerSideEventItemType', + :'usr' => :'ProductAnalyticsServerSideEventItemUsr' + } + 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::ProductAnalyticsServerSideEventItem` 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?(:'account') + self.account = attributes[:'account'] + end + + if attributes.key?(:'application') + self.application = attributes[:'application'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'usr') + self.usr = attributes[:'usr'] + 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 @application.nil? + return false if @event.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param application [Object] Object to be assigned + # @!visibility private + def application=(application) + if application.nil? + fail ArgumentError, 'invalid value for "application", application cannot be nil.' + end + @application = application + end + + # Custom attribute writer method with validation + # @param event [Object] Object to be assigned + # @!visibility private + def event=(event) + if event.nil? + fail ArgumentError, 'invalid value for "event", event cannot be nil.' + end + @event = event + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + account == o.account && + application == o.application && + event == o.event && + session == o.session && + type == o.type && + usr == o.usr && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account, application, event, session, type, usr, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_account.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_account.rb new file mode 100644 index 00000000000..6afa27e3c99 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_account.rb @@ -0,0 +1,123 @@ +=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 account linked to your event. + class ProductAnalyticsServerSideEventItemAccount + include BaseGenericModel + + # The account ID used in Datadog. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'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::ProductAnalyticsServerSideEventItemAccount` 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?(:'id') + self.id = attributes[:'id'] + 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 @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_application.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_application.rb new file mode 100644 index 00000000000..ee555704034 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_application.rb @@ -0,0 +1,124 @@ +=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 application in which you want to send your events. + class ProductAnalyticsServerSideEventItemApplication + include BaseGenericModel + + # The application ID of your application. It can be found in your + # [application management page](https://app.datadoghq.com/rum/list). + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'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::ProductAnalyticsServerSideEventItemApplication` 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?(:'id') + self.id = attributes[:'id'] + 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 @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_event.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_event.rb new file mode 100644 index 00000000000..35543665076 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_event.rb @@ -0,0 +1,123 @@ +=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 + # Fields used for the event. + class ProductAnalyticsServerSideEventItemEvent + include BaseGenericModel + + # The name of your event, which is used for search in the same way as view or action names. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'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::ProductAnalyticsServerSideEventItemEvent` 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?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_session.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_session.rb new file mode 100644 index 00000000000..5d823e1aba4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_session.rb @@ -0,0 +1,123 @@ +=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 session linked to your event. + class ProductAnalyticsServerSideEventItemSession + include BaseGenericModel + + # The session ID captured by the SDK. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'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::ProductAnalyticsServerSideEventItemSession` 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?(:'id') + self.id = attributes[:'id'] + 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 @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_type.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_type.rb new file mode 100644 index 00000000000..e8ae42c88c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_type.rb @@ -0,0 +1,26 @@ +=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 type of Product Analytics event. Must be `server` for server-side events. + class ProductAnalyticsServerSideEventItemType + include BaseEnumModel + + SERVER = "server".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_usr.rb b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_usr.rb new file mode 100644 index 00000000000..511c0b285c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_usr.rb @@ -0,0 +1,123 @@ +=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 user linked to your event. + class ProductAnalyticsServerSideEventItemUsr + include BaseGenericModel + + # The user ID used in Datadog. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'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::ProductAnalyticsServerSideEventItemUsr` 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?(:'id') + self.id = attributes[:'id'] + 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 @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, additional_properties].hash + end + end +end