From bdc516534d063cc4938baea4b662dec53ca619e3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 May 2026 14:16:27 +0000 Subject: [PATCH] Regenerate client from commit d77d4df of spec repo --- .generator/schemas/v2/openapi.yaml | 578 ++++++++++++++++++ examples/v2/apm-trace/GetPrunedTraceByID.rb | 8 + examples/v2/apm-trace/GetTraceByID.rb | 8 + features/scenarios_model_mapping.rb | 14 + features/v2/apm_trace.feature | 48 ++ features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 13 + .../v2/api/apm_trace_api.rb | 194 ++++++ .../v2/models/apm_span_error_flag.rb | 27 + .../v2/models/apm_trace_span.rb | 428 +++++++++++++ .../v2/models/pruned_trace_attributes.rb | 170 ++++++ .../v2/models/pruned_trace_data.rb | 165 +++++ .../v2/models/pruned_trace_response.rb | 123 ++++ .../v2/models/pruned_trace_type.rb | 26 + .../v2/models/summarized_span.rb | 403 ++++++++++++ .../v2/models/summarized_trace.rb | 144 +++++ .../v2/models/trace_attributes.rb | 146 +++++ .../v2/models/trace_data.rb | 165 +++++ .../v2/models/trace_response.rb | 123 ++++ .../v2/models/trace_type.rb | 26 + 21 files changed, 2823 insertions(+) create mode 100644 examples/v2/apm-trace/GetPrunedTraceByID.rb create mode 100644 examples/v2/apm-trace/GetTraceByID.rb create mode 100644 features/v2/apm_trace.feature create mode 100644 lib/datadog_api_client/v2/api/apm_trace_api.rb create mode 100644 lib/datadog_api_client/v2/models/apm_span_error_flag.rb create mode 100644 lib/datadog_api_client/v2/models/apm_trace_span.rb create mode 100644 lib/datadog_api_client/v2/models/pruned_trace_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/pruned_trace_data.rb create mode 100644 lib/datadog_api_client/v2/models/pruned_trace_response.rb create mode 100644 lib/datadog_api_client/v2/models/pruned_trace_type.rb create mode 100644 lib/datadog_api_client/v2/models/summarized_span.rb create mode 100644 lib/datadog_api_client/v2/models/summarized_trace.rb create mode 100644 lib/datadog_api_client/v2/models/trace_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/trace_data.rb create mode 100644 lib/datadog_api_client/v2/models/trace_response.rb create mode 100644 lib/datadog_api_client/v2/models/trace_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 00379af6cab4..3cc1345fcb48 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1683,6 +1683,16 @@ components: example: 1706803070 format: int64 type: integer + TraceIDPathParameter: + description: |- + The trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID) + or a decimal string of up to 39 digits. + example: "0000000000000000abc1230000000000" + in: path + name: trace_id + required: true + schema: + type: string UserID: description: "The ID of the user." in: path @@ -2076,6 +2086,126 @@ components: required: - apiTrigger type: object + APMSpanErrorFlag: + description: Error flag for a span. `1` when the span is in error, `0` otherwise. + enum: + - 0 + - 1 + example: 0 + format: int32 + type: integer + x-enum-varnames: + - NO_ERROR + - ERROR + APMTraceSpan: + description: A single APM span returned as part of a trace. + properties: + duration: + description: The duration of the span, in nanoseconds. + example: 500000000 + format: int64 + type: integer + endTime: + description: The end time of the span, in Unix nanoseconds. + example: 1716800000500000000 + format: int64 + type: integer + error: + $ref: "#/components/schemas/APMSpanErrorFlag" + meta: + additionalProperties: + type: string + description: |- + String-valued tags attached to the span. Tag keys starting with `_` are + filtered out of the response. + example: + env: production + http.method: GET + type: object + metrics: + additionalProperties: + format: double + type: number + description: |- + Numeric metrics attached to the span. Metric keys starting with `_` are + filtered out of the response. + example: + http.status_code: 200 + type: object + name: + description: The operation name of the span. + example: web.request + type: string + parentID: + description: The ID of the parent span, or `0` when the span is a trace root. + example: 0 + format: int64 + type: integer + resource: + description: The resource that the span describes. + example: GET /products + type: string + resourceHash: + description: A hash of the resource field. + example: 6a4e9b7f + type: string + restricted: + description: Whether access to the span is restricted by the organization's data access policies. + example: false + type: boolean + self_time: + description: The time spent in the span itself, excluding time spent in child spans, in nanoseconds. + example: 250000000 + format: double + type: number + service: + description: The name of the service that emitted the span. + example: web-store + type: string + spanID: + description: The span ID, as an unsigned 64-bit integer. + example: 9876543210987654321 + format: int64 + type: integer + startTime: + description: The start time of the span, in Unix nanoseconds. + example: 1716800000000000000 + format: int64 + type: integer + traceID: + description: The lower 64 bits of the trace ID, as an unsigned 64-bit integer. + example: 12345678901234567890 + format: int64 + type: integer + traceIDFull: + description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + example: "0000000000000000abc1230000000000" + type: string + type: + description: The type of the span (for example, `web`, `db`, or `rpc`). + example: web + type: string + required: + - service + - name + - resource + - traceID + - spanID + - parentID + - startTime + - endTime + - duration + - error + - type + - meta + - metrics + - traceIDFull + type: object + APMTraceSpans: + description: The list of spans that compose the trace. + items: + $ref: "#/components/schemas/APMTraceSpan" + type: array AWSAccountConfigID: description: |- Unique Datadog ID of the AWS Account Integration Config. @@ -65547,6 +65677,60 @@ components: $ref: "#/components/schemas/Project" type: array type: object + PrunedTraceAttributes: + description: The attributes of a pruned trace returned by the Get pruned trace by ID endpoint. + properties: + is_truncated: + description: |- + Indicates whether the underlying trace was truncated because its size + exceeded the maximum that can be retrieved from storage. + example: false + type: boolean + size_bytes: + description: The size, in bytes, of the original (non-pruned) trace before summarization. + example: 12345 + format: int32 + maximum: 2147483647 + type: integer + summarized_trace: + $ref: "#/components/schemas/SummarizedTrace" + required: + - summarized_trace + - is_truncated + - size_bytes + type: object + PrunedTraceData: + description: A pruned trace resource document. + properties: + attributes: + $ref: "#/components/schemas/PrunedTraceAttributes" + id: + description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + example: "0000000000000000abc1230000000000" + type: string + type: + $ref: "#/components/schemas/PrunedTraceType" + required: + - id + - type + - attributes + type: object + PrunedTraceResponse: + description: Response containing a single pruned trace. + properties: + data: + $ref: "#/components/schemas/PrunedTraceData" + required: + - data + type: object + PrunedTraceType: + description: The type of the pruned trace resource. The value is always `pruned_trace`. + enum: + - pruned_trace + example: pruned_trace + type: string + x-enum-varnames: + - PRUNED_TRACE PublishAppResponse: description: The response object after an app is successfully published. properties: @@ -83078,6 +83262,110 @@ components: type: string x-enum-varnames: - SUITES_SEARCH + SummarizedSpan: + description: A node in the pruned trace tree. + properties: + children: + description: The child spans of this node in the pruned tree. + example: [] + items: + $ref: "#/components/schemas/SummarizedSpan" + type: array + durationSeconds: + description: The duration of the span, in seconds. + example: 0.5 + format: double + type: number + endTime: + description: The end time of the span, in RFC3339 format. + example: "2026-05-27T12:00:00.5Z" + format: date-time + type: string + error: + $ref: "#/components/schemas/APMSpanErrorFlag" + hidden_child_spans_count: + description: The number of child spans that were pruned from this node when summarizing the trace. + example: 0 + format: int32 + maximum: 2147483647 + type: integer + meta: + additionalProperties: + type: string + description: String-valued tags attached to the span. + example: + env: production + type: object + metrics: + additionalProperties: + format: double + type: number + description: Numeric metrics attached to the span. + example: + http.status_code: 200 + type: object + name: + description: The operation name of the span. + example: web.request + type: string + parentID: + description: The ID of the parent span, or `0` when the span is the trace root. + example: 0 + format: int64 + type: integer + resource: + description: The resource that the span describes. + example: GET /products + type: string + service: + description: The name of the service that emitted the span. + example: web-store + type: string + spanID: + description: The span ID, as an unsigned 64-bit integer. + example: 9876543210987654321 + format: int64 + type: integer + span_kind: + description: |- + The OpenTelemetry span kind, for example `INTERNAL`, `SERVER`, `CLIENT`, + `PRODUCER`, or `CONSUMER`. + example: SERVER + type: string + startTime: + description: The start time of the span, in RFC3339 format. + example: "2026-05-27T12:00:00Z" + format: date-time + type: string + required: + - service + - name + - resource + - parentID + - spanID + - startTime + - endTime + - durationSeconds + - error + - meta + - metrics + - span_kind + - hidden_child_spans_count + - children + type: object + SummarizedTrace: + description: A summarized, hierarchical view of a trace. + properties: + root: + $ref: "#/components/schemas/SummarizedSpan" + traceId: + description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + example: "0000000000000000abc1230000000000" + type: string + required: + - traceId + - root + type: object SuppressionVersionHistory: description: Response object containing the version history of a suppression. properties: @@ -90258,6 +90546,51 @@ components: type: string x-enum-varnames: - SECRET + TraceAttributes: + description: The attributes of a trace returned by the Get trace by ID endpoint. + properties: + is_truncated: + description: Indicates whether the trace was truncated because its size exceeded the maximum response payload. + example: false + type: boolean + spans: + $ref: "#/components/schemas/APMTraceSpans" + required: + - is_truncated + - spans + type: object + TraceData: + description: A trace resource document. + properties: + attributes: + $ref: "#/components/schemas/TraceAttributes" + id: + description: The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + example: "0000000000000000abc1230000000000" + type: string + type: + $ref: "#/components/schemas/TraceType" + required: + - id + - type + - attributes + type: object + TraceResponse: + description: Response containing a single trace. + properties: + data: + $ref: "#/components/schemas/TraceData" + required: + - data + type: object + TraceType: + description: The type of the trace resource. The value is always `trace`. + enum: + - trace + example: trace + type: string + x-enum-varnames: + - TRACE Trigger: description: "One of the triggers that can start the execution of a workflow." oneOf: @@ -140181,6 +140514,159 @@ paths: tags: - Rum Audience Management x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/pruned_trace/{trace_id}: + get: + description: |- + Retrieve a pruned, hierarchical view of an APM trace by its trace ID. + The trace is summarized as a tree of spans rooted at the trace root and reduced in size + to keep rendering large traces in the UI practical. + This endpoint is rate limited to `60` requests per minute per organization. + operationId: GetPrunedTraceByID + parameters: + - $ref: "#/components/parameters/TraceIDPathParameter" + - description: |- + Span ID to expand and preserve in the pruned tree even when its branch would + normally be summarized. + example: 9876543210987654321 + in: query + name: expand_span_id + required: false + schema: + format: int64 + type: integer + - description: |- + Optional Unix time hint, in seconds, used to optimize the lookup of the trace + in long-term storage. + example: 1716800000 + in: query + name: time_hint + required: false + schema: + format: int32 + maximum: 2147483647 + type: integer + - description: |- + Force the trace to be loaded from a specific source. When unset, the API picks + the source automatically. + example: driveline + in: query + name: force_source + required: false + schema: + type: string + - description: |- + Restrict the pruned tree to spans matching the given `key:value` pairs. + Values may be passed as repeated query parameters. + example: + - service:web-store + in: query + name: include_path + required: false + schema: + items: + type: string + type: array + - description: |- + Regex patterns of tag keys whose values must be included in the pruned spans. + Values may be passed as repeated query parameters. + example: + - "^http\\." + in: query + name: tag_include + required: false + schema: + items: + type: string + type: array + - description: |- + Regex patterns of tag keys whose values must be excluded from the pruned spans. + Values may be passed as repeated query parameters. + example: + - "^_dd\\." + in: query + name: tag_exclude + required: false + schema: + items: + type: string + type: array + - description: When set to `true`, only service entry spans are included in the pruned tree. + example: false + in: query + name: only_service_entry_spans + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + is_truncated: false + size_bytes: 12345 + summarized_trace: + root: + children: [] + durationSeconds: 0.5 + endTime: "2026-05-27T12:00:00.5Z" + error: 0 + hidden_child_spans_count: 0 + meta: + env: production + metrics: + http.status_code: 200 + name: web.request + parentID: 0 + resource: GET /products + service: web-store + spanID: 9876543210987654321 + span_kind: SERVER + startTime: "2026-05-27T12:00:00Z" + traceId: "0000000000000000abc1230000000000" + id: "0000000000000000abc1230000000000" + type: pruned_trace + schema: + $ref: "#/components/schemas/PrunedTraceResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "504": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Gateway Timeout + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_read + summary: Get a pruned trace by ID + tags: + - APM Trace + x-permission: + operator: OR + permissions: + - apm_read + 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/query/scalar: post: description: |- @@ -164778,6 +165264,96 @@ paths: operator: OR permissions: - test_optimization_read + /api/v2/trace/{trace_id}: + get: + description: |- + Retrieve a full APM trace by its trace ID, including every span in the trace. + Traces are returned from live storage when available and fall back to longer-term storage. + This endpoint is rate limited to `60` requests per minute per organization. + operationId: GetTraceByID + parameters: + - $ref: "#/components/parameters/TraceIDPathParameter" + - description: |- + List of span fields to include in the response. When omitted, every available field is returned. + Values may be passed as repeated query parameters or as a single comma-separated value. + example: + - service + - resource_name + in: query + name: include_fields + required: false + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + is_truncated: false + spans: + - duration: 500000000 + endTime: 1716800000500000000 + error: 0 + meta: + env: production + http.method: GET + metrics: + http.status_code: 200 + name: web.request + parentID: 0 + resource: GET /products + service: web-store + spanID: 9876543210987654321 + startTime: 1716800000000000000 + traceID: 12345678901234567890 + traceIDFull: 0000000000000000abc1230000000000 + type: web + id: "0000000000000000abc1230000000000" + type: trace + schema: + $ref: "#/components/schemas/TraceResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "413": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Payload Too Large + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_read + summary: Get a trace by ID + tags: + - APM Trace + x-permission: + operator: OR + permissions: + - apm_read + 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/usage/application_security: get: deprecated: true @@ -167504,6 +168080,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/ name: APM Retention Filters + - description: Retrieve full or pruned APM traces by trace ID. + name: APM Trace - description: |- Configure your Datadog-AWS integration directly through the Datadog API. For more information, see the [AWS integration page](https://docs.datadoghq.com/integrations/amazon_web_services). diff --git a/examples/v2/apm-trace/GetPrunedTraceByID.rb b/examples/v2/apm-trace/GetPrunedTraceByID.rb new file mode 100644 index 000000000000..7cfa6f8b7e76 --- /dev/null +++ b/examples/v2/apm-trace/GetPrunedTraceByID.rb @@ -0,0 +1,8 @@ +# Get a pruned trace by ID returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_pruned_trace_by_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::APMTraceAPI.new +p api_instance.get_pruned_trace_by_id("trace_id") diff --git a/examples/v2/apm-trace/GetTraceByID.rb b/examples/v2/apm-trace/GetTraceByID.rb new file mode 100644 index 000000000000..017d2943a886 --- /dev/null +++ b/examples/v2/apm-trace/GetTraceByID.rb @@ -0,0 +1,8 @@ +# Get a trace by ID returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_trace_by_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::APMTraceAPI.new +p api_instance.get_trace_by_id("trace_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 95054c25f8dd..528d27757f7f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4222,6 +4222,20 @@ "v2.ListConnections" => { "entity" => "String", }, + "v2.GetPrunedTraceByID" => { + "trace_id" => "String", + "expand_span_id" => "Integer", + "time_hint" => "Integer", + "force_source" => "String", + "include_path" => "Array", + "tag_include" => "Array", + "tag_exclude" => "Array", + "only_service_entry_spans" => "Boolean", + }, + "v2.GetTraceByID" => { + "trace_id" => "String", + "include_fields" => "Array", + }, "v2.BatchRowsQuery" => { "body" => "BatchRowsQueryRequest", }, diff --git a/features/v2/apm_trace.feature b/features/v2/apm_trace.feature new file mode 100644 index 000000000000..e5b706b19105 --- /dev/null +++ b/features/v2/apm_trace.feature @@ -0,0 +1,48 @@ +@endpoint(apm-trace) @endpoint(apm-trace-v2) +Feature: APM Trace + Retrieve full or pruned APM traces by trace ID. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "APMTrace" API + + @generated @skip @team:DataDog/apm-reliability + Scenario: Get a pruned trace by ID returns "Not Found" response + Given operation "GetPrunedTraceByID" enabled + And new "GetPrunedTraceByID" request + And request contains "trace_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/apm-reliability + Scenario: Get a pruned trace by ID returns "OK" response + Given operation "GetPrunedTraceByID" enabled + And new "GetPrunedTraceByID" request + And request contains "trace_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/apm-reliability + Scenario: Get a trace by ID returns "Not Found" response + Given operation "GetTraceByID" enabled + And new "GetTraceByID" request + And request contains "trace_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/apm-reliability + Scenario: Get a trace by ID returns "OK" response + Given operation "GetTraceByID" enabled + And new "GetTraceByID" request + And request contains "trace_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/apm-reliability + Scenario: Get a trace by ID returns "Payload Too Large" response + Given operation "GetTraceByID" enabled + And new "GetTraceByID" request + And request contains "trace_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 413 Payload Too Large diff --git a/features/v2/undo.json b/features/v2/undo.json index 0878797ffd8c..47c0c362f567 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5296,6 +5296,12 @@ "type": "safe" } }, + "GetPrunedTraceByID": { + "tag": "APM Trace", + "undo": { + "type": "safe" + } + }, "QueryScalarData": { "tag": "Metrics", "undo": { @@ -8091,6 +8097,12 @@ "type": "safe" } }, + "GetTraceByID": { + "tag": "APM Trace", + "undo": { + "type": "safe" + } + }, "GetUsageApplicationSecurityMonitoring": { "tag": "Usage Metering", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 112134511ef0..b245a9f602f5 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -552,6 +552,8 @@ def initialize "v2.query_event_filtered_users": false, "v2.query_users": false, "v2.update_connection": false, + "v2.get_pruned_trace_by_id": false, + "v2.get_trace_by_id": false, "v2.create_scorecard_outcomes_batch": false, "v2.list_entity_risk_scores": false, "v2.create_incident_service": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index abbf1654651c..79b9c3c84381 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1279,6 +1279,8 @@ def overrides "v2.apm_resource_stats_data_source" => "ApmResourceStatsDataSource", "v2.apm_resource_stats_query" => "ApmResourceStatsQuery", "v2.apm_retention_filter_type" => "ApmRetentionFilterType", + "v2.apm_span_error_flag" => "APMSpanErrorFlag", + "v2.apm_trace_span" => "APMTraceSpan", "v2.app_builder_event" => "AppBuilderEvent", "v2.app_builder_event_name" => "AppBuilderEventName", "v2.app_builder_event_type" => "AppBuilderEventType", @@ -5141,6 +5143,10 @@ def overrides "v2.project_update" => "ProjectUpdate", "v2.project_update_attributes" => "ProjectUpdateAttributes", "v2.project_update_request" => "ProjectUpdateRequest", + "v2.pruned_trace_attributes" => "PrunedTraceAttributes", + "v2.pruned_trace_data" => "PrunedTraceData", + "v2.pruned_trace_response" => "PrunedTraceResponse", + "v2.pruned_trace_type" => "PrunedTraceType", "v2.publish_app_response" => "PublishAppResponse", "v2.publish_request_type" => "PublishRequestType", "v2.put_apps_datastore_item_response_array" => "PutAppsDatastoreItemResponseArray", @@ -6286,6 +6292,8 @@ def overrides "v2.suite_json_patch_request_data_attributes" => "SuiteJsonPatchRequestDataAttributes", "v2.suite_json_patch_type" => "SuiteJsonPatchType", "v2.suite_search_response_type" => "SuiteSearchResponseType", + "v2.summarized_span" => "SummarizedSpan", + "v2.summarized_trace" => "SummarizedTrace", "v2.suppression_version_history" => "SuppressionVersionHistory", "v2.suppression_versions" => "SuppressionVersions", "v2.sync_property" => "SyncProperty", @@ -6694,6 +6702,10 @@ def overrides "v2.timeseries_response_attributes" => "TimeseriesResponseAttributes", "v2.timeseries_response_series" => "TimeseriesResponseSeries", "v2.token_type" => "TokenType", + "v2.trace_attributes" => "TraceAttributes", + "v2.trace_data" => "TraceData", + "v2.trace_response" => "TraceResponse", + "v2.trace_type" => "TraceType", "v2.trigger" => "Trigger", "v2.trigger_attributes" => "TriggerAttributes", "v2.trigger_investigation_request" => "TriggerInvestigationRequest", @@ -7037,6 +7049,7 @@ def overrides "v2.api_management_api" => "APIManagementAPI", "v2.apm_api" => "APMAPI", "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", + "v2.apm_trace_api" => "APMTraceAPI", "v2.app_builder_api" => "AppBuilderAPI", "v2.application_security_api" => "ApplicationSecurityAPI", "v2.audit_api" => "AuditAPI", diff --git a/lib/datadog_api_client/v2/api/apm_trace_api.rb b/lib/datadog_api_client/v2/api/apm_trace_api.rb new file mode 100644 index 000000000000..97065df39ebb --- /dev/null +++ b/lib/datadog_api_client/v2/api/apm_trace_api.rb @@ -0,0 +1,194 @@ +=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 APMTraceAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get a pruned trace by ID. + # + # @see #get_pruned_trace_by_id_with_http_info + def get_pruned_trace_by_id(trace_id, opts = {}) + data, _status_code, _headers = get_pruned_trace_by_id_with_http_info(trace_id, opts) + data + end + + # Get a pruned trace by ID. + # + # Retrieve a pruned, hierarchical view of an APM trace by its trace ID. + # The trace is summarized as a tree of spans rooted at the trace root and reduced in size + # to keep rendering large traces in the UI practical. + # This endpoint is rate limited to `60` requests per minute per organization. + # + # @param trace_id [String] The trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID) or a decimal string of up to 39 digits. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :expand_span_id Span ID to expand and preserve in the pruned tree even when its branch would normally be summarized. + # @option opts [Integer] :time_hint Optional Unix time hint, in seconds, used to optimize the lookup of the trace in long-term storage. + # @option opts [String] :force_source Force the trace to be loaded from a specific source. When unset, the API picks the source automatically. + # @option opts [Array] :include_path Restrict the pruned tree to spans matching the given `key:value` pairs. Values may be passed as repeated query parameters. + # @option opts [Array] :tag_include Regex patterns of tag keys whose values must be included in the pruned spans. Values may be passed as repeated query parameters. + # @option opts [Array] :tag_exclude Regex patterns of tag keys whose values must be excluded from the pruned spans. Values may be passed as repeated query parameters. + # @option opts [Boolean] :only_service_entry_spans When set to `true`, only service entry spans are included in the pruned tree. + # @return [Array<(PrunedTraceResponse, Integer, Hash)>] PrunedTraceResponse data, response status code and response headers + def get_pruned_trace_by_id_with_http_info(trace_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_pruned_trace_by_id".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_pruned_trace_by_id") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_pruned_trace_by_id")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: APMTraceAPI.get_pruned_trace_by_id ...' + end + # verify the required parameter 'trace_id' is set + if @api_client.config.client_side_validation && trace_id.nil? + fail ArgumentError, "Missing the required parameter 'trace_id' when calling APMTraceAPI.get_pruned_trace_by_id" + end + if @api_client.config.client_side_validation && !opts[:'time_hint'].nil? && opts[:'time_hint'] > 2147483647 + fail ArgumentError, 'invalid value for "opts[:"time_hint"]" when calling APMTraceAPI.get_pruned_trace_by_id, must be smaller than or equal to 2147483647.' + end + # resource path + local_var_path = '/api/v2/pruned_trace/{trace_id}'.sub('{trace_id}', CGI.escape(trace_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'expand_span_id'] = opts[:'expand_span_id'] if !opts[:'expand_span_id'].nil? + query_params[:'time_hint'] = opts[:'time_hint'] if !opts[:'time_hint'].nil? + query_params[:'force_source'] = opts[:'force_source'] if !opts[:'force_source'].nil? + query_params[:'include_path'] = @api_client.build_collection_param(opts[:'include_path'], :multi) if !opts[:'include_path'].nil? + query_params[:'tag_include'] = @api_client.build_collection_param(opts[:'tag_include'], :multi) if !opts[:'tag_include'].nil? + query_params[:'tag_exclude'] = @api_client.build_collection_param(opts[:'tag_exclude'], :multi) if !opts[:'tag_exclude'].nil? + query_params[:'only_service_entry_spans'] = opts[:'only_service_entry_spans'] if !opts[:'only_service_entry_spans'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'PrunedTraceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_pruned_trace_by_id, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: APMTraceAPI#get_pruned_trace_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a trace by ID. + # + # @see #get_trace_by_id_with_http_info + def get_trace_by_id(trace_id, opts = {}) + data, _status_code, _headers = get_trace_by_id_with_http_info(trace_id, opts) + data + end + + # Get a trace by ID. + # + # Retrieve a full APM trace by its trace ID, including every span in the trace. + # Traces are returned from live storage when available and fall back to longer-term storage. + # This endpoint is rate limited to `60` requests per minute per organization. + # + # @param trace_id [String] The trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID) or a decimal string of up to 39 digits. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include_fields List of span fields to include in the response. When omitted, every available field is returned. Values may be passed as repeated query parameters or as a single comma-separated value. + # @return [Array<(TraceResponse, Integer, Hash)>] TraceResponse data, response status code and response headers + def get_trace_by_id_with_http_info(trace_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_trace_by_id".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_trace_by_id") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_trace_by_id")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: APMTraceAPI.get_trace_by_id ...' + end + # verify the required parameter 'trace_id' is set + if @api_client.config.client_side_validation && trace_id.nil? + fail ArgumentError, "Missing the required parameter 'trace_id' when calling APMTraceAPI.get_trace_by_id" + end + # resource path + local_var_path = '/api/v2/trace/{trace_id}'.sub('{trace_id}', CGI.escape(trace_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include_fields'] = @api_client.build_collection_param(opts[:'include_fields'], :multi) if !opts[:'include_fields'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TraceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_trace_by_id, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: APMTraceAPI#get_trace_by_id\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/apm_span_error_flag.rb b/lib/datadog_api_client/v2/models/apm_span_error_flag.rb new file mode 100644 index 000000000000..f78909730b70 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_span_error_flag.rb @@ -0,0 +1,27 @@ +=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 flag for a span. `1` when the span is in error, `0` otherwise. + class APMSpanErrorFlag + include BaseEnumModel + + NO_ERROR = 0.freeze + ERROR = 1.freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_trace_span.rb b/lib/datadog_api_client/v2/models/apm_trace_span.rb new file mode 100644 index 000000000000..6d7518af7c16 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_trace_span.rb @@ -0,0 +1,428 @@ +=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 APM span returned as part of a trace. + class APMTraceSpan + include BaseGenericModel + + # The duration of the span, in nanoseconds. + attr_reader :duration + + # The end time of the span, in Unix nanoseconds. + attr_reader :end_time + + # Error flag for a span. `1` when the span is in error, `0` otherwise. + attr_reader :error + + # String-valued tags attached to the span. Tag keys starting with `_` are + # filtered out of the response. + attr_reader :meta + + # Numeric metrics attached to the span. Metric keys starting with `_` are + # filtered out of the response. + attr_reader :metrics + + # The operation name of the span. + attr_reader :name + + # The ID of the parent span, or `0` when the span is a trace root. + attr_reader :parent_id + + # The resource that the span describes. + attr_reader :resource + + # A hash of the resource field. + attr_accessor :resource_hash + + # Whether access to the span is restricted by the organization's data access policies. + attr_accessor :restricted + + # The time spent in the span itself, excluding time spent in child spans, in nanoseconds. + attr_accessor :self_time + + # The name of the service that emitted the span. + attr_reader :service + + # The span ID, as an unsigned 64-bit integer. + attr_reader :span_id + + # The start time of the span, in Unix nanoseconds. + attr_reader :start_time + + # The lower 64 bits of the trace ID, as an unsigned 64-bit integer. + attr_reader :trace_id + + # The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + attr_reader :trace_id_full + + # The type of the span (for example, `web`, `db`, or `rpc`). + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'duration' => :'duration', + :'end_time' => :'endTime', + :'error' => :'error', + :'meta' => :'meta', + :'metrics' => :'metrics', + :'name' => :'name', + :'parent_id' => :'parentID', + :'resource' => :'resource', + :'resource_hash' => :'resourceHash', + :'restricted' => :'restricted', + :'self_time' => :'self_time', + :'service' => :'service', + :'span_id' => :'spanID', + :'start_time' => :'startTime', + :'trace_id' => :'traceID', + :'trace_id_full' => :'traceIDFull', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'duration' => :'Integer', + :'end_time' => :'Integer', + :'error' => :'APMSpanErrorFlag', + :'meta' => :'Hash', + :'metrics' => :'Hash', + :'name' => :'String', + :'parent_id' => :'Integer', + :'resource' => :'String', + :'resource_hash' => :'String', + :'restricted' => :'Boolean', + :'self_time' => :'Float', + :'service' => :'String', + :'span_id' => :'Integer', + :'start_time' => :'Integer', + :'trace_id' => :'Integer', + :'trace_id_full' => :'String', + :'type' => :'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::APMTraceSpan` 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?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'metrics') + self.metrics = attributes[:'metrics'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'parent_id') + self.parent_id = attributes[:'parent_id'] + end + + if attributes.key?(:'resource') + self.resource = attributes[:'resource'] + end + + if attributes.key?(:'resource_hash') + self.resource_hash = attributes[:'resource_hash'] + end + + if attributes.key?(:'restricted') + self.restricted = attributes[:'restricted'] + end + + if attributes.key?(:'self_time') + self.self_time = attributes[:'self_time'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'span_id') + self.span_id = attributes[:'span_id'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'trace_id') + self.trace_id = attributes[:'trace_id'] + end + + if attributes.key?(:'trace_id_full') + self.trace_id_full = attributes[:'trace_id_full'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @duration.nil? + return false if @end_time.nil? + return false if @error.nil? + return false if @meta.nil? + return false if @metrics.nil? + return false if @name.nil? + return false if @parent_id.nil? + return false if @resource.nil? + return false if @service.nil? + return false if @span_id.nil? + return false if @start_time.nil? + return false if @trace_id.nil? + return false if @trace_id_full.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param duration [Object] Object to be assigned + # @!visibility private + def duration=(duration) + if duration.nil? + fail ArgumentError, 'invalid value for "duration", duration cannot be nil.' + end + @duration = duration + end + + # Custom attribute writer method with validation + # @param end_time [Object] Object to be assigned + # @!visibility private + def end_time=(end_time) + if end_time.nil? + fail ArgumentError, 'invalid value for "end_time", end_time cannot be nil.' + end + @end_time = end_time + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Custom attribute writer method with validation + # @param metrics [Object] Object to be assigned + # @!visibility private + def metrics=(metrics) + if metrics.nil? + fail ArgumentError, 'invalid value for "metrics", metrics cannot be nil.' + end + @metrics = metrics + 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 + + # Custom attribute writer method with validation + # @param parent_id [Object] Object to be assigned + # @!visibility private + def parent_id=(parent_id) + if parent_id.nil? + fail ArgumentError, 'invalid value for "parent_id", parent_id cannot be nil.' + end + @parent_id = parent_id + end + + # Custom attribute writer method with validation + # @param resource [Object] Object to be assigned + # @!visibility private + def resource=(resource) + if resource.nil? + fail ArgumentError, 'invalid value for "resource", resource cannot be nil.' + end + @resource = resource + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param span_id [Object] Object to be assigned + # @!visibility private + def span_id=(span_id) + if span_id.nil? + fail ArgumentError, 'invalid value for "span_id", span_id cannot be nil.' + end + @span_id = span_id + end + + # Custom attribute writer method with validation + # @param start_time [Object] Object to be assigned + # @!visibility private + def start_time=(start_time) + if start_time.nil? + fail ArgumentError, 'invalid value for "start_time", start_time cannot be nil.' + end + @start_time = start_time + end + + # Custom attribute writer method with validation + # @param trace_id [Object] Object to be assigned + # @!visibility private + def trace_id=(trace_id) + if trace_id.nil? + fail ArgumentError, 'invalid value for "trace_id", trace_id cannot be nil.' + end + @trace_id = trace_id + end + + # Custom attribute writer method with validation + # @param trace_id_full [Object] Object to be assigned + # @!visibility private + def trace_id_full=(trace_id_full) + if trace_id_full.nil? + fail ArgumentError, 'invalid value for "trace_id_full", trace_id_full cannot be nil.' + end + @trace_id_full = trace_id_full + 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 && + duration == o.duration && + end_time == o.end_time && + error == o.error && + meta == o.meta && + metrics == o.metrics && + name == o.name && + parent_id == o.parent_id && + resource == o.resource && + resource_hash == o.resource_hash && + restricted == o.restricted && + self_time == o.self_time && + service == o.service && + span_id == o.span_id && + start_time == o.start_time && + trace_id == o.trace_id && + trace_id_full == o.trace_id_full && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [duration, end_time, error, meta, metrics, name, parent_id, resource, resource_hash, restricted, self_time, service, span_id, start_time, trace_id, trace_id_full, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pruned_trace_attributes.rb b/lib/datadog_api_client/v2/models/pruned_trace_attributes.rb new file mode 100644 index 000000000000..78361de5f222 --- /dev/null +++ b/lib/datadog_api_client/v2/models/pruned_trace_attributes.rb @@ -0,0 +1,170 @@ +=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 attributes of a pruned trace returned by the Get pruned trace by ID endpoint. + class PrunedTraceAttributes + include BaseGenericModel + + # Indicates whether the underlying trace was truncated because its size + # exceeded the maximum that can be retrieved from storage. + attr_reader :is_truncated + + # The size, in bytes, of the original (non-pruned) trace before summarization. + attr_reader :size_bytes + + # A summarized, hierarchical view of a trace. + attr_reader :summarized_trace + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'is_truncated' => :'is_truncated', + :'size_bytes' => :'size_bytes', + :'summarized_trace' => :'summarized_trace' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'is_truncated' => :'Boolean', + :'size_bytes' => :'Integer', + :'summarized_trace' => :'SummarizedTrace' + } + 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::PrunedTraceAttributes` 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?(:'is_truncated') + self.is_truncated = attributes[:'is_truncated'] + end + + if attributes.key?(:'size_bytes') + self.size_bytes = attributes[:'size_bytes'] + end + + if attributes.key?(:'summarized_trace') + self.summarized_trace = attributes[:'summarized_trace'] + 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 @is_truncated.nil? + return false if @size_bytes.nil? + return false if @size_bytes > 2147483647 + return false if @summarized_trace.nil? + true + end + + # Custom attribute writer method with validation + # @param is_truncated [Object] Object to be assigned + # @!visibility private + def is_truncated=(is_truncated) + if is_truncated.nil? + fail ArgumentError, 'invalid value for "is_truncated", is_truncated cannot be nil.' + end + @is_truncated = is_truncated + end + + # Custom attribute writer method with validation + # @param size_bytes [Object] Object to be assigned + # @!visibility private + def size_bytes=(size_bytes) + if size_bytes.nil? + fail ArgumentError, 'invalid value for "size_bytes", size_bytes cannot be nil.' + end + if size_bytes > 2147483647 + fail ArgumentError, 'invalid value for "size_bytes", must be smaller than or equal to 2147483647.' + end + @size_bytes = size_bytes + end + + # Custom attribute writer method with validation + # @param summarized_trace [Object] Object to be assigned + # @!visibility private + def summarized_trace=(summarized_trace) + if summarized_trace.nil? + fail ArgumentError, 'invalid value for "summarized_trace", summarized_trace cannot be nil.' + end + @summarized_trace = summarized_trace + 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 && + is_truncated == o.is_truncated && + size_bytes == o.size_bytes && + summarized_trace == o.summarized_trace && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [is_truncated, size_bytes, summarized_trace, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pruned_trace_data.rb b/lib/datadog_api_client/v2/models/pruned_trace_data.rb new file mode 100644 index 000000000000..b31f8c7b28bd --- /dev/null +++ b/lib/datadog_api_client/v2/models/pruned_trace_data.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 + # A pruned trace resource document. + class PrunedTraceData + include BaseGenericModel + + # The attributes of a pruned trace returned by the Get pruned trace by ID endpoint. + attr_reader :attributes + + # The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + attr_reader :id + + # The type of the pruned trace resource. The value is always `pruned_trace`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PrunedTraceAttributes', + :'id' => :'String', + :'type' => :'PrunedTraceType' + } + 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::PrunedTraceData` 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @id.nil? + return false if @type.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 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 + + # 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pruned_trace_response.rb b/lib/datadog_api_client/v2/models/pruned_trace_response.rb new file mode 100644 index 000000000000..120086fa487c --- /dev/null +++ b/lib/datadog_api_client/v2/models/pruned_trace_response.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 + # Response containing a single pruned trace. + class PrunedTraceResponse + include BaseGenericModel + + # A pruned trace resource document. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PrunedTraceData' + } + 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::PrunedTraceResponse` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pruned_trace_type.rb b/lib/datadog_api_client/v2/models/pruned_trace_type.rb new file mode 100644 index 000000000000..22eafe4e23a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/pruned_trace_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 the pruned trace resource. The value is always `pruned_trace`. + class PrunedTraceType + include BaseEnumModel + + PRUNED_TRACE = "pruned_trace".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/summarized_span.rb b/lib/datadog_api_client/v2/models/summarized_span.rb new file mode 100644 index 000000000000..dcf1e7bc5744 --- /dev/null +++ b/lib/datadog_api_client/v2/models/summarized_span.rb @@ -0,0 +1,403 @@ +=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 node in the pruned trace tree. + class SummarizedSpan + include BaseGenericModel + + # The child spans of this node in the pruned tree. + attr_reader :children + + # The duration of the span, in seconds. + attr_reader :duration_seconds + + # The end time of the span, in RFC3339 format. + attr_reader :end_time + + # Error flag for a span. `1` when the span is in error, `0` otherwise. + attr_reader :error + + # The number of child spans that were pruned from this node when summarizing the trace. + attr_reader :hidden_child_spans_count + + # String-valued tags attached to the span. + attr_reader :meta + + # Numeric metrics attached to the span. + attr_reader :metrics + + # The operation name of the span. + attr_reader :name + + # The ID of the parent span, or `0` when the span is the trace root. + attr_reader :parent_id + + # The resource that the span describes. + attr_reader :resource + + # The name of the service that emitted the span. + attr_reader :service + + # The span ID, as an unsigned 64-bit integer. + attr_reader :span_id + + # The OpenTelemetry span kind, for example `INTERNAL`, `SERVER`, `CLIENT`, + # `PRODUCER`, or `CONSUMER`. + attr_reader :span_kind + + # The start time of the span, in RFC3339 format. + attr_reader :start_time + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'children' => :'children', + :'duration_seconds' => :'durationSeconds', + :'end_time' => :'endTime', + :'error' => :'error', + :'hidden_child_spans_count' => :'hidden_child_spans_count', + :'meta' => :'meta', + :'metrics' => :'metrics', + :'name' => :'name', + :'parent_id' => :'parentID', + :'resource' => :'resource', + :'service' => :'service', + :'span_id' => :'spanID', + :'span_kind' => :'span_kind', + :'start_time' => :'startTime' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'children' => :'Array', + :'duration_seconds' => :'Float', + :'end_time' => :'Time', + :'error' => :'APMSpanErrorFlag', + :'hidden_child_spans_count' => :'Integer', + :'meta' => :'Hash', + :'metrics' => :'Hash', + :'name' => :'String', + :'parent_id' => :'Integer', + :'resource' => :'String', + :'service' => :'String', + :'span_id' => :'Integer', + :'span_kind' => :'String', + :'start_time' => :'Time' + } + 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::SummarizedSpan` 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?(:'children') + if (value = attributes[:'children']).is_a?(Array) + self.children = value + end + end + + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'hidden_child_spans_count') + self.hidden_child_spans_count = attributes[:'hidden_child_spans_count'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'metrics') + self.metrics = attributes[:'metrics'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'parent_id') + self.parent_id = attributes[:'parent_id'] + end + + if attributes.key?(:'resource') + self.resource = attributes[:'resource'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'span_id') + self.span_id = attributes[:'span_id'] + end + + if attributes.key?(:'span_kind') + self.span_kind = attributes[:'span_kind'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + 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 @children.nil? + return false if @duration_seconds.nil? + return false if @end_time.nil? + return false if @error.nil? + return false if @hidden_child_spans_count.nil? + return false if @hidden_child_spans_count > 2147483647 + return false if @meta.nil? + return false if @metrics.nil? + return false if @name.nil? + return false if @parent_id.nil? + return false if @resource.nil? + return false if @service.nil? + return false if @span_id.nil? + return false if @span_kind.nil? + return false if @start_time.nil? + true + end + + # Custom attribute writer method with validation + # @param children [Object] Object to be assigned + # @!visibility private + def children=(children) + if children.nil? + fail ArgumentError, 'invalid value for "children", children cannot be nil.' + end + @children = children + end + + # Custom attribute writer method with validation + # @param duration_seconds [Object] Object to be assigned + # @!visibility private + def duration_seconds=(duration_seconds) + if duration_seconds.nil? + fail ArgumentError, 'invalid value for "duration_seconds", duration_seconds cannot be nil.' + end + @duration_seconds = duration_seconds + end + + # Custom attribute writer method with validation + # @param end_time [Object] Object to be assigned + # @!visibility private + def end_time=(end_time) + if end_time.nil? + fail ArgumentError, 'invalid value for "end_time", end_time cannot be nil.' + end + @end_time = end_time + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param hidden_child_spans_count [Object] Object to be assigned + # @!visibility private + def hidden_child_spans_count=(hidden_child_spans_count) + if hidden_child_spans_count.nil? + fail ArgumentError, 'invalid value for "hidden_child_spans_count", hidden_child_spans_count cannot be nil.' + end + if hidden_child_spans_count > 2147483647 + fail ArgumentError, 'invalid value for "hidden_child_spans_count", must be smaller than or equal to 2147483647.' + end + @hidden_child_spans_count = hidden_child_spans_count + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Custom attribute writer method with validation + # @param metrics [Object] Object to be assigned + # @!visibility private + def metrics=(metrics) + if metrics.nil? + fail ArgumentError, 'invalid value for "metrics", metrics cannot be nil.' + end + @metrics = metrics + 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 + + # Custom attribute writer method with validation + # @param parent_id [Object] Object to be assigned + # @!visibility private + def parent_id=(parent_id) + if parent_id.nil? + fail ArgumentError, 'invalid value for "parent_id", parent_id cannot be nil.' + end + @parent_id = parent_id + end + + # Custom attribute writer method with validation + # @param resource [Object] Object to be assigned + # @!visibility private + def resource=(resource) + if resource.nil? + fail ArgumentError, 'invalid value for "resource", resource cannot be nil.' + end + @resource = resource + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param span_id [Object] Object to be assigned + # @!visibility private + def span_id=(span_id) + if span_id.nil? + fail ArgumentError, 'invalid value for "span_id", span_id cannot be nil.' + end + @span_id = span_id + end + + # Custom attribute writer method with validation + # @param span_kind [Object] Object to be assigned + # @!visibility private + def span_kind=(span_kind) + if span_kind.nil? + fail ArgumentError, 'invalid value for "span_kind", span_kind cannot be nil.' + end + @span_kind = span_kind + end + + # Custom attribute writer method with validation + # @param start_time [Object] Object to be assigned + # @!visibility private + def start_time=(start_time) + if start_time.nil? + fail ArgumentError, 'invalid value for "start_time", start_time cannot be nil.' + end + @start_time = start_time + 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 && + children == o.children && + duration_seconds == o.duration_seconds && + end_time == o.end_time && + error == o.error && + hidden_child_spans_count == o.hidden_child_spans_count && + meta == o.meta && + metrics == o.metrics && + name == o.name && + parent_id == o.parent_id && + resource == o.resource && + service == o.service && + span_id == o.span_id && + span_kind == o.span_kind && + start_time == o.start_time && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [children, duration_seconds, end_time, error, hidden_child_spans_count, meta, metrics, name, parent_id, resource, service, span_id, span_kind, start_time, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/summarized_trace.rb b/lib/datadog_api_client/v2/models/summarized_trace.rb new file mode 100644 index 000000000000..3d59852c64a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/summarized_trace.rb @@ -0,0 +1,144 @@ +=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 summarized, hierarchical view of a trace. + class SummarizedTrace + include BaseGenericModel + + # A node in the pruned trace tree. + attr_reader :root + + # The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + attr_reader :trace_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'root' => :'root', + :'trace_id' => :'traceId' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'root' => :'SummarizedSpan', + :'trace_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::SummarizedTrace` 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?(:'root') + self.root = attributes[:'root'] + end + + if attributes.key?(:'trace_id') + self.trace_id = attributes[:'trace_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 @root.nil? + return false if @trace_id.nil? + true + end + + # Custom attribute writer method with validation + # @param root [Object] Object to be assigned + # @!visibility private + def root=(root) + if root.nil? + fail ArgumentError, 'invalid value for "root", root cannot be nil.' + end + @root = root + end + + # Custom attribute writer method with validation + # @param trace_id [Object] Object to be assigned + # @!visibility private + def trace_id=(trace_id) + if trace_id.nil? + fail ArgumentError, 'invalid value for "trace_id", trace_id cannot be nil.' + end + @trace_id = trace_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 && + root == o.root && + trace_id == o.trace_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [root, trace_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trace_attributes.rb b/lib/datadog_api_client/v2/models/trace_attributes.rb new file mode 100644 index 000000000000..70bbe9b3fb86 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trace_attributes.rb @@ -0,0 +1,146 @@ +=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 attributes of a trace returned by the Get trace by ID endpoint. + class TraceAttributes + include BaseGenericModel + + # Indicates whether the trace was truncated because its size exceeded the maximum response payload. + attr_reader :is_truncated + + # The list of spans that compose the trace. + attr_reader :spans + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'is_truncated' => :'is_truncated', + :'spans' => :'spans' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'is_truncated' => :'Boolean', + :'spans' => :'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::TraceAttributes` 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?(:'is_truncated') + self.is_truncated = attributes[:'is_truncated'] + end + + if attributes.key?(:'spans') + if (value = attributes[:'spans']).is_a?(Array) + self.spans = 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 @is_truncated.nil? + return false if @spans.nil? + true + end + + # Custom attribute writer method with validation + # @param is_truncated [Object] Object to be assigned + # @!visibility private + def is_truncated=(is_truncated) + if is_truncated.nil? + fail ArgumentError, 'invalid value for "is_truncated", is_truncated cannot be nil.' + end + @is_truncated = is_truncated + end + + # Custom attribute writer method with validation + # @param spans [Object] Object to be assigned + # @!visibility private + def spans=(spans) + if spans.nil? + fail ArgumentError, 'invalid value for "spans", spans cannot be nil.' + end + @spans = spans + 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 && + is_truncated == o.is_truncated && + spans == o.spans && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [is_truncated, spans, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trace_data.rb b/lib/datadog_api_client/v2/models/trace_data.rb new file mode 100644 index 000000000000..7013f3e9160d --- /dev/null +++ b/lib/datadog_api_client/v2/models/trace_data.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 + # A trace resource document. + class TraceData + include BaseGenericModel + + # The attributes of a trace returned by the Get trace by ID endpoint. + attr_reader :attributes + + # The full 128-bit trace ID, encoded as a 32-character hexadecimal string. + attr_reader :id + + # The type of the trace resource. The value is always `trace`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TraceAttributes', + :'id' => :'String', + :'type' => :'TraceType' + } + 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::TraceData` 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @id.nil? + return false if @type.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 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 + + # 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trace_response.rb b/lib/datadog_api_client/v2/models/trace_response.rb new file mode 100644 index 000000000000..13e832f98e92 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trace_response.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 + # Response containing a single trace. + class TraceResponse + include BaseGenericModel + + # A trace resource document. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TraceData' + } + 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::TraceResponse` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trace_type.rb b/lib/datadog_api_client/v2/models/trace_type.rb new file mode 100644 index 000000000000..800b585b712e --- /dev/null +++ b/lib/datadog_api_client/v2/models/trace_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 the trace resource. The value is always `trace`. + class TraceType + include BaseEnumModel + + TRACE = "trace".freeze + end +end