diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 9466f691bd4..51fe22bcea0 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3257,6 +3257,7 @@ components: - incident_analytics - product_analytics - on_call_events + - errors example: "logs" type: string x-enum-varnames: @@ -3273,6 +3274,7 @@ components: - INCIDENT_ANALYTICS - PRODUCT_ANALYTICS - ON_CALL_EVENTS + - ERRORS FormulaAndFunctionMetricAggregation: description: The aggregation methods available for metrics queries. enum: @@ -6213,6 +6215,38 @@ components: type: string x-enum-varnames: - DECODER_PROCESSOR + LogsExcludeAttributeProcessor: + description: |- + Use this processor to remove an attribute from a log during processing. + The processor strips the specified attribute from the log event, which is useful + when the attribute contains sensitive data or is no longer needed downstream. + properties: + attribute_to_exclude: + description: Name of the log attribute to remove from the log event. + example: foo + type: string + is_enabled: + default: false + description: Whether or not the processor is enabled. + type: boolean + name: + description: Name of the processor. + type: string + type: + $ref: "#/components/schemas/LogsExcludeAttributeProcessorType" + required: + - type + - attribute_to_exclude + type: object + LogsExcludeAttributeProcessorType: + default: exclude-attribute + description: Type of logs exclude attribute processor. + enum: + - exclude-attribute + example: exclude-attribute + type: string + x-enum-varnames: + - EXCLUDE_ATTRIBUTE LogsExclusion: description: Represents the index exclusion filter object from configuration API. properties: @@ -6820,6 +6854,7 @@ components: - $ref: "#/components/schemas/LogsArrayProcessor" - $ref: "#/components/schemas/LogsDecoderProcessor" - $ref: "#/components/schemas/LogsSchemaProcessor" + - $ref: "#/components/schemas/LogsExcludeAttributeProcessor" LogsQueryCompute: description: Define computation for a log query. properties: @@ -8067,6 +8102,36 @@ components: - data_source - query type: object + MonitorFormulaAndFunctionDataJobsQueryDefinition: + description: A formula and functions data jobs query. + properties: + job_type: + description: |- + The type of job being monitored. Valid values include: + `databricks.job`, `spark.application`, `airflow.dag`, + `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. + Custom job types are supported with the `custom.ol.` prefix. + example: "databricks.job" + type: string + jobs_query: + description: Filter expression used to select the jobs to monitor. + example: "job_name:smoke*" + type: string + name: + description: Name of the query for use in formulas. Must be `run_query`. + example: "run_query" + type: string + query_dialect: + description: |- + Query dialect for data jobs queries. Currently only `metric` is supported. + example: "metric" + type: string + required: + - name + - jobs_query + - job_type + - query_dialect + type: object MonitorFormulaAndFunctionDataQualityDataSource: description: Data source for data quality queries. enum: @@ -8238,6 +8303,10 @@ components: description: The name assigned to this aggregation, when multiple aggregations are defined for a query. example: "compute_result" type: string + source: + description: Source reference for composite query payloads. + example: "filter_query" + type: string required: - aggregation type: object @@ -8265,6 +8334,10 @@ components: type: integer sort: $ref: "#/components/schemas/MonitorFormulaAndFunctionEventQueryGroupBySort" + source: + description: Source reference for composite query payloads. + example: "filter_query" + type: string required: - facet type: object @@ -8373,6 +8446,7 @@ components: - $ref: "#/components/schemas/MonitorFormulaAndFunctionEventQueryDefinition" - $ref: "#/components/schemas/MonitorFormulaAndFunctionCostQueryDefinition" - $ref: "#/components/schemas/MonitorFormulaAndFunctionDataQualityQueryDefinition" + - $ref: "#/components/schemas/MonitorFormulaAndFunctionDataJobsQueryDefinition" - $ref: "#/components/schemas/MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition" - $ref: "#/components/schemas/MonitorFormulaAndFunctionAggregateFilteredQueryDefinition" MonitorFormulaAndFunctionReferenceTableColumn: @@ -9205,6 +9279,7 @@ components: - "cost alert" - "data-quality alert" - "network-path alert" + - "data-jobs alert" example: "query alert" type: string x-enum-varnames: @@ -9229,6 +9304,7 @@ components: - COST_ALERT - DATA_QUALITY_ALERT - NETWORK_PATH_ALERT + - DATA_JOBS_ALERT MonitorUpdateRequest: description: Object describing a monitor update request. properties: @@ -16266,6 +16342,7 @@ components: - udp - icmp - websocket + - mcp example: http type: string x-enum-varnames: @@ -16277,6 +16354,7 @@ components: - UDP - ICMP - WEBSOCKET + - MCP SyntheticsAPITestType: default: "api" description: Type of the Synthetic test, `api`. @@ -16399,6 +16477,8 @@ components: - $ref: "#/components/schemas/SyntheticsAssertionJSONSchemaTarget" - $ref: "#/components/schemas/SyntheticsAssertionXPathTarget" - $ref: "#/components/schemas/SyntheticsAssertionJavascript" + - $ref: "#/components/schemas/SyntheticsAssertionMCPServerCapabilitiesTarget" + - $ref: "#/components/schemas/SyntheticsAssertionMCPRespectsSpecification" SyntheticsAssertionBodyHashOperator: description: Assertion operator to apply. enum: @@ -16534,6 +16614,49 @@ components: type: string x-enum-varnames: - JAVASCRIPT + SyntheticsAssertionMCPRespectsSpecification: + description: An assertion that verifies the MCP server response respects the MCP specification. + properties: + type: + $ref: "#/components/schemas/SyntheticsAssertionMCPRespectsSpecificationType" + required: + - type + type: object + SyntheticsAssertionMCPRespectsSpecificationType: + description: Type of the assertion. + enum: + - mcpRespectsSpecification + example: mcpRespectsSpecification + type: string + x-enum-varnames: + - MCP_RESPECTS_SPECIFICATION + SyntheticsAssertionMCPServerCapabilitiesTarget: + description: An assertion that checks that an MCP server advertises the expected capabilities. + properties: + operator: + $ref: "#/components/schemas/SyntheticsAssertionOperator" + target: + description: List of MCP server capabilities to assert against. + example: + - completions + items: + $ref: "#/components/schemas/SyntheticsMCPServerCapability" + type: array + type: + $ref: "#/components/schemas/SyntheticsAssertionMCPServerCapabilitiesType" + required: + - type + - operator + - target + type: object + SyntheticsAssertionMCPServerCapabilitiesType: + description: Type of the assertion. + enum: + - mcpServerCapabilities + example: mcpServerCapabilities + type: string + x-enum-varnames: + - MCP_SERVER_CAPABILITIES SyntheticsAssertionOperator: description: Assertion operator to apply. enum: @@ -16636,6 +16759,8 @@ components: - connection - multiNetworkHop - jitter + - mcpToolNameLength + - mcpToolCount example: statusCode type: string x-enum-varnames: @@ -16660,6 +16785,8 @@ components: - CONNECTION - MULTI_NETWORK_HOP - JITTER + - MCP_TOOL_NAME_LENGTH + - MCP_TOOL_COUNT SyntheticsAssertionXPathOperator: description: Assertion operator to apply. enum: @@ -17968,6 +18095,31 @@ components: $ref: "#/components/schemas/SyntheticsLocation" type: array type: object + SyntheticsMCPProtocolVersion: + description: The MCP protocol version used by the step. See https://modelcontextprotocol.io/specification. + enum: + - "2025-06-18" + example: "2025-06-18" + type: string + x-enum-varnames: + - VERSION_2025_06_18 + SyntheticsMCPServerCapability: + description: A capability advertised by an MCP server. + enum: + - completions + - experimental + - logging + - prompts + - resources + - tools + type: string + x-enum-varnames: + - COMPLETIONS + - EXPERIMENTAL + - LOGGING + - PROMPTS + - RESOURCES + - TOOLS SyntheticsMobileStep: description: The steps used in a Synthetic mobile test. properties: @@ -18857,15 +19009,24 @@ components: - UPLOAD_FILES - WAIT SyntheticsTestCallType: - description: The type of gRPC call to perform. + description: |- + The type of call to perform. Used by gRPC steps (`healthcheck`, `unary`) + and MCP steps (`init`, `tool_list`, `tool_call`). Valid values depend on + the parent step's `subtype`. enum: - healthcheck - unary + - init + - tool_list + - tool_call example: unary type: string x-enum-varnames: - HEALTHCHECK - UNARY + - INIT + - TOOL_LIST + - TOOL_CALL SyntheticsTestCiOptions: description: CI/CD options for a Synthetic test. properties: @@ -19366,6 +19527,8 @@ components: isMessageBase64Encoded: description: Whether the message is base64 encoded. type: boolean + mcpProtocolVersion: + $ref: "#/components/schemas/SyntheticsMCPProtocolVersion" message: description: Message to send for UDP or WebSocket tests. type: string @@ -19410,6 +19573,14 @@ components: description: Timeout in seconds for the test. format: double type: number + toolArgs: + additionalProperties: {} + description: Arguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when `callType` is `tool_call`. + type: object + toolName: + description: The name of the MCP tool to call. Required when `callType` is `tool_call`. + example: search + type: string url: description: URL to perform the test with. example: "https://example.com" @@ -22356,6 +22527,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current date for the given org. format: int64 type: integer + csm_host_pro_hosts_agentless_scanners_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer + csm_host_pro_hosts_agentless_scanners_top99p: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer csm_host_pro_oci_host_count_top99p: description: Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current date for the given org. format: int64 @@ -22388,6 +22567,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current date for all organizations. format: int64 type: integer + cspm_hosts_agentless_scanners_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for all organizations. + format: int64 + type: integer + cspm_hosts_agentless_scanners_top99p: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for all organizations. + format: int64 + type: integer custom_ts_avg: description: Shows the average number of distinct custom metrics over all hours in the current date for all organizations. format: int64 @@ -22420,6 +22607,10 @@ components: description: Shows the average of all normalized Database Monitoring queries over all hours in the current date for all organizations. format: int64 type: integer + do_jobs_monitoring_orchestrators_job_hours_sum: + description: Shows the sum of all orchestrator job hours over all hours in the current date for all organizations. + format: int64 + type: integer eph_infra_host_agent_sum: description: Shows the sum of all ephemeral infrastructure hosts with the Datadog Agent over all hours in the current date for the given org. format: int64 @@ -23349,6 +23540,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current date for the given org. format: int64 type: integer + csm_host_pro_hosts_agentless_scanners_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer + csm_host_pro_hosts_agentless_scanners_top99p: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer csm_host_pro_oci_host_count_top99p: description: Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current date for the given org. format: int64 @@ -23381,6 +23580,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current date for the given org. format: int64 type: integer + cspm_hosts_agentless_scanners_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer + cspm_hosts_agentless_scanners_top99p: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + format: int64 + type: integer custom_historical_ts_avg: description: Shows the average number of distinct historical custom metrics over all hours in the current date for the given org. format: int64 @@ -23417,6 +23624,10 @@ components: description: Shows the average of all distinct Database Monitoring normalized queries over all hours in the current month for the given org. format: int64 type: integer + do_jobs_monitoring_orchestrators_job_hours_sum: + description: Shows the sum of all orchestrator job hours over all hours in the current date for the given org. + format: int64 + type: integer eph_infra_host_agent_sum: description: Shows the sum of all ephemeral infrastructure hosts with the Datadog Agent over all hours in the current date for the given org. format: int64 @@ -24352,6 +24563,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current month for all organizations. format: int64 type: integer + csm_host_pro_hosts_agentless_scanners_agg_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + format: int64 + type: integer + csm_host_pro_hosts_agentless_scanners_top99p_sum: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + format: int64 + type: integer csm_host_pro_oci_host_count_top99p_sum: description: Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current month for all organizations. format: int64 @@ -24384,6 +24603,14 @@ components: description: Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current month for all organizations. format: int64 type: integer + cspm_hosts_agentless_scanners_agg_sum: + description: Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + format: int64 + type: integer + cspm_hosts_agentless_scanners_top99p_sum: + description: Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + format: int64 + type: integer custom_historical_ts_sum: description: Shows the average number of distinct historical custom metrics over all hours in the current month for all organizations. format: int64 @@ -24420,6 +24647,10 @@ components: description: Shows the average of all distinct Database Monitoring Normalized Queries over all hours in the current month for all organizations. format: int64 type: integer + do_jobs_monitoring_orchestrators_job_hours_agg_sum: + description: Shows the sum of all orchestrator job hours over all hours in the current month for all organizations. + format: int64 + type: integer end_date: description: Shows the last date of usage in the current month for all organizations. format: date-time diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 73163c4c177..45e6d815770 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -249,7 +249,7 @@ components: schema: $ref: "#/components/schemas/CaseSortableField" CaseTypeIDPathParameter: - description: Case type's UUID + description: The UUID of the case type. example: "f98a5a5b-e0ff-45d4-b2f5-afe6e74de505" in: path name: case_type_id @@ -257,7 +257,7 @@ components: schema: type: string CellIDPathParameter: - description: Timeline cell's UUID + description: The UUID of the timeline cell (comment) to update. example: "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504" in: path name: cell_id @@ -312,6 +312,54 @@ components: required: false schema: type: string + CommitmentsCommitmentType: + description: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + in: query + name: commitmentType + required: false + schema: + $ref: "#/components/schemas/CommitmentsCommitmentType" + CommitmentsEnd: + description: End of the query time range in Unix milliseconds. + example: 1696118400000 + in: query + name: end + required: true + schema: + format: int64 + type: integer + CommitmentsFilterBy: + description: Optional filter expression to narrow down results. + in: query + name: filterBy + required: false + schema: + type: string + CommitmentsProduct: + description: Cloud product identifier (for example, ec2, rds, virtualmachines). + example: ec2 + in: query + name: product + required: true + schema: + type: string + CommitmentsProvider: + description: Cloud provider for commitment programs (aws or azure). + example: aws + in: query + name: provider + required: true + schema: + $ref: "#/components/schemas/CommitmentsProvider" + CommitmentsStart: + description: Start of the query time range in Unix milliseconds. + example: 1693526400000 + in: query + name: start + required: true + schema: + format: int64 + type: integer ConfluentAccountID: description: Confluent Account ID. in: path @@ -765,6 +813,14 @@ components: schema: example: "my-job" type: string + LLMObsAccountIDPathParameter: + description: The ID of the integration account. + example: "account-abc123" + in: path + name: account_id + required: true + schema: + type: string LLMObsAnnotationQueueIDPathParameter: description: The ID of the LLM Observability annotation queue. example: "00000000-0000-0000-0000-000000000001" @@ -797,6 +853,14 @@ components: required: true schema: type: string + LLMObsIntegrationPathParameter: + description: The name of the LLM integration. + example: openai + in: path + name: integration + required: true + schema: + $ref: "#/components/schemas/LLMObsIntegrationName" LLMObsProjectIDPathParameter: description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -805,6 +869,22 @@ components: required: true schema: type: string + LinkIDPathParameter: + description: "The UUID of the case link." + in: path + name: link_id + required: true + schema: + example: "804cd682-55f6-4541-ab00-b608b282ea7d" + type: string + MaintenanceWindowIDPathParameter: + description: The UUID of the maintenance window. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + in: path + name: maintenance_window_id + required: true + schema: + type: string MembershipSort: description: >- Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`. @@ -884,6 +964,24 @@ components: required: false schema: type: string + ModelLabProjectIDPathParameter: + description: The ID of the Model Lab project. + in: path + name: project_id + required: true + schema: + example: 1 + format: int64 + type: integer + ModelLabRunIDPathParameter: + description: The ID of the Model Lab run. + in: path + name: run_id + required: true + schema: + example: 42 + format: int64 + type: integer NDMPageNumber: description: Specific page number to return. Defaults to 0. in: query @@ -1314,6 +1412,75 @@ components: required: true schema: type: string + RuleBasedViewFramework: + description: Compliance framework handle to filter rules and findings by. + in: query + name: framework + required: false + schema: + default: "" + example: hipaa + type: string + RuleBasedViewIncludeRulesWithoutFindings: + description: When `true`, includes rules in the response that have no associated findings. + in: query + name: include_rules_without_findings + required: false + schema: + default: false + example: false + type: boolean + RuleBasedViewIsCustom: + description: Set to `true` when the requested `framework` is a custom framework. + in: query + name: is_custom + required: false + schema: + example: false + type: boolean + RuleBasedViewQuery: + description: Additional event-platform filters applied to the underlying findings query. For example, `scored:true project_id:datadog-prod-us5`. + in: query + name: query + required: false + schema: + default: "" + example: scored:true + type: string + RuleBasedViewQueryFindingsWithoutFrameworkVersion: + description: When `true`, returns findings without a `framework_version` tag. Used for findings from custom frameworks or those created before framework versioning was introduced. + in: query + name: query_findings_without_framework_version + required: false + schema: + default: false + example: false + type: boolean + RuleBasedViewTo: + description: Timestamp of the query end, in milliseconds since the Unix epoch. + in: query + name: to + required: true + schema: + example: 1739982278000 + format: int64 + type: integer + RuleBasedViewVersion: + description: Version of the compliance framework to filter rules and findings by. + in: query + name: version + required: false + schema: + example: "1" + type: string + RuleIDPathParameter: + description: The UUID of the automation rule. + example: "e6773723-fe58-49ff-9975-dff00f14e28d" + in: path + name: rule_id + required: true + schema: + type: string RuleId: description: The ID of the rule. in: path @@ -1342,6 +1509,13 @@ components: required: true schema: type: string + SampleLogGenerationContentPackID: + description: The identifier of the Cloud SIEM content pack to operate on (for example, `aws-cloudtrail`). + in: path + name: content_pack_id + required: true + schema: + type: string SchemaVersion: description: The schema version desired in the response. in: query @@ -1381,6 +1555,13 @@ components: required: true schema: type: string + SecurityMonitoringIntegrationConfigID: + description: The ID of the entity context sync configuration. + in: path + name: integration_config_id + required: true + schema: + type: string SecurityMonitoringRuleID: description: The ID of the rule. in: path @@ -1492,6 +1673,22 @@ components: schema: example: "00000000-0000-9999-0000-000000000000" type: string + UserUUIDPathParameter: + description: The UUID of the user to add or remove as a watcher. + example: "8146583c-0b5f-11ec-abf8-da7ad0900001" + in: path + name: user_uuid + required: true + schema: + type: string + ViewIDPathParameter: + description: The UUID of the case view. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + in: path + name: view_id + required: true + schema: + type: string WorkflowId: description: The ID of the workflow. in: path @@ -4548,6 +4745,15 @@ components: - OPENURL - DOWNLOADFILE - SETSTATEVARIABLEVALUE + AppBuilderListTagsResponse: + description: The response for listing tags associated with apps. + properties: + data: + description: An array of tags. + items: + $ref: "#/components/schemas/TagData" + type: array + type: object AppDefinitionType: default: appDefinitions description: The app definition type. @@ -4566,6 +4772,15 @@ components: type: string x-enum-varnames: - DEPLOYMENT + AppFavoriteType: + default: favorites + description: The favorite resource type. + enum: + - favorites + example: favorites + type: string + x-enum-varnames: + - FAVORITES AppKeyRegistrationData: description: Data related to the app key registration. properties: @@ -4626,6 +4841,25 @@ components: format: int64 type: integer type: object + AppProtectionLevel: + description: The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + enum: + - direct_publish + - approval_required + example: direct_publish + type: string + x-enum-varnames: + - DIRECT_PUBLISH + - APPROVAL_REQUIRED + AppProtectionLevelType: + default: protectionLevel + description: The protection-level resource type. + enum: + - protectionLevel + example: protectionLevel + type: string + x-enum-varnames: + - PROTECTIONLEVEL AppRelationship: description: The app's publication relationship and custom connections. properties: @@ -4637,6 +4871,24 @@ components: deployment: $ref: "#/components/schemas/DeploymentRelationship" type: object + AppSelfServiceType: + default: selfService + description: The self-service resource type. + enum: + - selfService + example: selfService + type: string + x-enum-varnames: + - SELFSERVICE + AppTagsType: + default: tags + description: The tags resource type. + enum: + - tags + example: tags + type: string + x-enum-varnames: + - TAGS AppTriggerWrapper: description: "Schema for an App-based trigger." properties: @@ -4648,6 +4900,80 @@ components: required: - appTrigger type: object + AppVersion: + description: A version of an app. + properties: + attributes: + $ref: "#/components/schemas/AppVersionAttributes" + id: + description: The ID of the app version. + example: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + format: uuid + type: string + type: + $ref: "#/components/schemas/AppVersionType" + type: object + AppVersionAttributes: + description: Attributes describing an app version. + properties: + app_id: + description: The ID of the app this version belongs to. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + created_at: + description: Timestamp of when the version was created. + format: date-time + type: string + has_ever_been_published: + description: Whether this version has ever been published. + example: true + type: boolean + name: + description: The optional human-readable name of the version. + example: v1.2.0 - bug fix release + type: string + updated_at: + description: Timestamp of when the version was last updated. + format: date-time + type: string + user_id: + description: The ID of the user who created the version. + format: int64 + type: integer + user_name: + description: The name (or email) of the user who created the version. + example: jane.doe@example.com + type: string + user_uuid: + description: The UUID of the user who created the version. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + version: + description: The version number of the app, starting at 1. + example: 3 + format: int64 + type: integer + type: object + AppVersionNameType: + default: versionNames + description: The version-name resource type. + enum: + - versionNames + example: versionNames + type: string + x-enum-varnames: + - VERSIONNAMES + AppVersionType: + default: appVersions + description: The app-version resource type. + enum: + - appVersions + example: appVersions + type: string + x-enum-varnames: + - APPVERSIONS ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -7379,6 +7705,219 @@ components: description: Whether to auto-transition cases when self-assigned. type: boolean type: object + AutomationRule: + description: An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleAttributes" + id: + description: Automation rule identifier. + example: "e6773723-fe58-49ff-9975-dff00f14e28d" + type: string + relationships: + $ref: "#/components/schemas/AutomationRuleRelationships" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - id + - type + - attributes + type: object + AutomationRuleAction: + description: Defines what happens when the rule triggers. Combines an action type with action-specific configuration data. + properties: + data: + $ref: "#/components/schemas/AutomationRuleActionData" + type: + $ref: "#/components/schemas/AutomationRuleActionType" + required: + - type + - data + type: object + AutomationRuleActionData: + description: Configuration for the action to execute, dependent on the action type. + properties: + agent_type: + description: The type of AI agent to assign. Required when the action type is `assign_agent`. + type: string + assigned_agent_id: + description: The identifier of the AI agent to assign to the case. Required when the action type is `assign_agent`. + type: string + handle: + description: The handle of the Datadog workflow to execute. Required when the action type is `execute_workflow`. + example: "workflow-handle-123" + type: string + type: object + AutomationRuleActionType: + description: The type of automated action to perform when the rule triggers. `execute_workflow` runs a Datadog workflow; `assign_agent` assigns an AI agent to the case. + enum: + - execute_workflow + - assign_agent + example: execute_workflow + type: string + x-enum-varnames: + - EXECUTE_WORKFLOW + - ASSIGN_AGENT + AutomationRuleAttributes: + description: Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. + properties: + action: + $ref: "#/components/schemas/AutomationRuleAction" + created_at: + description: Timestamp when the automation rule was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + readOnly: true + type: string + modified_at: + description: Timestamp when the automation rule was last modified. + format: date-time + readOnly: true + type: string + name: + description: A human-readable name for the automation rule, used to identify the rule in the UI and API responses. + example: "Auto-assign workflow" + type: string + state: + $ref: "#/components/schemas/CaseAutomationRuleState" + trigger: + $ref: "#/components/schemas/AutomationRuleTrigger" + required: + - name + - trigger + - action + - state + - created_at + type: object + AutomationRuleCreate: + description: Data object for creating an automation rule. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleCreateAttributes" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - type + - attributes + type: object + AutomationRuleCreateAttributes: + description: Attributes required to create an automation rule. + properties: + action: + $ref: "#/components/schemas/AutomationRuleAction" + name: + description: Name of the automation rule. + example: "Auto-assign workflow" + type: string + state: + $ref: "#/components/schemas/CaseAutomationRuleState" + trigger: + $ref: "#/components/schemas/AutomationRuleTrigger" + required: + - name + - trigger + - action + type: object + AutomationRuleCreateRequest: + description: Request payload for creating an automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRuleCreate" + required: + - data + type: object + AutomationRuleRelationships: + description: Related resources for the automation rule, including the users who created and last modified it. + properties: + created_by: + $ref: "#/components/schemas/NullableUserRelationship" + modified_by: + $ref: "#/components/schemas/NullableUserRelationship" + type: object + AutomationRuleResponse: + description: Response containing a single automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRule" + required: + - data + type: object + AutomationRuleTrigger: + description: Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). + properties: + data: + $ref: "#/components/schemas/AutomationRuleTriggerData" + type: + $ref: "#/components/schemas/AutomationRuleTriggerType" + required: + - type + type: object + AutomationRuleTriggerData: + description: Additional configuration for the trigger, dependent on the trigger type. For `status_transitioned` triggers, specify `from_status_name` and `to_status_name`. For `attribute_value_changed` triggers, specify `field` and `change_type`. + properties: + approval_type: + description: The approval outcome to match. Used with `case_review_approved` triggers. + type: string + change_type: + description: "The kind of attribute change to match. Allowed values: `VALUE_ADDED`, `VALUE_DELETED`, `ANY_CHANGES`. Used with `attribute_value_changed` triggers." + type: string + field: + description: The case attribute field name to monitor for changes. Used with `attribute_value_changed` triggers. + type: string + from_status_name: + description: The originating status name. Used with `status_transitioned` triggers to match transitions from this status. + type: string + to_status_name: + description: The destination status name. Used with `status_transitioned` triggers to match transitions to this status. + type: string + type: object + AutomationRuleTriggerType: + description: The case event that activates the automation rule. + enum: + - case_created + - status_transitioned + - attribute_value_changed + - event_correlation_signal_correlated + - case_review_approved + - comment_added + example: case_created + type: string + x-enum-varnames: + - CASE_CREATED + - STATUS_TRANSITIONED + - ATTRIBUTE_VALUE_CHANGED + - EVENT_CORRELATION_SIGNAL_CORRELATED + - CASE_REVIEW_APPROVED + - COMMENT_ADDED + AutomationRuleUpdate: + description: Data object for updating an automation rule. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleCreateAttributes" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - type + type: object + AutomationRuleUpdateRequest: + description: Request payload for updating an automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRuleUpdate" + required: + - data + type: object + AutomationRulesResponse: + description: Response containing a list of automation rules for a project. + properties: + data: + description: List of automation rules. + items: + $ref: "#/components/schemas/AutomationRule" + type: array + required: + - data + type: object AwsAccountId: description: The ID of the AWS account. example: "123456789012" @@ -8662,6 +9201,161 @@ components: data: $ref: "#/components/schemas/BillingDimensionsMappingBody" type: object + BlueprintAttributes: + description: The attributes of a blueprint resource. + properties: + created_at: + description: The timestamp when the blueprint was created. + example: "" + format: date-time + type: string + definition: + $ref: "#/components/schemas/AppDefinitionType" + description: + description: A description of what the blueprint does. + example: "" + type: string + embedded_datastore_blueprints: + additionalProperties: {} + description: Embedded datastore blueprints. + type: object + embedded_native_actions: + description: Embedded native actions. + items: + $ref: "#/components/schemas/BlueprintNativeAction" + type: array + embedded_workflow_blueprints: + additionalProperties: {} + description: Embedded workflow blueprints. + type: object + integration_id: + description: The integration ID associated with the blueprint. + type: string + mocked_outputs: + additionalProperties: {} + description: Mocked outputs for testing the blueprint. + type: object + name: + description: The human-readable name of the blueprint. + example: AWS Service Manager + type: string + slug: + description: The unique slug identifier of the blueprint. + example: aws-service-manager + type: string + tags: + description: Tags associated with the blueprint. + items: + type: string + type: array + tile_background: + description: The background style of the blueprint tile. + type: string + tile_icon_action_fqn: + description: The fully qualified name of the action used as the tile icon. + type: string + updated_at: + description: The timestamp when the blueprint was last updated. + example: "" + format: date-time + type: string + required: + - slug + - name + - description + - definition + - created_at + - updated_at + type: object + BlueprintData: + description: A blueprint resource. + properties: + attributes: + $ref: "#/components/schemas/BlueprintAttributes" + id: + description: The ID of the blueprint. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + type: + $ref: "#/components/schemas/BlueprintDataType" + required: + - id + - type + - attributes + type: object + BlueprintDataType: + description: The resource type for a blueprint. + enum: + - blueprint + example: blueprint + type: string + x-enum-varnames: + - BLUEPRINT + BlueprintMetadataAttributes: + description: The attributes of a blueprint metadata resource. + properties: + created_at: + description: The timestamp when the blueprint was created. + example: "" + format: date-time + type: string + description: + description: A description of what the blueprint does. + example: "" + type: string + name: + description: The human-readable name of the blueprint. + example: AWS Service Manager + type: string + slug: + description: The unique slug identifier of the blueprint. + example: aws-service-manager + type: string + tags: + description: Tags associated with the blueprint. + items: + type: string + type: array + tile_background: + description: The background style of the blueprint tile. + type: string + tile_icon_action_fqn: + description: The fully qualified name of the action used as the tile icon. + type: string + updated_at: + description: The timestamp when the blueprint was last updated. + example: "" + format: date-time + type: string + required: + - slug + - name + - description + - created_at + - updated_at + type: object + BlueprintMetadataData: + description: A blueprint metadata resource. + properties: + attributes: + $ref: "#/components/schemas/BlueprintMetadataAttributes" + id: + description: The ID of the blueprint. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + type: + $ref: "#/components/schemas/BlueprintDataType" + required: + - id + - type + - attributes + type: object + BlueprintNativeAction: + additionalProperties: {} + description: An embedded native action in a blueprint. + type: object BranchCoverageSummaryRequest: description: Request object for getting code coverage summary for a branch. properties: @@ -10643,6 +11337,128 @@ components: - IN_PROGRESS - COMPLETED - FAILED + CaseAggregateGroup: + description: A single group within the aggregation results, containing the group key and its associated count values. + properties: + group: + description: "The value of the field being grouped on (for example, `OPEN` when grouping by status)." + example: "OPEN" + type: string + value: + description: The count of cases in this group. + example: + - 42.0 + items: + format: double + type: number + type: array + required: + - group + - value + type: object + CaseAggregateGroupBy: + description: Configuration for grouping aggregated results by one or more case fields. + properties: + groups: + description: Fields to group by. + example: + - "status" + items: + type: string + type: array + limit: + description: Maximum number of groups to return. + example: 14 + format: int32 + maximum: 1000 + type: integer + required: + - groups + - limit + type: object + CaseAggregateRequest: + description: Request payload for aggregating case counts with grouping. Use this to get faceted breakdowns of cases (for example, count of cases grouped by priority and status). + properties: + data: + $ref: "#/components/schemas/CaseAggregateRequestData" + required: + - data + type: object + CaseAggregateRequestAttributes: + description: Attributes for the aggregation request, including the search query and grouping configuration. + properties: + group_by: + $ref: "#/components/schemas/CaseAggregateGroupBy" + query_filter: + description: "A search query to filter which cases are included in the aggregation. Uses the same syntax as the Case Management search bar." + example: "service:case-api" + type: string + required: + - query_filter + - group_by + type: object + CaseAggregateRequestData: + description: Data object wrapping the aggregation query type and attributes. + properties: + attributes: + $ref: "#/components/schemas/CaseAggregateRequestAttributes" + type: + $ref: "#/components/schemas/CaseAggregateResourceType" + required: + - attributes + - type + type: object + CaseAggregateResourceType: + description: JSON:API resource type for case aggregation requests. + enum: + - aggregate + example: aggregate + type: string + x-enum-varnames: + - AGGREGATE + CaseAggregateResponse: + description: Response containing aggregated case counts grouped by the requested fields. + properties: + data: + $ref: "#/components/schemas/CaseAggregateResponseData" + required: + - data + type: object + CaseAggregateResponseAttributes: + description: Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns. + properties: + groups: + description: Aggregated groups. + items: + $ref: "#/components/schemas/CaseAggregateGroup" + type: array + total: + description: Total count of aggregated cases. + example: 100.0 + format: double + type: number + required: + - total + - groups + type: object + CaseAggregateResponseData: + description: Data object containing the aggregation results, including total count and per-group breakdowns. + properties: + attributes: + $ref: "#/components/schemas/CaseAggregateResponseAttributes" + id: + description: Aggregate response identifier. + example: "agg-result-001" + type: string + type: + description: Aggregate resource type. + example: "aggregate" + type: string + required: + - type + - id + - attributes + type: object CaseAssign: description: Case assign properties: @@ -10735,6 +11551,102 @@ components: example: "3b010bde-09ce-4449-b745-71dd5f861963" type: string type: object + CaseAutomationRuleResourceType: + default: rule + description: JSON:API resource type for case automation rules. + enum: + - rule + example: rule + type: string + x-enum-varnames: + - RULE + CaseAutomationRuleState: + description: Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. + enum: + - ENABLED + - DISABLED + example: ENABLED + type: string + x-enum-varnames: + - ENABLED + - DISABLED + CaseBulkActionType: + description: "The type of action to apply in a bulk update. Allowed values are `priority`, `status`, `assign`, `unassign`, `archive`, `unarchive`, `jira`, `servicenow`, `linear`, `update_project`." + enum: + - priority + - status + - assign + - unassign + - archive + - unarchive + - jira + - servicenow + - linear + - update_project + example: priority + type: string + x-enum-varnames: + - PRIORITY + - STATUS + - ASSIGN + - UNASSIGN + - ARCHIVE + - UNARCHIVE + - JIRA + - SERVICENOW + - LINEAR + - UPDATE_PROJECT + CaseBulkResourceType: + description: JSON:API resource type for bulk case operations. + enum: + - bulk + example: bulk + type: string + x-enum-varnames: + - BULK + CaseBulkUpdateRequest: + description: Request payload for applying a single action (such as changing priority, status, or assignment) to multiple cases at once. + properties: + data: + $ref: "#/components/schemas/CaseBulkUpdateRequestData" + required: + - data + type: object + CaseBulkUpdateRequestAttributes: + description: Attributes for the bulk update, specifying which cases to update and the action to apply. + properties: + case_ids: + description: An array of case identifiers to apply the bulk action to. + example: + - "case-id-1" + - "case-id-2" + items: + type: string + type: array + payload: + additionalProperties: + type: string + description: A key-value map of action-specific parameters. The required keys depend on the action type (for example, `priority` for the priority action, `assignee_id` for assign). + example: + priority: "P1" + type: object + type: + $ref: "#/components/schemas/CaseBulkActionType" + required: + - case_ids + - type + type: object + CaseBulkUpdateRequestData: + description: Data object wrapping the bulk update type and attributes. + properties: + attributes: + $ref: "#/components/schemas/CaseBulkUpdateRequestAttributes" + type: + $ref: "#/components/schemas/CaseBulkResourceType" + required: + - attributes + - type + type: object CaseComment: description: Case comment properties: @@ -10764,6 +11676,75 @@ components: required: - data type: object + CaseCountGroup: + description: A facet group containing counts broken down by the distinct values of a case field (for example, status or priority). + properties: + group: + description: "The name of the field being grouped on (for example, `status` or `priority`)." + example: "status" + type: string + group_values: + description: Values within this group. + items: + $ref: "#/components/schemas/CaseCountGroupValue" + type: array + required: + - group + - group_values + type: object + CaseCountGroupValue: + description: A single value within a count group, representing the number of cases with that specific field value. + properties: + count: + description: Count of cases for this value. + example: 42 + format: int64 + type: integer + value: + description: The group value. + example: "OPEN" + type: string + required: + - value + - count + type: object + CaseCountResponse: + description: Response containing the total number of cases matching a query, optionally grouped by specified fields. + properties: + data: + $ref: "#/components/schemas/CaseCountResponseData" + required: + - data + type: object + CaseCountResponseAttributes: + description: Attributes for the count response, including the total count and optional facet breakdowns. + properties: + groups: + description: List of facet groups, one per field specified in `group_bys`. + items: + $ref: "#/components/schemas/CaseCountGroup" + type: array + required: + - groups + type: object + CaseCountResponseData: + description: Data object containing the count results, including per-field group breakdowns. + properties: + attributes: + $ref: "#/components/schemas/CaseCountResponseAttributes" + id: + description: Count response identifier. + example: "count-result-001" + type: string + type: + description: Count resource type. + example: "count" + type: string + required: + - type + - id + - attributes + type: object CaseCreate: description: Case creation data properties: @@ -10847,6 +11828,86 @@ components: required: - data type: object + CaseInsight: + description: A reference to an external Datadog resource that provides investigative context for a case, such as a security signal, monitor alert, error tracking issue, or incident. + properties: + ref: + description: "The URL path or deep link to the insight resource within Datadog (for example, `/monitors/12345?q=total`)." + example: "/monitors/12345?q=total" + type: string + resource_id: + description: The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID). + example: "12345" + type: string + type: + $ref: "#/components/schemas/CaseInsightType" + required: + - type + - ref + - resource_id + type: object + CaseInsightType: + description: The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). + enum: + - SECURITY_SIGNAL + - MONITOR + - EVENT_CORRELATION + - ERROR_TRACKING + - CLOUD_COST_RECOMMENDATION + - INCIDENT + - SENSITIVE_DATA_SCANNER_ISSUE + - EVENT + - WATCHDOG_STORY + - WIDGET + - SECURITY_FINDING + - INSIGHT_SCORECARD_CAMPAIGN + - RESOURCE_POLICY + - APM_RECOMMENDATION + - SCM_URL + - PROFILING_DOWNSIZING_EXPERIMENT + example: SECURITY_SIGNAL + type: string + x-enum-varnames: + - SECURITY_SIGNAL + - MONITOR + - EVENT_CORRELATION + - ERROR_TRACKING + - CLOUD_COST_RECOMMENDATION + - INCIDENT + - SENSITIVE_DATA_SCANNER_ISSUE + - EVENT + - WATCHDOG_STORY + - WIDGET + - SECURITY_FINDING + - INSIGHT_SCORECARD_CAMPAIGN + - RESOURCE_POLICY + - APM_RECOMMENDATION + - SCM_URL + - PROFILING_DOWNSIZING_EXPERIMENT + CaseInsightsAttributes: + description: Attributes for adding or removing insights from a case. + properties: + insights: + description: Array of insights to add to or remove from a case. + items: + $ref: "#/components/schemas/CaseInsight" + maxItems: 100 + minItems: 1 + type: array + required: + - insights + type: object + CaseInsightsData: + description: Data object containing the insights to add or remove. + properties: + attributes: + $ref: "#/components/schemas/CaseInsightsAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - type + - attributes + type: object CaseInsightsItems: description: An insight of the case. properties: @@ -10863,6 +11924,106 @@ components: example: "SECURITY_FINDING" type: string type: object + CaseInsightsRequest: + description: Request payload for adding or removing case insights. + properties: + data: + $ref: "#/components/schemas/CaseInsightsData" + required: + - data + type: object + CaseLink: + description: "A directional link representing a relationship between two entities. At least one entity must be a case." + properties: + attributes: + $ref: "#/components/schemas/CaseLinkAttributes" + id: + description: "The case link identifier." + example: "804cd682-55f6-4541-ab00-b608b282ea7d" + type: string + type: + $ref: "#/components/schemas/CaseLinkResourceType" + required: + - id + - type + - attributes + type: object + CaseLinkAttributes: + description: "Attributes describing a directional relationship between two entities (cases, incidents, or pages)." + properties: + child_entity_id: + description: "The UUID of the child (target) entity in the relationship." + example: "4417921d-0866-4a38-822c-6f2a0f65f77d" + type: string + child_entity_type: + description: "The type of the child entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`." + example: "CASE" + type: string + parent_entity_id: + description: "The UUID of the parent (source) entity in the relationship." + example: "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f" + type: string + parent_entity_type: + description: "The type of the parent entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`." + example: "CASE" + type: string + relationship: + description: "The type of directional relationship. Allowed values: `RELATES_TO` (bidirectional association), `CAUSES` (parent causes child), `BLOCKS` (parent blocks child), `DUPLICATES` (parent duplicates child), `PARENT_OF` (hierarchical), `SUCCESSOR_OF` (sequence), `ESCALATES_TO` (priority escalation)." + example: "BLOCKS" + type: string + required: + - relationship + - parent_entity_id + - parent_entity_type + - child_entity_id + - child_entity_type + type: object + CaseLinkCreate: + description: "Data object for creating a case link." + properties: + attributes: + $ref: "#/components/schemas/CaseLinkAttributes" + type: + $ref: "#/components/schemas/CaseLinkResourceType" + required: + - type + - attributes + type: object + CaseLinkCreateRequest: + description: "Request payload for creating a link between two entities." + properties: + data: + $ref: "#/components/schemas/CaseLinkCreate" + required: + - data + type: object + CaseLinkResourceType: + description: "JSON:API resource type for case links." + enum: + - link + example: link + type: string + x-enum-varnames: + - LINK + CaseLinkResponse: + description: "Response containing a single case link." + properties: + data: + $ref: "#/components/schemas/CaseLink" + required: + - data + type: object + CaseLinksResponse: + description: "Response containing a list of case links." + properties: + data: + description: "A list of case links." + items: + $ref: "#/components/schemas/CaseLink" + type: array + required: + - data + type: object CaseManagementProject: description: Case management project. properties: @@ -11105,7 +12266,7 @@ components: description: An attribute value. type: string type: array - description: The definition of `CaseObjectAttributes` object. + description: Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags. type: object CasePriority: default: NOT_DEFINED @@ -11140,7 +12301,7 @@ components: type: object CaseResourceType: default: case - description: Case resource type + description: JSON:API resource type for cases. enum: - case example: case @@ -11220,7 +12381,7 @@ components: x-enum-varnames: - STANDARD CaseTypeCreate: - description: Case type + description: Data object for creating a case type. properties: attributes: $ref: "#/components/schemas/CaseTypeResourceAttributes" @@ -11231,7 +12392,7 @@ components: - type type: object CaseTypeCreateRequest: - description: Case type create request + description: Request payload for creating a case type. properties: data: $ref: "#/components/schemas/CaseTypeCreate" @@ -11239,7 +12400,7 @@ components: - data type: object CaseTypeResource: - description: The definition of `CaseType` object. + description: A case type that defines a classification category for cases. Each case type can have its own custom attributes, statuses, and automation rules. properties: attributes: $ref: "#/components/schemas/CaseTypeResourceAttributes" @@ -11251,24 +12412,24 @@ components: $ref: "#/components/schemas/CaseTypeResourceType" type: object CaseTypeResourceAttributes: - description: Case Type resource attributes + description: "Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request)." properties: deleted_at: - description: Timestamp of when the case type was deleted + description: Timestamp when the case type was marked as deleted. A null value indicates the case type is active. format: date-time nullable: true readOnly: true type: string description: - description: Case type description. + description: A detailed description explaining when this case type should be used. example: "Investigations done in case management" type: string emoji: - description: Case type emoji. + description: An emoji icon representing the case type in the UI. example: "🕵🏻‍♂️" type: string name: - description: Case type name. + description: The display name of the case type, shown in the Case Management UI when creating or viewing cases. example: "Investigation" type: string required: @@ -11276,7 +12437,7 @@ components: type: object CaseTypeResourceType: default: case_type - description: Case type resource type + description: JSON:API resource type for case types. enum: - case_type example: case_type @@ -11284,13 +12445,31 @@ components: x-enum-varnames: - CASE_TYPE CaseTypeResponse: - description: Case type response + description: Response containing a single case type. properties: data: $ref: "#/components/schemas/CaseTypeResource" type: object + CaseTypeUpdate: + description: Data object for updating a case type. + properties: + attributes: + $ref: "#/components/schemas/CaseTypeResourceAttributes" + type: + $ref: "#/components/schemas/CaseTypeResourceType" + required: + - type + type: object + CaseTypeUpdateRequest: + description: Request payload for updating a case type. + properties: + data: + $ref: "#/components/schemas/CaseTypeUpdate" + required: + - data + type: object CaseTypesResponse: - description: Case types response. + description: Response containing a list of case types. properties: data: description: List of case types @@ -11325,6 +12504,35 @@ components: required: - data type: object + CaseUpdateComment: + description: Data object for updating a case comment. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateCommentAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - type + - attributes + type: object + CaseUpdateCommentAttributes: + description: Attributes for updating a comment. + properties: + comment: + description: The updated comment message. + example: "Updated comment text" + type: string + required: + - comment + type: object + CaseUpdateCommentRequest: + description: Request payload for updating a comment on a case timeline. + properties: + data: + $ref: "#/components/schemas/CaseUpdateComment" + required: + - data + type: object CaseUpdateCustomAttribute: description: Case update custom attribute properties: @@ -11373,6 +12581,35 @@ components: required: - data type: object + CaseUpdateDueDate: + description: Data object for updating a case's due date. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateDueDateAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - attributes + - type + type: object + CaseUpdateDueDateAttributes: + description: Attributes for setting or clearing a case's due date. + properties: + due_date: + description: "The target resolution date for the case, in `YYYY-MM-DD` format. Set to `null` to clear the due date." + example: "2026-12-31" + type: string + required: + - due_date + type: object + CaseUpdateDueDateRequest: + description: Request payload for updating a case's due date. + properties: + data: + $ref: "#/components/schemas/CaseUpdateDueDate" + required: + - data + type: object CaseUpdatePriority: description: Case priority status properties: @@ -11400,6 +12637,35 @@ components: required: - data type: object + CaseUpdateResolvedReason: + description: Data object for updating a case's resolved reason. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateResolvedReasonAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - attributes + - type + type: object + CaseUpdateResolvedReasonAttributes: + description: Attributes for setting the resolution reason on a security case. + properties: + security_resolved_reason: + description: "The reason the security case was resolved (for example, `FALSE_POSITIVE`, `TRUE_POSITIVE`, `BENIGN_POSITIVE`)." + example: "FALSE_POSITIVE" + type: string + required: + - security_resolved_reason + type: object + CaseUpdateResolvedReasonRequest: + description: Request payload for updating the resolution reason on a closed security case. + properties: + data: + $ref: "#/components/schemas/CaseUpdateResolvedReason" + required: + - data + type: object CaseUpdateStatus: description: Case update status properties: @@ -11457,6 +12723,217 @@ components: required: - data type: object + CaseView: + description: A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets. + properties: + attributes: + $ref: "#/components/schemas/CaseViewAttributes" + id: + description: The view's identifier. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: string + relationships: + $ref: "#/components/schemas/CaseViewRelationships" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - id + - type + - attributes + type: object + CaseViewAttributes: + description: Attributes of a case view, including the filter query and optional notification rule. + properties: + created_at: + description: Timestamp when the view was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + readOnly: true + type: string + modified_at: + description: Timestamp when the view was last modified. + format: date-time + readOnly: true + type: string + name: + description: A human-readable name for the view, displayed in the Case Management UI. + example: Open bugs + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + query: + description: "The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, `status:open priority:P1`)." + example: "status:open type:bug" + type: string + required: + - name + - query + - created_at + type: object + CaseViewCreate: + description: Data object for creating a case view. + properties: + attributes: + $ref: "#/components/schemas/CaseViewCreateAttributes" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - type + - attributes + type: object + CaseViewCreateAttributes: + description: Attributes required to create a case view. + properties: + name: + description: The name of the view. + example: Open bugs + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + project_id: + description: The UUID of the project this view belongs to. Views are scoped to a single project. + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: string + query: + description: The query used to filter cases in this view. + example: "status:open type:bug" + type: string + required: + - name + - query + - project_id + type: object + CaseViewCreateRequest: + description: Request payload for creating a case view. + properties: + data: + $ref: "#/components/schemas/CaseViewCreate" + required: + - data + type: object + CaseViewRelationships: + description: Related resources for the case view, including the creator, last modifier, and associated project. + properties: + created_by: + $ref: "#/components/schemas/NullableUserRelationship" + modified_by: + $ref: "#/components/schemas/NullableUserRelationship" + project: + $ref: "#/components/schemas/ProjectRelationship" + type: object + CaseViewResourceType: + default: view + description: "JSON:API resource type for case views." + enum: + - view + example: view + type: string + x-enum-varnames: + - VIEW + CaseViewResponse: + description: Response containing a single case view. + properties: + data: + $ref: "#/components/schemas/CaseView" + required: + - data + type: object + CaseViewUpdate: + description: Data object for updating a case view. + properties: + attributes: + $ref: "#/components/schemas/CaseViewUpdateAttributes" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - type + type: object + CaseViewUpdateAttributes: + description: Attributes that can be updated on a case view. All fields are optional; only provided fields are changed. + properties: + name: + description: The name of the view. + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + query: + description: The query used to filter cases in this view. + type: string + type: object + CaseViewUpdateRequest: + description: Request payload for updating a case view. + properties: + data: + $ref: "#/components/schemas/CaseViewUpdate" + required: + - data + type: object + CaseViewsResponse: + description: Response containing a list of case views. + properties: + data: + description: A list of case views. + items: + $ref: "#/components/schemas/CaseView" + type: array + required: + - data + type: object + CaseWatcher: + description: Represents a user who is subscribed to notifications for a case. Watchers receive updates when the case's status, priority, assignee, or comments change. + properties: + id: + description: The primary identifier of the case watcher. + example: "8146583c-0b5f-11ec-abf8-da7ad0900001" + type: string + relationships: + $ref: "#/components/schemas/CaseWatcherRelationships" + type: + $ref: "#/components/schemas/CaseWatcherResourceType" + required: + - id + - type + - relationships + type: object + CaseWatcherRelationships: + description: Relationships for a case watcher, linking to the underlying user resource. + properties: + user: + $ref: "#/components/schemas/CaseWatcherUserRelationship" + required: + - user + type: object + CaseWatcherResourceType: + default: watcher + description: JSON:API resource type for case watchers. + enum: + - watcher + example: watcher + type: string + x-enum-varnames: + - WATCHER + CaseWatcherUserRelationship: + description: The user relationship for a case watcher. + properties: + data: + $ref: "#/components/schemas/UserRelationshipData" + required: + - data + type: object + CaseWatchersResponse: + description: Response containing the list of users watching a case. + properties: + data: + description: List of case watchers. + items: + $ref: "#/components/schemas/CaseWatcher" + type: array + required: + - data + type: object CasesResponse: description: Response with cases properties: @@ -13955,6 +15432,626 @@ components: type: string x-enum-varnames: - CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST + CommitmentsAwsEC2RICommitment: + description: AWS EC2 Reserved Instance commitment details. + properties: + availability_zone: + description: The availability zone of the reservation. + example: us-east-1a + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The EC2 instance type. + example: m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + offering_class: + description: The offering class of the Reserved Instance. + example: standard + type: string + operating_system: + description: The operating system of the Reserved Instance. + example: Linux + type: string + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - instance_type + - offering_class + - operating_system + - purchase_option + - region + type: object + CommitmentsAwsElasticacheRICommitment: + description: AWS ElastiCache Reserved Instance commitment details. + properties: + cache_engine: + description: The cache engine type of the Reserved Instance. + example: Redis + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The ElastiCache instance type. + example: cache.m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - cache_engine + - commitment_id + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsRDSRICommitment: + description: AWS RDS Reserved Instance commitment details. + properties: + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + database_engine: + description: The database engine of the Reserved Instance. + example: MySQL + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The RDS instance type. + example: db.m5.xlarge + type: string + is_multi_az: + description: Whether the Reserved Instance is Multi-AZ. + example: false + type: boolean + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - database_engine + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsSPCommitment: + description: AWS Savings Plan commitment details. + properties: + commitment_id: + description: The unique identifier of the Savings Plan. + example: arn:aws:savingsplans::123456789:savingsplan/abc123 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 1.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + purchase_option: + description: The payment option for the Savings Plan. + example: All Upfront + type: string + savings_plan_type: + description: The Savings Plan type. + example: ComputeSavingsPlans + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - purchase_option + - savings_plan_type + type: object + CommitmentsAzureComputeSPCommitment: + description: Azure Compute Savings Plan commitment details. + properties: + benefit_name: + description: The display name of the Azure Savings Plan. + example: my-compute-savings-plan + type: string + commitment_id: + description: The unique identifier of the Savings Plan. + example: /subscriptions/abc123/providers/Microsoft.BillingBenefits/savingsPlanOrders/xyz789 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 2.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + type: object + CommitmentsAzureVMRICommitment: + description: Azure Virtual Machine Reserved Instance commitment details. + properties: + benefit_name: + description: The display name of the Azure reservation. + example: my-vm-reservation + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: /subscriptions/abc123/providers/Microsoft.Capacity/reservationOrders/xyz789 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The Azure VM instance type. + example: Standard_D4s_v3 + type: string + meter_sub_category: + description: The Azure meter sub-category for the reservation. + example: D4s v3 + type: string + region: + description: The Azure region of the Reserved Instance. + example: eastus + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + status: + $ref: "#/components/schemas/CommitmentsAzureVMRIStatus" + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + - instance_type + - meter_sub_category + - region + - status + type: object + CommitmentsAzureVMRIStatus: + description: Status of an Azure VM Reserved Instance. + enum: + - running + - expired + - cancelled + example: running + type: string + x-enum-varnames: + - RUNNING + - EXPIRED + - CANCELLED + CommitmentsCommitmentType: + description: Type of commitment. ri for Reserved Instances, sp for Savings Plans. + enum: + - ri + - sp + example: ri + type: string + x-enum-varnames: + - RESERVED_INSTANCES + - SAVINGS_PLANS + CommitmentsCoverageScalarResponse: + description: Response containing scalar coverage metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsCoverageTimeseriesResponse: + description: Response containing timeseries coverage metrics for cloud commitment programs. + properties: + cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + hours: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - cost + - hours + type: object + CommitmentsListItem: + description: A commitment item, which varies based on the provider, product, and commitment type. + oneOf: + - $ref: "#/components/schemas/CommitmentsAwsEC2RICommitment" + - $ref: "#/components/schemas/CommitmentsAwsRDSRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsElasticacheRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsSPCommitment" + - $ref: "#/components/schemas/CommitmentsAzureVMRICommitment" + - $ref: "#/components/schemas/CommitmentsAzureComputeSPCommitment" + CommitmentsListItems: + description: Array of commitment items. + example: + - commitment_id: ri-0123456789abcdef0 + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + items: + $ref: "#/components/schemas/CommitmentsListItem" + type: array + CommitmentsListMeta: + description: Metadata for a commitments list response. + properties: + committed_spend_unit: + $ref: "#/components/schemas/CommitmentsUnit" + type: object + CommitmentsListResponse: + description: Response containing a list of cloud commitment details. + properties: + commitments: + $ref: "#/components/schemas/CommitmentsListItems" + meta: + $ref: "#/components/schemas/CommitmentsListMeta" + required: + - commitments + type: object + CommitmentsOnDemandHotspotsScalarMeta: + description: Metadata for the on-demand hot-spots scalar response. + properties: + on_demand_filters: + description: Active on-demand filters applied to the response. + example: "region:us-east-1" + type: string + required: + - on_demand_filters + type: object + CommitmentsOnDemandHotspotsScalarResponse: + description: Response containing scalar on-demand hot-spots data for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + meta: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarMeta" + total: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + - total + type: object + CommitmentsProvider: + description: Cloud provider for commitment programs. + enum: + - aws + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - AZURE + CommitmentsSavingsScalarResponse: + description: Response containing scalar savings metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsSavingsTimeseriesResponse: + description: Response containing timeseries savings metrics for cloud commitment programs. + properties: + actual_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + effective_savings_rate: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + on_demand_equivalent_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + realized_savings: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - actual_cost + - effective_savings_rate + - on_demand_equivalent_cost + - realized_savings + type: object + CommitmentsScalarColumn: + description: A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + properties: + meta: + $ref: "#/components/schemas/CommitmentsScalarColumnMeta" + name: + description: The column name. + example: utilization + type: string + type: + $ref: "#/components/schemas/CommitmentsScalarColumnType" + values: + $ref: "#/components/schemas/CommitmentsScalarColumnValueItems" + required: + - name + - type + - values + type: object + CommitmentsScalarColumnMeta: + description: Metadata for a scalar column, including unit information. + properties: + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - unit + type: object + CommitmentsScalarColumnType: + description: The column type. "group" for dimension columns, "number" for metric columns. + enum: + - group + - number + example: group + type: string + x-enum-varnames: + - GROUP + - NUMBER + CommitmentsScalarColumnValueItems: + description: Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + example: + - 0.85 + - 0.72 + items: + description: A scalar column value, either a group key (string) or a numeric metric. + type: array + CommitmentsScalarColumns: + description: Array of scalar columns in the response. + items: + $ref: "#/components/schemas/CommitmentsScalarColumn" + type: array + CommitmentsTimeseriesMetric: + description: A timeseries metric containing timestamps, series values, and optional unit metadata. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object + CommitmentsTimeseriesSeries: + additionalProperties: + $ref: "#/components/schemas/CommitmentsTimeseriesValues" + description: Timeseries data as a map of series names to their corresponding value arrays. + type: object + CommitmentsTimeseriesValues: + description: A series of numeric values for a timeseries metric. + items: + description: A single numeric value in the timeseries. + format: double + type: number + type: array + CommitmentsTimestamps: + description: Unix timestamps in seconds for the timeseries data points. + example: + - 1693526400 + - 1693612800 + items: + description: A Unix timestamp in seconds. + format: int64 + type: integer + type: array + CommitmentsUnit: + description: Unit metadata for a numeric metric. + properties: + family: + description: The unit family (for example, percentage or money). + example: percentage + type: string + id: + description: The unit identifier. + example: 17 + format: int64 + type: integer + name: + description: The unit name (for example, percent or dollar). + example: percent + type: string + plural: + description: The plural form of the unit name. + example: percent + type: string + scale_factor: + description: The scale factor for the unit. + example: 1 + format: double + type: number + short_name: + description: The abbreviated unit name (for example, % or $). + example: "%" + type: string + required: + - family + - id + - name + - plural + - scale_factor + - short_name + type: object + CommitmentsUtilizationScalarProductBreakdown: + description: Array of per-product utilization breakdown entries. + items: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdownEntry" + type: array + CommitmentsUtilizationScalarProductBreakdownEntry: + description: Per-product utilization data in a scalar utilization response. + properties: + product: + description: The cloud product name. + example: ec2 + type: string + utilization: + description: The utilization percentage for the product. + example: 0.85 + format: double + type: number + required: + - product + - utilization + type: object + CommitmentsUtilizationScalarResponse: + description: Response containing scalar utilization metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + product_breakdown: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdown" + required: + - columns + type: object + CommitmentsUtilizationTimeseriesResponse: + description: Response containing timeseries utilization metrics for cloud commitment programs. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object CompletionCondition: description: The definition of `CompletionCondition` object. properties: @@ -15632,6 +17729,7 @@ components: additionalProperties: description: The list of correlated values for the tag key. items: + description: A correlated tag value. type: string type: array description: Map of correlated tag keys to the list of correlated tag values. @@ -15812,6 +17910,191 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostCurrency: + description: A Cloud Cost Management billing currency entry. + properties: + id: + description: The currency code (for example, `USD`). + example: USD + type: string + type: + $ref: "#/components/schemas/CostCurrencyType" + required: + - id + - type + type: object + CostCurrencyResponse: + description: The dominant Cloud Cost Management billing currency for the requested period. The `data` array contains at most one entry, and is empty when no currency data is available. + example: + data: + - id: USD + type: cost_currency + properties: + data: + description: The dominant billing currency. Empty when no data is available, or a single entry otherwise. + items: + $ref: "#/components/schemas/CostCurrency" + type: array + required: + - data + type: object + CostCurrencyType: + default: cost_currency + description: Type of the Cloud Cost Management billing currency resource. + enum: + - cost_currency + example: cost_currency + type: string + x-enum-varnames: + - COST_CURRENCY + CostMetric: + description: A Cloud Cost Management metric that has data for the requested period. + properties: + id: + description: The metric name, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostMetricType" + required: + - id + - type + type: object + CostMetricType: + default: cost_metric + description: Type of the Cloud Cost Management available metric resource. + enum: + - cost_metric + example: cost_metric + type: string + x-enum-varnames: + - COST_METRIC + CostMetricsResponse: + description: List of available Cloud Cost Management metrics for the requested period. + example: + data: + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric + properties: + data: + description: List of available metrics. + items: + $ref: "#/components/schemas/CostMetric" + type: array + required: + - data + type: object + CostOrchestrator: + description: A container orchestrator detected in Cloud Cost Management data. + properties: + id: + description: The orchestrator name, for example `kubernetes` or `ecs`. + example: kubernetes + type: string + type: + $ref: "#/components/schemas/CostOrchestratorType" + required: + - id + - type + type: object + CostOrchestratorType: + default: cost_orchestrator + description: Type of the Cloud Cost Management orchestrator resource. + enum: + - cost_orchestrator + example: cost_orchestrator + type: string + x-enum-varnames: + - COST_ORCHESTRATOR + CostOrchestratorsResponse: + description: List of container orchestrators detected in Cloud Cost Management data for the requested period. + example: + data: + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator + properties: + data: + description: List of detected container orchestrators. + items: + $ref: "#/components/schemas/CostOrchestrator" + type: array + required: + - data + type: object + CostRecommendationArray: + description: A page of cost recommendations with pagination metadata. + properties: + data: + description: The list of cost recommendations on this page. + items: + $ref: "#/components/schemas/CostRecommendationData" + type: array + meta: + $ref: "#/components/schemas/RecommendationsPageMeta" + required: + - data + type: object + CostRecommendationData: + description: A single cost recommendation entry in JSON:API form. + properties: + attributes: + $ref: "#/components/schemas/CostRecommendationDataAttributes" + id: + description: Unique identifier for the recommendation. + type: string + type: + $ref: "#/components/schemas/CostRecommendationDataType" + required: + - type + type: object + CostRecommendationDataAttributes: + description: Attributes describing a single cost recommendation. + properties: + dd_resource_key: + description: Datadog resource key identifying the recommended resource. + type: string + potential_daily_savings: + $ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings" + recommendation_type: + description: The kind of recommendation (for example, `terminate` or `rightsize`). + type: string + resource_id: + description: Cloud provider identifier of the resource. + type: string + resource_type: + description: Resource type (for example, `aws_ec2_instance`). + type: string + tags: + description: Tags attached to the recommended resource. + items: + description: A single resource tag. + type: string + type: array + type: object + CostRecommendationDataAttributesPotentialDailySavings: + description: Estimated daily savings if the recommendation is applied. + properties: + amount: + description: Numeric amount of the potential daily savings. + format: double + type: number + currency: + description: ISO 4217 currency code for the savings amount. + type: string + type: object + CostRecommendationDataType: + default: recommendation + description: Recommendation resource type. + enum: + - recommendation + example: recommendation + type: string + x-enum-varnames: + - RECOMMENDATION CostTag: description: A Cloud Cost Management tag. properties: @@ -15997,6 +18280,121 @@ components: - description - tag_values type: object + CostTagKeyMetadata: + description: A Cloud Cost Management tag key metadata entry, aggregating coverage and example values for a single tag key, metric, and period. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeyMetadataAttributes" + id: + description: A composite identifier of the form `tag_key:metric` for monthly roll-ups, or `tag_key:metric:YYYY-MM-DD` when `filter[daily]=true`. + example: env:aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostTagKeyMetadataType" + required: + - attributes + - id + - type + type: object + CostTagKeyMetadataAttributes: + description: Attributes of a Cloud Cost Management tag key metadata entry. + properties: + cardinality_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataCardinalityByAccount" + cost_covered: + description: Total cost (in the report currency) of cost line items that carry this tag key for the requested period. + example: 1234.56 + format: double + type: number + date: + description: The day this row corresponds to, in `YYYY-MM-DD` format. Present only when `filter[daily]=true`; omitted for the monthly roll-up returned by default. + example: "2026-02-15" + type: string + metric: + description: The Cloud Cost Management metric this row aggregates, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + row_count: + description: Number of cost rows that carry this tag key over the requested period. + example: 100 + format: int64 + type: integer + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + items: + description: A tag source. + type: string + type: array + top_values_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataTopValuesByAccount" + required: + - cardinality_by_account + - cost_covered + - metric + - row_count + - tag_sources + - top_values_by_account + type: object + CostTagKeyMetadataCardinalityByAccount: + additionalProperties: + description: Number of unique tag values observed in the account. + format: int64 + type: integer + description: Number of unique tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": 42 + type: object + CostTagKeyMetadataResponse: + description: List of Cloud Cost Management tag key metadata entries for the requested period. + example: + data: + - attributes: + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata + properties: + data: + description: List of tag key metadata entries. + items: + $ref: "#/components/schemas/CostTagKeyMetadata" + type: array + required: + - data + type: object + CostTagKeyMetadataTopValuesByAccount: + additionalProperties: + description: A sample of the most frequent tag values observed in the account. + items: + description: A tag value observed for this tag key. + type: string + type: array + description: A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": + - prod + - staging + type: object + CostTagKeyMetadataType: + default: cost_tag_key_metadata + description: Type of the Cloud Cost Management tag key metadata resource. + enum: + - cost_tag_key_metadata + example: cost_tag_key_metadata + type: string + x-enum-varnames: + - COST_TAG_KEY_METADATA CostTagKeyResponse: description: A single Cloud Cost Management tag key. example: @@ -16019,6 +18417,77 @@ components: required: - data type: object + CostTagKeySource: + description: A Cloud Cost Management tag key paired with the sources that produced it. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeySourceAttributes" + id: + description: The tag key identifier. Equal to the empty-tag sentinel `__empty_tag_key__` when the tag key is empty. + example: env + type: string + type: + $ref: "#/components/schemas/CostTagKeySourceType" + required: + - attributes + - id + - type + type: object + CostTagKeySourceAttributes: + description: Attributes of a Cloud Cost Management tag source. + properties: + tag_key: + description: The tag key name. + example: env + type: string + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + - custom + items: + description: A tag source. + type: string + type: array + required: + - tag_key + - tag_sources + type: object + CostTagKeySourceType: + default: cost_tag_key_source + description: Type of the Cloud Cost Management tag source resource. + enum: + - cost_tag_key_source + example: cost_tag_key_source + type: string + x-enum-varnames: + - COST_TAG_KEY_SOURCE + CostTagKeySourcesResponse: + description: List of Cloud Cost Management tag keys with their origin sources for the requested period. + example: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + properties: + data: + description: List of tag keys with their origin sources. + items: + $ref: "#/components/schemas/CostTagKeySource" + type: array + required: + - data + type: object CostTagKeyType: default: cost_tag_key description: Type of the Cloud Cost Management tag key resource. @@ -16052,6 +18521,16 @@ components: required: - data type: object + CostTagMetadataDailyFilter: + description: Granularity for tag metadata results. `true` returns one row per day, `false` (or omitted) returns the monthly roll-up. + enum: + - "true" + - "false" + example: "true" + type: string + x-enum-varnames: + - "TRUE" + - "FALSE" CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -17089,10 +19568,6 @@ components: description: The title of the degradation. example: Elevated API Latency type: string - updates: - items: - $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItems" - type: array required: - components_affected - status @@ -17130,48 +19605,6 @@ components: - IDENTIFIED - MONITORING - RESOLVED - CreateDegradationRequestDataAttributesUpdatesItems: - description: A degradation update entry. - properties: - components_affected: - description: The components affected. - items: - $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems" - type: array - description: - description: A description of the update. - example: "" - type: string - started_at: - description: Timestamp of when the update occurred. - example: "" - format: date-time - type: string - status: - $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" - required: - - components_affected - - description - - started_at - - status - type: object - CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems: - description: A component affected by a degradation update. - properties: - id: - description: The ID of the component. Must be a component of type `component`. - example: "" - type: string - name: - description: The name of the component. - readOnly: true - type: string - status: - $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" - required: - - id - - status - type: object CreateDeploymentGateParams: description: Parameters for creating a deployment gate. properties: @@ -17540,10 +19973,6 @@ components: description: The title of the maintenance. example: "API Maintenance" type: string - updates: - items: - $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItems" - type: array required: - components_affected - title @@ -17571,48 +20000,6 @@ components: - id - status type: object - CreateMaintenanceRequestDataAttributesUpdatesItems: - description: A maintenance update entry. - properties: - components_affected: - description: The components affected. - items: - $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems" - type: array - description: - description: A description of the update. - example: "" - type: string - started_at: - description: Timestamp of when the update occurred. - example: "" - format: date-time - type: string - status: - $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" - required: - - components_affected - - description - - started_at - - status - type: object - CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems: - description: A component affected by a maintenance update. - properties: - id: - description: The ID of the component. Must be a component of type `component`. - example: "" - type: string - name: - description: The name of the component. - readOnly: true - type: string - status: - $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus" - required: - - id - - status - type: object CreateMaintenanceRequestDataAttributesUpdatesItemsStatus: description: The status of a maintenance update. enum: @@ -17889,6 +20276,40 @@ components: - type - number type: object + CreatePublishRequestRequest: + description: A request to ask for approval to publish an app whose protection level is `approval_required`. + example: + data: + attributes: + description: Adds new dashboard widgets and a few bug fixes. + title: Release v1.2 to production + type: publishRequest + properties: + data: + $ref: "#/components/schemas/CreatePublishRequestRequestData" + type: object + CreatePublishRequestRequestData: + description: Data for creating a publish request. + properties: + attributes: + $ref: "#/components/schemas/CreatePublishRequestRequestDataAttributes" + type: + $ref: "#/components/schemas/PublishRequestType" + type: object + CreatePublishRequestRequestDataAttributes: + description: Attributes for creating a publish request. + properties: + description: + description: An optional description of the changes in this publish request. + example: Adds new dashboard widgets and a few bug fixes. + type: string + title: + description: A short title for the publish request. + example: Release v1.2 to production + type: string + required: + - title + type: object CreateRuleRequest: description: Scorecard create rule request. properties: @@ -19144,7 +21565,7 @@ components: $ref: "#/components/schemas/CsmServerlessCoverageAnalysisData" type: object CustomAttributeConfig: - description: The definition of `CustomAttributeConfig` object. + description: "A custom attribute configuration that defines an organization-specific metadata field on cases. Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined select options." properties: attributes: $ref: "#/components/schemas/CustomAttributeConfigResourceAttributes" @@ -19156,22 +21577,22 @@ components: $ref: "#/components/schemas/CustomAttributeConfigResourceType" type: object CustomAttributeConfigAttributesCreate: - description: Custom attribute config resource attributes + description: Attributes required to create a custom attribute configuration. properties: description: - description: Custom attribute description. + description: A description explaining the purpose and expected values for this custom attribute. example: "AWS Region, must be a valid region supported by AWS" type: string display_name: - description: Custom attribute name. + description: The human-readable label shown in the Case Management UI for this custom attribute. example: "AWS Region" type: string is_multi: - description: Whether multiple values can be set + description: "If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed." example: true type: boolean key: - description: Custom attribute key. This will be the value use to search on this custom attribute + description: The programmatic key used to reference this custom attribute in search queries and API calls. example: "aws_region" type: string type: @@ -19183,7 +21604,7 @@ components: - is_multi type: object CustomAttributeConfigCreate: - description: Custom attribute config + description: Data object for creating a custom attribute configuration. properties: attributes: $ref: "#/components/schemas/CustomAttributeConfigAttributesCreate" @@ -19194,7 +21615,7 @@ components: - type type: object CustomAttributeConfigCreateRequest: - description: Custom attribute config create request + description: Request payload for creating a custom attribute configuration. properties: data: $ref: "#/components/schemas/CustomAttributeConfigCreate" @@ -19202,26 +21623,26 @@ components: - data type: object CustomAttributeConfigResourceAttributes: - description: Custom attribute resource attributes + description: "Attributes of a custom attribute configuration, defining an organization-specific metadata field that can be added to cases of a given type." properties: case_type_id: - description: Custom attribute config identifier. + description: The UUID of the case type this custom attribute belongs to. example: "aeadc05e-98a8-11ec-ac2c-da7ad0900001" type: string description: - description: Custom attribute description. + description: A description explaining the purpose and expected values for this custom attribute. example: "AWS Region, must be a valid region supported by AWS" type: string display_name: - description: Custom attribute name. + description: The human-readable label shown in the Case Management UI for this custom attribute. example: "AWS Region" type: string is_multi: - description: Whether multiple values can be set + description: "If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed." example: true type: boolean key: - description: Custom attribute key. This will be the value use to search on this custom attribute + description: The programmatic key used to reference this custom attribute in search queries and API calls. example: "aws_region" type: string type: @@ -19235,7 +21656,7 @@ components: type: object CustomAttributeConfigResourceType: default: custom_attribute - description: Custom attributes config JSON:API resource type + description: JSON:API resource type for custom attribute configurations. enum: - custom_attribute example: custom_attribute @@ -19243,13 +21664,50 @@ components: x-enum-varnames: - CUSTOM_ATTRIBUTE CustomAttributeConfigResponse: - description: Custom attribute config response. + description: Response containing a single custom attribute configuration. properties: data: $ref: "#/components/schemas/CustomAttributeConfig" type: object + CustomAttributeConfigUpdate: + description: Data object for updating a custom attribute configuration. + properties: + attributes: + $ref: "#/components/schemas/CustomAttributeConfigUpdateAttributes" + type: + $ref: "#/components/schemas/CustomAttributeConfigResourceType" + required: + - type + type: object + CustomAttributeConfigUpdateAttributes: + description: Attributes that can be updated on a custom attribute configuration. All fields are optional; only provided fields are changed. + properties: + description: + description: A description explaining the purpose and expected values for this custom attribute. + example: "Updated description." + type: string + display_name: + description: The human-readable label shown in the Case Management UI for this custom attribute. + example: "AWS Region" + type: string + map_from: + description: An external field identifier to auto-populate this attribute from (used for integrations with external systems). + type: string + type: + $ref: "#/components/schemas/CustomAttributeType" + type_data: + $ref: "#/components/schemas/CustomAttributeTypeData" + type: object + CustomAttributeConfigUpdateRequest: + description: Request payload for updating a custom attribute configuration. + properties: + data: + $ref: "#/components/schemas/CustomAttributeConfigUpdate" + required: + - data + type: object CustomAttributeConfigsResponse: - description: Custom attribute configs response. + description: Response containing a list of custom attribute configurations. properties: data: description: List of custom attribute configs of case type @@ -19258,27 +21716,37 @@ components: type: array type: object CustomAttributeMultiNumberValue: - description: Values of multi NUMBER custom attribute + description: An array of numeric values for a multi-value NUMBER-type custom attribute. items: description: NUMBER value format: double type: number type: array CustomAttributeMultiStringValue: - description: Value of multi TEXT/URL/NUMBER/SELECT custom attribute + description: An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute. items: description: TEXT/URL/NUMBER/SELECT Value type: string type: array CustomAttributeNumberValue: - description: Value of NUMBER custom attribute + description: A numeric value for a NUMBER-type custom attribute. format: double type: number + CustomAttributeSelectOption: + description: A selectable option for a SELECT-type custom attribute. + properties: + value: + description: Option value. + example: "us-east-1" + type: string + required: + - value + type: object CustomAttributeStringValue: - description: Value of TEXT/URL/NUMBER/SELECT custom attribute + description: A string value for a TEXT, URL, or SELECT-type custom attribute. type: string CustomAttributeType: - description: Custom attributes type + description: "The data type of the custom attribute, which determines the allowed values and UI input control." enum: - URL - TEXT @@ -19291,8 +21759,17 @@ components: - TEXT - NUMBER - SELECT + CustomAttributeTypeData: + description: "Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains the list of allowed options." + properties: + options: + description: Options for SELECT type custom attributes. + items: + $ref: "#/components/schemas/CustomAttributeSelectOption" + type: array + type: object CustomAttributeValue: - description: Custom attribute values + description: A typed value for a custom attribute on a specific case. properties: is_multi: description: If true, value must be an array @@ -19308,7 +21785,7 @@ components: - value type: object CustomAttributeValuesUnion: - description: Union of supported value for a custom attribute + description: The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values. example: "" oneOf: - $ref: "#/components/schemas/CustomAttributeStringValue" @@ -21755,6 +24232,136 @@ components: - INTEGRATION_SCREENBOARD - INTEGRATION_TIMEBOARD - HOST_TIMEBOARD + DashboardUsage: + description: A single dashboard usage record. + properties: + attributes: + $ref: "#/components/schemas/DashboardUsageAttributes" + id: + description: The dashboard ID. + example: "q5j-nti-fv6" + type: string + type: + $ref: "#/components/schemas/DashboardUsageType" + required: + - id + - type + - attributes + type: object + DashboardUsageAttributes: + description: Usage statistics for a dashboard. + properties: + author: + $ref: "#/components/schemas/DashboardUsageUser" + created_at: + description: When the dashboard was created. + example: "2026-01-15T09:30:00.000Z" + format: date-time + nullable: true + type: string + dashboard_quality_score: + description: The dashboard quality score, or `null` when no score is available. + example: 0.85 + format: double + nullable: true + type: number + edited_at: + description: When the dashboard was most recently edited. + example: "2026-04-20T11:05:00.000Z" + format: date-time + nullable: true + type: string + org_id: + description: The Datadog organization that owns the dashboard. + example: 100 + format: int64 + type: integer + teams: + description: Teams the dashboard is tagged with. + items: + description: A team handle. + type: string + nullable: true + type: array + title: + description: The dashboard title. + example: My production overview + type: string + total_views: + description: The total number of times the dashboard has been viewed. + example: 42 + format: int64 + type: integer + total_views_by_type: + additionalProperties: + description: View count for that view type. + format: int64 + type: integer + description: View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`. + nullable: true + type: object + viewed_at: + description: When the dashboard was most recently viewed. + example: "2026-05-01T14:22:10.000Z" + format: date-time + nullable: true + type: string + viewer: + $ref: "#/components/schemas/DashboardUsageUser" + widget_count: + description: The total number of widgets on the dashboard. + example: 12 + format: int64 + nullable: true + type: integer + widget_count_by_type: + additionalProperties: + description: Widget count for that widget type. + format: int64 + type: integer + description: Widget counts keyed by widget type. The map includes group widgets and widgets without requests. + nullable: true + type: object + required: + - org_id + type: object + DashboardUsageResponse: + description: Response containing usage statistics for a single dashboard. + properties: + data: + $ref: "#/components/schemas/DashboardUsage" + required: + - data + type: object + DashboardUsageType: + default: dashboards-usages + description: The type of the resource. Always `dashboards-usages`. + enum: + - dashboards-usages + example: dashboards-usages + type: string + x-enum-varnames: + - DASHBOARDS_USAGES + DashboardUsageUser: + description: A user referenced from a dashboard usage record (author or viewer). + nullable: true + properties: + handle: + description: Datadog handle (login) of the user. + example: jane.doe@example.com + type: string + id: + description: The user ID. + example: "00000000-0000-0000-0000-000000000000" + type: string + is_disabled: + description: Whether the user account is disabled. + type: boolean + name: + description: Display name of the user. + example: Jane Doe + type: string + type: object DataAttributesRulesItemsIfTagExists: description: The behavior when the tag already exists. enum: @@ -22572,6 +25179,9 @@ components: format: uuid readOnly: true type: string + last_modified_by_user_uuid: + description: UUID of the user who last modified the resource. + type: string modified_at: description: Timestamp of when the update was last modified. format: date-time @@ -24478,6 +27088,101 @@ components: type: string type: array type: object + EntityContextEntity: + description: A single entity returned by the entity context endpoint. + properties: + attributes: + $ref: "#/components/schemas/EntityContextEntityAttributes" + id: + description: The unique identifier of the entity. + example: user@example.com + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringEntityContextEntityType" + required: + - id + - type + - attributes + type: object + EntityContextEntityAttributes: + description: The attributes of an entity context entry, grouping all the historical revisions of the entity. + properties: + revisions: + description: The historical revisions of the entity, ordered chronologically. + items: + $ref: "#/components/schemas/EntityContextRevision" + type: array + required: + - revisions + type: object + EntityContextPage: + description: Pagination metadata for the entity context response. + properties: + next_token: + description: An opaque token to pass as `page_token` in a subsequent request to retrieve the next page of results. Empty when there are no more results. + example: "" + type: string + required: + - next_token + type: object + EntityContextResponse: + description: Response from the entity context endpoint, containing the matching entities and pagination metadata. + properties: + data: + description: The list of entities matching the query. + items: + $ref: "#/components/schemas/EntityContextEntity" + type: array + meta: + $ref: "#/components/schemas/EntityContextResponseMeta" + required: + - data + - meta + type: object + EntityContextResponseMeta: + description: Metadata returned alongside the entity context response. + properties: + page: + $ref: "#/components/schemas/EntityContextPage" + total_count: + description: The total number of entities matching the query, irrespective of pagination. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - page + - total_count + type: object + EntityContextRevision: + description: A single historical revision of an entity, including the time range during which the revision was observed. + properties: + attributes: + $ref: "#/components/schemas/EntityContextRevisionAttributes" + first_seen_at: + description: The first time the entity was observed at this revision. + example: "2026-04-01T00:00:00Z" + format: date-time + type: string + last_seen_at: + description: The last time the entity was observed at this revision. + example: "2026-05-01T00:00:00Z" + format: date-time + type: string + required: + - attributes + - first_seen_at + - last_seen_at + type: object + EntityContextRevisionAttributes: + additionalProperties: {} + description: The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity. + example: + display_name: Test User + emails: + - user@example.com + principal_id: user@example.com + type: object EntityData: description: Entity data. properties: @@ -31402,6 +34107,21 @@ components: type: string type: array type: object + GetBlueprintResponse: + description: The response for retrieving a single blueprint. + properties: + data: + $ref: "#/components/schemas/BlueprintData" + type: object + GetBlueprintsResponse: + description: The response for retrieving multiple blueprints. + properties: + data: + description: An array of blueprints. + items: + $ref: "#/components/schemas/BlueprintData" + type: array + type: object GetCustomFrameworkResponse: description: Response object to get a custom framework. properties: @@ -39022,33 +41742,19 @@ components: type: object LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. - properties: - annotations: - description: List of annotations for this interaction. - items: - $ref: "#/components/schemas/LLMObsAnnotationItem" - type: array - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - id: - description: Unique identifier of the interaction. - example: "interaction-456" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - id - - type - - content_id - - annotations - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" LLMObsAnnotatedInteractionsDataAttributesResponse: description: Attributes containing the list of annotated interactions. properties: annotated_interactions: description: List of interactions with their annotations. + example: + - annotations: [] + content_id: trace-abc-123 + id: "interaction-456" + type: trace items: $ref: "#/components/schemas/LLMObsAnnotatedInteractionItem" type: array @@ -39230,45 +41936,22 @@ components: type: object LLMObsAnnotationQueueInteractionItem: description: A single interaction to add to an annotation queue. - properties: - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - type - - content_id - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceInteractionItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionItem" LLMObsAnnotationQueueInteractionResponseItem: description: A single interaction result. - properties: - already_existed: - description: Whether this interaction already existed in the queue. - example: false - type: boolean - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - id: - description: Unique identifier of the interaction. - example: "00000000-0000-0000-0000-000000000000" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - id - - type - - content_id - - already_existed - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceInteractionResponseItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionResponseItem" LLMObsAnnotationQueueInteractionsDataAttributesRequest: description: Attributes for adding interactions to an annotation queue. properties: interactions: description: List of interactions to add to the queue. Must contain at least one item. + example: + - content_id: trace-abc-123 + type: trace items: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionItem" minItems: 1 @@ -39281,6 +41964,11 @@ components: properties: interactions: description: List of interactions that were processed. + example: + - already_existed: false + content_id: trace-abc-123 + id: "00000000-0000-0000-0000-000000000000" + type: trace items: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionResponseItem" type: array @@ -39476,6 +42164,218 @@ components: required: - label_schemas type: object + LLMObsAnthropicEffort: + description: The effort level for Anthropic inference. + enum: + - low + - medium + - high + - max + example: medium + nullable: true + type: string + x-enum-varnames: + - LOW + - MEDIUM + - HIGH + - MAX + LLMObsAnthropicMetadata: + description: Anthropic-specific metadata for an inference request. + properties: + effort: + $ref: "#/components/schemas/LLMObsAnthropicEffort" + thinking: + $ref: "#/components/schemas/LLMObsAnthropicThinkingConfig" + nullable: true + type: object + LLMObsAnthropicThinkingConfig: + description: Configuration for Anthropic extended thinking feature. + properties: + budget_tokens: + description: Maximum token budget for extended thinking. Required when type is `enabled`. + example: 1024 + format: int64 + nullable: true + type: integer + type: + $ref: "#/components/schemas/LLMObsAnthropicThinkingType" + required: + - type + type: object + LLMObsAnthropicThinkingType: + description: The thinking mode for Anthropic extended thinking. + enum: + - enabled + - disabled + - adaptive + example: enabled + type: string + x-enum-varnames: + - ENABLED + - DISABLED + - ADAPTIVE + LLMObsAzureOpenAIMetadata: + description: Azure OpenAI-specific metadata for an integration account or inference request. + properties: + deployment_id: + description: The Azure OpenAI deployment ID. + example: "my-gpt4-deployment" + type: string + model_version: + description: The model version deployed in Azure. + example: "0613" + type: string + resource_name: + description: The Azure OpenAI resource name. + example: "my-azure-resource" + type: string + type: object + LLMObsBedrockMetadata: + description: Amazon Bedrock-specific metadata for an inference request. + properties: + region: + description: The AWS region for the Bedrock request. + example: "us-east-1" + type: string + type: object + LLMObsContentBlock: + description: |- + A single content block rendered inside a `display_block` interaction. + `type` discriminates which other fields are meaningful: + + - `markdown` / `text`: `content` must be a string. + - `header`: `content` must be a string; `level`, when set, must be one of `sm`, `md`, `lg`, `xl`. + - `json`: `content` must be a well-formed JSON value (object, array, or scalar). + - `image`: `url` is required. + - `widget`: `tileDef` is required (any well-formed JSON; the frontend owns the renderable schema). + - `llmobs_trace`: `traceId` is required; `interactionType`, when set, must be `trace` or `experiment_trace`. + + `height`, when set, must be positive. + properties: + alt: + description: Alternative text for an `image` block. + example: "Example image" + type: string + content: + description: |- + Block payload. A string for `markdown`, `header`, and `text`; an + arbitrary JSON value (object, array, or scalar) for `json`. Omitted + for `image`, `widget`, and `llmobs_trace`. + example: "## Triage Instructions" + height: + description: Optional rendered height. Must be positive when set. + example: 240 + format: int64 + type: integer + interactionType: + $ref: "#/components/schemas/LLMObsContentBlockLLMObsTraceInteractionType" + label: + description: Optional label rendered alongside the block. + example: "Triage Instructions" + type: string + level: + $ref: "#/components/schemas/LLMObsContentBlockHeaderLevel" + tileDef: + description: |- + Tile definition for a `widget` block. Required for `widget`. The + schema is owned by the frontend renderer. + example: + requests: + - queries: + - data_source: metrics + name: q + query: "avg:system.cpu.user{*}" + response_format: timeseries + type: line + viz: timeseries + timeFrame: + $ref: "#/components/schemas/LLMObsContentBlockTimeFrame" + traceId: + description: Trace identifier. Required for `llmobs_trace` blocks. + example: "69fcc2bb0000000003113989d83069ba" + type: string + type: + $ref: "#/components/schemas/LLMObsContentBlockType" + url: + description: URL of the image. Required for `image` blocks. + example: "https://example.com/image.png" + type: string + required: + - type + type: object + LLMObsContentBlockHeaderLevel: + description: Visual size for a `header` block. + enum: + - sm + - md + - lg + - xl + example: md + type: string + x-enum-varnames: + - SM + - MD + - LG + - XL + LLMObsContentBlockLLMObsTraceInteractionType: + description: |- + Upstream interaction type referenced by an `llmobs_trace` block. + Restricted to `trace` or `experiment_trace`. + enum: + - trace + - experiment_trace + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + LLMObsContentBlockTimeFrame: + description: Unix-millis time range used by chart blocks. + properties: + end: + description: End of the range, in Unix milliseconds. + example: 1705315800000 + format: int64 + type: integer + start: + description: Start of the range, in Unix milliseconds. + example: 1705312200000 + format: int64 + type: integer + required: + - start + - end + type: object + LLMObsContentBlockType: + description: |- + Discriminator for a single `display_block` content block. Adding a + variant requires coordinated changes in the frontend renderer. + enum: + - markdown + - header + - text + - json + - image + - widget + - llmobs_trace + example: markdown + type: string + x-enum-varnames: + - MARKDOWN + - HEADER + - TEXT + - JSON + - IMAGE + - WIDGET + - LLMOBS_TRACE + LLMObsContentBlocks: + description: |- + List of content blocks that make up a `display_block` interaction. + Must contain at least one block. + items: + $ref: "#/components/schemas/LLMObsContentBlock" + minItems: 1 + type: array LLMObsCursorMeta: description: Pagination cursor metadata. properties: @@ -39896,6 +42796,139 @@ components: example: "my-gcp-project" type: string type: object + LLMObsDataDeletionRequest: + description: Request to delete LLM Observability data. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionRequestData" + required: + - data + type: object + LLMObsDataDeletionRequestAttributes: + description: Attributes for an LLM Observability data deletion request. + properties: + delay: + description: Optional delay in seconds before the deletion is executed. + example: 0 + format: int64 + type: integer + from: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + query: + additionalProperties: + type: string + description: Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + example: + query: "@trace_id:abc123def456" + type: object + to: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - query + - from + - to + type: object + LLMObsDataDeletionRequestData: + description: Data object for an LLM Observability data deletion request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsDataDeletionRequestType" + required: + - type + - attributes + type: object + LLMObsDataDeletionRequestType: + description: Resource type for an LLM Observability data deletion request. + enum: + - create_deletion_req + example: create_deletion_req + type: string + x-enum-varnames: + - CREATE_DELETION_REQ + LLMObsDataDeletionResponse: + description: Response containing details of a submitted LLM Observability data deletion request. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionResponseData" + required: + - data + type: object + LLMObsDataDeletionResponseAttributes: + description: Attributes of a submitted LLM Observability data deletion request. + properties: + created_at: + description: Timestamp when the deletion request was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + created_by: + description: UUID of the user who created the deletion request. + example: "user-uuid-1234" + type: string + from_time: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + org_id: + description: ID of the organization that submitted the deletion request. + example: 12345 + format: int64 + type: integer + product: + description: Product name for the deletion request. + example: "llmobs" + type: string + query: + description: The query string used to select data for deletion. + example: "@trace_id:abc123def456" + type: string + to_time: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - org_id + - product + - created_at + - created_by + - from_time + - to_time + - query + type: object + LLMObsDataDeletionResponseData: + description: Data object for an LLM Observability data deletion response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionResponseAttributes" + id: + description: Unique identifier of the deletion request. + example: "msg-abc123" + type: string + type: + $ref: "#/components/schemas/LLMObsDataDeletionResponseType" + required: + - id + - type + - attributes + type: object + LLMObsDataDeletionResponseType: + description: Resource type for an LLM Observability data deletion response. + enum: + - deletion_request + example: deletion_request + type: string + x-enum-varnames: + - DELETION_REQUEST LLMObsDatasetDataAttributesRequest: description: Attributes for creating an LLM Observability dataset. properties: @@ -40386,6 +43419,81 @@ components: required: - data type: object + LLMObsDisplayBlockAnnotatedInteractionItem: + description: A display_block interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Server-generated deterministic identifier derived from the block list. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - id + - type + - content_id + - annotations + - display_block + type: object + LLMObsDisplayBlockInteractionItem: + description: |- + An interaction whose rendered content is supplied directly as a list + of display blocks. The server generates `content_id` deterministically + from the block list. + properties: + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - type + - display_block + type: object + LLMObsDisplayBlockInteractionResponseItem: + description: A display_block interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Server-generated deterministic identifier derived from the block list. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - id + - type + - content_id + - already_existed + - display_block + type: object + LLMObsDisplayBlockInteractionType: + description: Type discriminator for a `display_block` interaction. + enum: + - display_block + example: display_block + type: string + x-enum-varnames: + - DISPLAY_BLOCK LLMObsEventType: description: Resource type for LLM Observability experiment events. enum: @@ -40509,6 +43617,75 @@ components: - type - attributes type: object + LLMObsExperimentEvalMetricEvent: + description: An evaluation metric event associated with an experiment span. + properties: + assessment: + $ref: "#/components/schemas/LLMObsMetricAssessment" + boolean_value: + description: Boolean value. Present when `metric_type` is `boolean`. + nullable: true + type: boolean + categorical_value: + description: Categorical value. Present when `metric_type` is `categorical`. + nullable: true + type: string + eval_source_type: + description: Source type of the evaluation. + example: "managed" + type: string + id: + description: Unique identifier of the evaluation metric event. + example: "00000000-0000-0000-0000-000000000001" + type: string + json_value: + additionalProperties: {} + description: JSON value. Present when `metric_type` is `json`. + nullable: true + type: object + label: + description: Label or name for the metric. + example: "faithfulness" + type: string + metadata: + additionalProperties: {} + description: Arbitrary metadata associated with the metric. + nullable: true + type: object + metric_source: + description: Source of the metric. Either `custom` (user-submitted) or `summary` (experiment-level aggregate). + example: "custom" + type: string + metric_type: + $ref: "#/components/schemas/LLMObsMetricScoreType" + reasoning: + description: Human-readable reasoning for the metric value. + nullable: true + type: string + score_value: + description: Numeric score. Present when `metric_type` is `score`. + format: double + nullable: true + type: number + span_id: + description: Span ID this metric is associated with. + example: "span-7a1b2c3d" + type: string + tags: + description: Tags associated with the metric. + items: + type: string + type: array + timestamp_ms: + description: Timestamp when the metric was recorded, in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + trace_id: + description: Trace ID linking this metric to a span. + example: "abc123def456" + type: string + type: object LLMObsExperimentEventsDataAttributesRequest: description: Attributes for pushing experiment events including spans and metrics. properties: @@ -40542,6 +43719,57 @@ components: required: - data type: object + LLMObsExperimentEventsType: + description: Resource type for an experiment events collection. + enum: + - experiment_events + example: experiment_events + type: string + x-enum-varnames: + - EXPERIMENT_EVENTS + LLMObsExperimentEventsV2DataAttributesResponse: + description: Attributes of an experiment events response. + properties: + spans: + description: Experiment spans, each enriched with their associated evaluation metrics. + items: + $ref: "#/components/schemas/LLMObsExperimentSpanWithEvals" + type: array + summary_metrics: + description: Experiment-level summary evaluation metrics (not tied to individual spans). + items: + $ref: "#/components/schemas/LLMObsExperimentEvalMetricEvent" + type: array + required: + - spans + - summary_metrics + type: object + LLMObsExperimentEventsV2DataResponse: + description: JSON:API data object for an experiment events response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentEventsV2DataAttributesResponse" + id: + description: Identifier for this events resource. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsExperimentEventsType" + required: + - id + - type + - attributes + type: object + LLMObsExperimentEventsV2Response: + description: Response for listing experiment events (v2/v3). Returns spans and summary metrics in a single resource. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentEventsV2DataResponse" + meta: + $ref: "#/components/schemas/LLMObsCursorMeta" + required: + - data + type: object LLMObsExperimentMetric: description: A metric associated with an LLM Observability experiment span. properties: @@ -40620,6 +43848,34 @@ components: required: - data type: object + LLMObsExperimentRunDataResponse: + description: Data object for an LLM Observability experiment run. + properties: + aggregate_data: + additionalProperties: {} + description: Aggregated metric data for this run. + nullable: true + type: object + created_at: + description: Timestamp when the run was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + experiment_id: + description: Identifier of the experiment this run belongs to. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + id: + description: Unique identifier of the experiment run. + example: "7a1b2c3d-4e5f-6789-abcd-ef0123456789" + type: string + run_number: + description: Sequential number of this run within the experiment. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + type: object LLMObsExperimentSpan: description: A span associated with an LLM Observability experiment. properties: @@ -40713,6 +43969,63 @@ components: x-enum-varnames: - OK - ERROR + LLMObsExperimentSpanWithEvals: + description: An experiment span enriched with its associated evaluation metrics. + properties: + dataset_record_id: + description: ID of the dataset record this span evaluated. + nullable: true + type: string + duration: + description: Duration of the span in nanoseconds. + example: 1500000000.0 + format: double + type: number + eval_metrics: + description: Evaluation metrics associated with this span. + items: + $ref: "#/components/schemas/LLMObsExperimentEvalMetricEvent" + type: array + id: + description: Unique identifier of the span. + example: "00000000-0000-0000-0000-000000000001" + type: string + meta: + $ref: "#/components/schemas/LLMObsExperimentSpanMeta" + metrics: + additionalProperties: + format: double + type: number + description: Numeric metrics attached to the span. + type: object + name: + description: Name of the span. + example: "llm_call" + type: string + parent_id: + description: Parent span ID, if any. + type: string + span_id: + description: Span ID. + example: "span-7a1b2c3d" + type: string + start_ns: + description: Start time in nanoseconds since Unix epoch. + example: 1705314600000000000 + format: int64 + type: integer + status: + $ref: "#/components/schemas/LLMObsExperimentSpanStatus" + tags: + description: Tags associated with the span. + items: + type: string + type: array + trace_id: + description: Trace ID. + example: "abc123def456" + type: string + type: object LLMObsExperimentType: description: Resource type of an LLM Observability experiment. enum: @@ -40750,6 +44063,493 @@ components: required: - data type: object + LLMObsExperimentationAnalyticsAggregate: + description: Analytics aggregation parameters. + properties: + compute: + description: List of metric computations to perform. + items: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsCompute" + minItems: 1 + type: array + dataset_version: + description: Filter to a specific dataset version. + format: int64 + nullable: true + type: integer + group_by: + description: Fields to group results by. + items: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsGroupBy" + type: array + indexes: + description: Data indexes to query. At least one is required. + example: + - "experiment-evals" + items: + type: string + minItems: 1 + type: array + limit: + description: Maximum number of results to return. + example: 1000 + format: int32 + maximum: 2147483647 + nullable: true + type: integer + search: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsSearch" + time: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsTimeRange" + required: + - compute + - indexes + - search + type: object + LLMObsExperimentationAnalyticsCompute: + description: A single metric computation definition. + properties: + metric: + description: Name of the metric to compute. + example: "score_value" + type: string + name: + description: Optional alias for this computation in the response. + example: "avg_faithfulness" + type: string + required: + - metric + type: object + LLMObsExperimentationAnalyticsDataAttributesRequest: + description: Attributes for an analytics request. + properties: + aggregate: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsAggregate" + required: + - aggregate + type: object + LLMObsExperimentationAnalyticsDataAttributesResponse: + description: Attributes of an analytics response. + properties: + hit_count: + description: Total number of events matched by the query before grouping. + example: 1500 + format: int64 + type: integer + result: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsResult" + required: + - hit_count + - result + type: object + LLMObsExperimentationAnalyticsDataRequest: + description: Data object for an analytics request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - type + - attributes + type: object + LLMObsExperimentationAnalyticsDataResponse: + description: JSON:API data object for an analytics response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsDataAttributesResponse" + id: + description: Server-generated identifier for this analytics result. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - id + - type + - attributes + type: object + LLMObsExperimentationAnalyticsGroupBy: + description: A field to group analytics results by. + properties: + field: + description: Field name to group by. + example: "span_id" + type: string + required: + - field + type: object + LLMObsExperimentationAnalyticsRequest: + description: Request to run an analytics aggregation over LLM Observability experimentation data. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsDataRequest" + required: + - data + type: object + LLMObsExperimentationAnalyticsResponse: + description: Response to an analytics query. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsDataResponse" + required: + - data + type: object + LLMObsExperimentationAnalyticsResult: + description: Analytics query result containing all buckets. + properties: + values: + description: List of result buckets. + items: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsValue" + type: array + required: + - values + type: object + LLMObsExperimentationAnalyticsSearch: + description: Search query for filtering analytics data. + properties: + query: + description: Filter expression. + example: "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + required: + - query + type: object + LLMObsExperimentationAnalyticsTimeRange: + description: Unix-millisecond time range for filtering analytics data. + properties: + from: + description: Start of the time range in milliseconds since Unix epoch. + example: 1705312200000 + format: int64 + type: integer + to: + description: End of the time range in milliseconds since Unix epoch. + example: 1705315800000 + format: int64 + type: integer + required: + - from + - to + type: object + LLMObsExperimentationAnalyticsValue: + description: A single analytics result bucket. + properties: + by: + additionalProperties: {} + description: The group-by field values for this bucket. + example: + span_id: "span-7a1b2c3d" + type: object + metrics: + additionalProperties: {} + description: Computed metric values for this bucket. + example: + score_value: 0.85 + type: object + required: + - metrics + type: object + LLMObsExperimentationContentPreview: + description: Options to control content preview truncation. + properties: + limit: + description: Maximum number of characters to include in content previews. + example: 500 + format: int64 + type: integer + type: object + LLMObsExperimentationCursorPage: + description: Cursor-based pagination parameters. + properties: + cursor: + description: Opaque cursor returned from a previous response to fetch the next page. + type: string + limit: + description: Maximum number of results per page. + example: 100 + format: int64 + type: integer + type: object + LLMObsExperimentationFilter: + description: Filter criteria for an experimentation search request. + properties: + include_deleted: + default: false + description: When `true`, include soft-deleted entities alongside active ones. + type: boolean + is_deleted: + default: false + description: When `true`, return only soft-deleted entities. + type: boolean + query: + description: Free-text search query. + example: "my experiment" + type: string + scope: + description: >- + Entity types to search. Valid values are `projects`, `datasets`, `dataset_records`, `experiments`, and `experiment_runs`. + example: + - "experiments" + items: + example: "experiments" + type: string + type: array + version: + description: Filter dataset records by a specific dataset version. + format: int64 + nullable: true + type: integer + required: + - scope + type: object + LLMObsExperimentationInclude: + description: Additional data to include in the response. + properties: + user_data: + default: false + description: When `true`, enrich results with author user data (name and email). + type: boolean + type: object + LLMObsExperimentationNumberPage: + description: Offset-based pagination parameters for simple search. + properties: + limit: + description: Maximum number of results per page. + example: 50 + format: int32 + maximum: 2147483647 + type: integer + number: + description: Page number to retrieve (1-indexed). + example: 1 + format: int32 + maximum: 2147483647 + minimum: 1 + type: integer + type: object + LLMObsExperimentationSearchDataAttributesRequest: + description: Attributes for an experimentation search request. + properties: + content_preview: + $ref: "#/components/schemas/LLMObsExperimentationContentPreview" + filter: + $ref: "#/components/schemas/LLMObsExperimentationFilter" + include: + $ref: "#/components/schemas/LLMObsExperimentationInclude" + page: + $ref: "#/components/schemas/LLMObsExperimentationCursorPage" + required: + - filter + type: object + LLMObsExperimentationSearchDataRequest: + description: Data object for an experimentation search request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationSearchDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - type + - attributes + type: object + LLMObsExperimentationSearchDataResponse: + description: JSON:API data object for an experimentation search response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationSearchResults" + id: + description: Server-generated identifier for this search result. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - id + - type + - attributes + type: object + LLMObsExperimentationSearchRequest: + description: Request to search across LLM Observability experimentation entities using cursor-based pagination. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationSearchDataRequest" + required: + - data + type: object + LLMObsExperimentationSearchResponse: + description: Response to a cursor-based experimentation search. Returns `200 OK` when all results fit in one page; `206 Partial Content` when a next-page cursor is available. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationSearchDataResponse" + meta: + $ref: "#/components/schemas/LLMObsCursorMeta" + required: + - data + type: object + LLMObsExperimentationSearchResults: + description: The matching experimentation entities grouped by type. + properties: + dataset_records: + description: Matching dataset records. Present when `dataset_records` is included in `filter.scope`. + items: + $ref: "#/components/schemas/LLMObsDatasetRecordDataResponse" + nullable: true + type: array + datasets: + description: Matching datasets. Present when `datasets` is included in `filter.scope`. + items: + $ref: "#/components/schemas/LLMObsDatasetDataResponse" + nullable: true + type: array + experiment_runs: + description: Matching experiment runs. Present when `experiment_runs` is included in `filter.scope`. + items: + $ref: "#/components/schemas/LLMObsExperimentRunDataResponse" + nullable: true + type: array + experiments: + description: Matching experiments. Present when `experiments` is included in `filter.scope`. + items: + $ref: "#/components/schemas/LLMObsExperimentDataAttributesResponse" + nullable: true + type: array + projects: + description: Matching projects. Present when `projects` is included in `filter.scope`. + items: + $ref: "#/components/schemas/LLMObsProjectDataResponse" + nullable: true + type: array + type: object + LLMObsExperimentationSimpleSearchDataAttributesRequest: + description: Attributes for an experimentation simple search request. + properties: + content_preview: + $ref: "#/components/schemas/LLMObsExperimentationContentPreview" + filter: + $ref: "#/components/schemas/LLMObsExperimentationFilter" + include: + $ref: "#/components/schemas/LLMObsExperimentationInclude" + page: + $ref: "#/components/schemas/LLMObsExperimentationNumberPage" + sort: + description: Sort order for results. + items: + $ref: "#/components/schemas/LLMObsExperimentationSortField" + type: array + required: + - filter + type: object + LLMObsExperimentationSimpleSearchDataRequest: + description: Data object for an experimentation simple search request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - type + - attributes + type: object + LLMObsExperimentationSimpleSearchDataResponse: + description: JSON:API data object for a simple search response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsExperimentationSearchResults" + id: + description: Server-generated identifier for this search result. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsExperimentationType" + required: + - id + - type + - attributes + type: object + LLMObsExperimentationSimpleSearchMeta: + description: Pagination metadata for a simple search response. + properties: + page: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchMetaPage" + type: object + LLMObsExperimentationSimpleSearchMetaPage: + description: Page metadata. + properties: + current: + description: Current page number. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + limit: + description: Page size used for this response. + example: 50 + format: int32 + maximum: 2147483647 + type: integer + total_count: + description: Total number of matching results (capped at the maximum search limit). + example: 193 + format: int32 + maximum: 2147483647 + type: integer + total_pages: + description: Total number of pages available. + example: 4 + format: int32 + maximum: 2147483647 + type: integer + type: object + LLMObsExperimentationSimpleSearchRequest: + description: Request to search across LLM Observability experimentation entities using offset-based pagination. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchDataRequest" + required: + - data + type: object + LLMObsExperimentationSimpleSearchResponse: + description: Response to an offset-based experimentation simple search. + properties: + data: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchDataResponse" + meta: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchMeta" + required: + - data + type: object + LLMObsExperimentationSortField: + description: A field and direction to sort results by. + properties: + direction: + $ref: "#/components/schemas/LLMObsExperimentationSortFieldDirection" + field: + description: The field name to sort on. + example: "created_at" + type: string + required: + - field + type: object + LLMObsExperimentationSortFieldDirection: + description: Sort direction. + enum: + - asc + - desc + example: "desc" + type: string + x-enum-varnames: + - ASC + - DESC + LLMObsExperimentationType: + description: Resource type for experimentation search and analytics operations. + enum: + - experimentation + example: experimentation + type: string + x-enum-varnames: + - EXPERIMENTATION LLMObsExperimentsResponse: description: Response containing a list of LLM Observability experiments. properties: @@ -40763,18 +44563,536 @@ components: required: - data type: object - LLMObsInteractionType: - description: Type of interaction in an annotation queue. + LLMObsInferenceCode: + description: A generated code snippet for running an inference request programmatically. + properties: + code: + description: The generated code content. + example: "import openai\nclient = openai.OpenAI()\n..." + type: string + id: + description: Unique identifier for the code snippet. + example: "code-python-001" + type: string + type: + description: The programming language or SDK type of the code snippet. + example: "python" + type: string + required: + - id + - type + - code + type: object + LLMObsInferenceContent: + description: A structured content block within a message. + properties: + type: + description: The content block type. + example: "text" + type: string + value: + $ref: "#/components/schemas/LLMObsInferenceContentValue" + required: + - type + - value + type: object + LLMObsInferenceContentList: + description: List of structured content blocks in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceContent" + type: array + LLMObsInferenceContentValue: + description: The typed value of a message content block. + properties: + text: + description: Plain text content. + example: "Hello, how can I help you?" + type: string + tool_call: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + tool_call_result: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: object + LLMObsInferenceErrorResponse: + description: Error details returned when an inference provider returns an error. + properties: + message: + description: A human-readable description of the error. + example: "The model does not exist." + type: string + type: + description: The provider-specific error type. + example: "invalid_request_error" + type: string + required: + - type + - message + type: object + LLMObsInferenceFunction: + description: A function definition for a tool available to the model. + properties: + description: + description: A description of what the function does. + example: "Get the current weather for a location." + type: string + name: + description: The name of the function. + example: "get_weather" + type: string + parameters: + additionalProperties: {} + description: JSON schema describing the function parameters. + example: + properties: + location: + type: string + type: object + type: object + required: + - name + - parameters + type: object + LLMObsInferenceMessage: + description: A single message in an LLM inference conversation. + properties: + content: + description: Plain text content of the message. + example: "What is the capital of France?" + type: string + contents: + $ref: "#/components/schemas/LLMObsInferenceContentList" + id: + description: Unique identifier for the message. + example: "msg_001" + type: string + role: + description: The role of the message author. + example: "user" + type: string + tool_calls: + $ref: "#/components/schemas/LLMObsInferenceToolCallsList" + tool_results: + $ref: "#/components/schemas/LLMObsInferenceToolResultsList" + type: object + LLMObsInferenceMessagesList: + description: List of messages in an inference conversation. + items: + $ref: "#/components/schemas/LLMObsInferenceMessage" + type: array + LLMObsInferenceRunResult: + description: The output of a completed LLM inference call. + properties: + assessment: + description: An optional assessment of the inference output quality. + example: "pass" + nullable: true + type: string + content: + description: The text content of the model response. + example: "The capital of France is Paris." + type: string + finish_reason: + description: The reason the model stopped generating tokens. + example: "stop" + type: string + inference_codes: + $ref: "#/components/schemas/LLMObsIntegrationInferenceCodesResponse" + input_tokens: + description: Number of input tokens consumed. + example: 15 + format: int64 + type: integer + internal_reasoning: + $ref: "#/components/schemas/LLMObsInternalReasoning" + nullable: true + latency: + description: Request latency in milliseconds. + example: 843 + format: int64 + type: integer + output_tokens: + description: Number of output tokens generated. + example: 10 + format: int64 + type: integer + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + total_tokens: + description: Total tokens used (input plus output). + example: 25 + format: int64 + type: integer + required: + - content + - input_tokens + - output_tokens + - total_tokens + - latency + - finish_reason + - inference_codes + - tools + - assessment + type: object + LLMObsInferenceTool: + description: A tool definition available to the model during inference. + properties: + function: + $ref: "#/components/schemas/LLMObsInferenceFunction" + type: + description: The type of tool. + example: "function" + type: string + required: + - type + - function + type: object + LLMObsInferenceToolCall: + description: A tool call made during LLM inference. + properties: + arguments: + additionalProperties: {} + description: The arguments passed to the tool. + example: + location: "San Francisco" + type: object + name: + description: The name of the tool being called. + example: "get_weather" + type: string + tool_id: + description: Unique identifier for the tool call. + example: "call_abc123" + type: string + type: + description: The type of tool call. + example: "function" + type: string + type: object + LLMObsInferenceToolCallsList: + description: List of tool calls in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + type: array + LLMObsInferenceToolResult: + description: The result returned by a tool call during LLM inference. + properties: + name: + description: The name of the tool that produced this result. + example: "get_weather" + type: string + result: + description: The result content returned by the tool. + example: "The weather in San Francisco is 68°F and sunny." + type: string + tool_id: + description: Identifier matching the corresponding tool call. + example: "call_abc123" + type: string + type: + description: The type of tool result. + example: "function" + type: string + type: object + LLMObsInferenceToolResultsList: + description: List of tool results in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: array + LLMObsInferenceToolsList: + description: List of tools available to the model. + items: + $ref: "#/components/schemas/LLMObsInferenceTool" + type: array + LLMObsIntegrationAccount: + description: A configured account for an LLM provider integration. + properties: + account_id: + description: Provider-specific account identifier. + example: "org-XYZ123" + type: string + account_name: + description: Human-readable name for the integration account. + example: "Production OpenAI" + type: string + account_region: + description: Provider region associated with the account, if applicable. + example: "us-east-1" + type: string + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + id: + description: Unique identifier for the integration account. + example: "account-abc123" + type: string + integration: + description: The name of the LLM provider integration. + example: openai + type: string + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + required: + - id + - account_id + - account_name + - integration + type: object + LLMObsIntegrationInferenceCodesResponse: + description: List of generated code snippets for the inference configuration. + items: + $ref: "#/components/schemas/LLMObsInferenceCode" + type: array + LLMObsIntegrationInferenceRequest: + description: Parameters for an LLM inference request. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + frequency_penalty: + description: Penalty for token frequency to reduce repetition. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema for structured output, if supported by the model. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens to generate. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier to use for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Penalty for token presence to encourage topic diversity. + example: 0.0 + format: double + nullable: true + type: number + temperature: + description: Sampling temperature between 0 and 2. Higher values produce more random output. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling probability mass. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + type: object + LLMObsIntegrationInferenceResponse: + description: The result of an LLM inference request, including input parameters and the model response. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + error_response: + $ref: "#/components/schemas/LLMObsInferenceErrorResponse" + frequency_penalty: + description: Frequency penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema that was applied for structured output. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier used for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Presence penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + response: + $ref: "#/components/schemas/LLMObsInferenceRunResult" + temperature: + description: Sampling temperature that was used. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter that was used. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling parameter that was used. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + - response + type: object + LLMObsIntegrationModel: + description: A model available for a given LLM provider integration and account. + properties: + has_access: + description: Whether the account has access to this model. + example: true + type: boolean + id: + description: Unique identifier for the model entry. + example: "gpt-4o" + type: string + integration: + description: The name of the LLM provider integration. + example: "openai" + type: string + integration_display_name: + description: Human-readable name of the LLM provider integration. + example: "OpenAI" + type: string + json_schema: + description: Whether the model supports structured output via JSON schema. + example: true + type: boolean + model_display_name: + description: Human-readable model name. + example: "GPT-4o" + type: string + model_id: + description: Provider-specific model identifier used in inference calls. + example: "gpt-4o" + type: string + provider: + description: The underlying model provider. + example: "openai" + type: string + provider_display_name: + description: Human-readable name of the underlying model provider. + example: "OpenAI" + type: string + region_prefix_overrides: + $ref: "#/components/schemas/LLMObsIntegrationModelRegionPrefixOverrides" + required: + - id + - model_id + - model_display_name + - integration + - integration_display_name + - provider + - provider_display_name + - json_schema + - has_access + type: object + LLMObsIntegrationModelRegionPrefixOverrides: + additionalProperties: + type: string + description: Map of region-specific model ID prefix overrides. + example: + us-east-1: "us." + type: object + LLMObsIntegrationName: + description: The name of a supported LLM provider integration. enum: - - trace - - experiment_trace - - session - example: trace + - openai + - amazon_bedrock + - anthropic + - azure_openai + - vertex_ai + - llmproxy + example: openai type: string x-enum-varnames: - - TRACE - - EXPERIMENT_TRACE - - SESSION + - OPENAI + - AMAZON_BEDROCK + - ANTHROPIC + - AZURE_OPENAI + - VERTEX_AI + - LLMPROXY + LLMObsInternalReasoning: + description: The model's internal reasoning or thinking output, if available. + properties: + reasoning_tokens: + description: Number of tokens used for internal reasoning. + example: 256 + format: int64 + nullable: true + type: integer + text: + description: The reasoning text produced by the model. + example: "Let me think about this step by step..." + type: string + required: + - text + type: object LLMObsLabelSchema: description: Schema definition for a single label in an annotation queue. properties: @@ -40874,6 +45192,44 @@ components: - CATEGORICAL - BOOLEAN - JSON + LLMObsOpenAIMetadata: + description: OpenAI-specific metadata for an inference request. + properties: + reasoning_effort: + $ref: "#/components/schemas/LLMObsOpenAIReasoningEffort" + reasoning_summary: + $ref: "#/components/schemas/LLMObsOpenAIReasoningSummary" + type: object + LLMObsOpenAIReasoningEffort: + description: The reasoning effort level for OpenAI models that support it. + enum: + - none + - low + - medium + - high + - xhigh + example: medium + nullable: true + type: string + x-enum-varnames: + - NONE + - LOW + - MEDIUM + - HIGH + - XHIGH + LLMObsOpenAIReasoningSummary: + description: The verbosity of the reasoning summary. + enum: + - auto + - concise + - detailed + example: auto + nullable: true + type: string + x-enum-varnames: + - AUTO + - CONCISE + - DETAILED LLMObsProjectDataAttributesRequest: description: Attributes for creating an LLM Observability project. properties: @@ -41016,6 +45372,510 @@ components: type: string x-enum-varnames: - RECORDS + LLMObsSearchSpansRequest: + description: Request body for searching LLM Observability spans. + properties: + data: + $ref: "#/components/schemas/LLMObsSearchSpansRequestData" + required: + - data + type: object + LLMObsSearchSpansRequestAttributes: + description: Attributes of an LLM Observability spans search request. + properties: + filter: + $ref: "#/components/schemas/LLMObsSpanFilter" + options: + $ref: "#/components/schemas/LLMObsSpanSearchOptions" + page: + $ref: "#/components/schemas/LLMObsSpanPageQuery" + sort: + description: Sort order for the results. Use `-` prefix for descending order. + example: "-start_ns" + type: string + type: object + LLMObsSearchSpansRequestData: + description: Data object for an LLM Observability spans search request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsSearchSpansRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsSearchSpansRequestType" + required: + - type + - attributes + type: object + LLMObsSearchSpansRequestType: + description: Resource type for an LLM Observability spans search request. + enum: + - spans + example: spans + type: string + x-enum-varnames: + - SPANS + LLMObsSpanAttributes: + description: Attributes of an LLM Observability span. + properties: + duration: + description: Duration of the span in nanoseconds. + example: 1500000000.0 + format: double + type: number + evaluation: + additionalProperties: + $ref: "#/components/schemas/LLMObsSpanEvaluationMetric" + description: Evaluation metrics keyed by evaluator name. + type: object + input: + $ref: "#/components/schemas/LLMObsSpanIO" + intent: + description: Detected intent of the span. + type: string + metadata: + additionalProperties: {} + description: Arbitrary metadata associated with the span. + type: object + metrics: + additionalProperties: + format: double + type: number + description: Numeric metrics associated with the span (e.g., token counts). + type: object + ml_app: + description: Name of the ML application this span belongs to. + example: "my-llm-app" + type: string + model_name: + description: Name of the model used in this span. + example: "gpt-4o" + type: string + model_provider: + description: Provider of the model used in this span. + example: "openai" + type: string + name: + description: Name of the span. + example: "llm_call" + type: string + output: + $ref: "#/components/schemas/LLMObsSpanIO" + parent_id: + description: Identifier of the parent span, if any. + type: string + span_id: + description: Unique identifier of the span. + example: "abc123def456" + type: string + span_kind: + description: Kind of span (e.g., llm, agent, tool, task, workflow). + example: "llm" + type: string + start_ns: + description: Start time of the span in nanoseconds since Unix epoch. + example: 1705314600000000000 + format: int64 + type: integer + status: + description: Status of the span (e.g., ok, error). + example: "ok" + type: string + tags: + description: Tags associated with the span. + items: + type: string + type: array + tool_definitions: + description: Tool definitions available to the span. + items: + $ref: "#/components/schemas/LLMObsSpanToolDefinition" + type: array + trace_id: + description: Trace identifier this span belongs to. + example: "trace-9a8b7c6d5e4f" + type: string + required: + - span_id + - trace_id + - name + - status + - start_ns + - duration + - ml_app + - span_kind + type: object + LLMObsSpanData: + description: A single LLM Observability span. + properties: + attributes: + $ref: "#/components/schemas/LLMObsSpanAttributes" + id: + description: Unique identifier of the span. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/LLMObsSpanType" + required: + - id + - type + - attributes + type: object + LLMObsSpanEvaluationMetric: + description: An evaluation metric associated with an LLM Observability span. + properties: + assessment: + description: Assessment result (e.g., pass or fail). + example: pass + type: string + eval_metric_type: + description: Type of the evaluation metric (e.g., score, categorical, boolean). + example: score + type: string + reasoning: + description: Human-readable reasoning for the evaluation result. + type: string + status: + description: Status of the evaluation execution. + type: string + tags: + description: Tags associated with the evaluation metric. + items: + type: string + type: array + value: + description: Value of the evaluation result. + type: object + LLMObsSpanFilter: + description: Filter criteria for an LLM Observability span search. + properties: + from: + description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + example: "now-900s" + type: string + ml_app: + description: Filter by ML application name. + example: "my-llm-app" + type: string + query: + description: >- + Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`span_id`, `trace_id`, etc.) are ignored. + example: "@session_id:abc123def456" + type: string + span_id: + description: Filter by exact span ID. + example: "abc123def456" + type: string + span_kind: + description: Filter by span kind (e.g., llm, agent, tool, task, workflow). + example: "llm" + type: string + span_name: + description: Filter by span name. + example: "llm_call" + type: string + tags: + additionalProperties: + type: string + description: Filter by tag key-value pairs. + type: object + to: + description: End of the time range. Accepts ISO 8601 or relative format (e.g., `now`). Defaults to `now`. + example: "now" + type: string + trace_id: + description: Filter by exact trace ID. + example: "trace-9a8b7c6d5e4f" + type: string + type: object + LLMObsSpanIO: + description: Input or output content of an LLM Observability span. + properties: + messages: + description: List of messages in the input or output. + items: + $ref: "#/components/schemas/LLMObsSpanMessage" + type: array + value: + description: Plain-text value of the input or output. + type: string + type: object + LLMObsSpanMessage: + description: A single message in a span input or output. + properties: + content: + description: Text content of the message. + type: string + id: + description: Unique identifier of the message. + type: string + role: + description: Role of the message sender (e.g., user, assistant, system). + type: string + tool_calls: + description: Tool calls made in this message. + items: + $ref: "#/components/schemas/LLMObsSpanToolCall" + type: array + tool_results: + description: Tool results returned in this message. + items: + $ref: "#/components/schemas/LLMObsSpanToolResult" + type: array + type: object + LLMObsSpanPageQuery: + description: Pagination settings for a span search request. + properties: + cursor: + description: Cursor from the previous response to retrieve the next page. + example: "eyJzdGFydCI6MTAwfQ==" + type: string + limit: + description: Maximum number of spans to return. Defaults to `10`. + example: 10 + format: int64 + type: integer + type: object + LLMObsSpanSearchOptions: + description: Additional options for a span search request. + properties: + include_attachments: + description: Whether to include attachment data in the response. Defaults to `true`. + example: true + type: boolean + time_offset: + description: Offset in seconds applied to both `from` and `to` timestamps. + example: 0 + format: int64 + type: integer + type: object + LLMObsSpanToolCall: + description: A tool call made during a span. + properties: + arguments: + additionalProperties: {} + description: Arguments passed to the tool. + type: object + name: + description: Name of the tool called. + type: string + tool_id: + description: Identifier of the tool call. + type: string + type: + description: Type of the tool call. + type: string + type: object + LLMObsSpanToolDefinition: + description: A tool definition available to an LLM span. + properties: + description: + description: Description of what the tool does. + type: string + name: + description: Name of the tool. + type: string + schema: + additionalProperties: {} + description: JSON schema describing the tool's input parameters. + type: object + version: + description: Version of the tool definition. + type: string + type: object + LLMObsSpanToolResult: + description: A result returned from a tool call during a span. + properties: + name: + description: Name of the tool that produced this result. + type: string + result: + description: Result value returned by the tool. + type: string + tool_id: + description: Identifier of the corresponding tool call. + type: string + type: + description: Type of the tool result. + type: string + type: object + LLMObsSpanType: + description: Resource type for an LLM Observability span. + enum: + - span + example: span + type: string + x-enum-varnames: + - SPAN + LLMObsSpansResponse: + description: Response containing a list of LLM Observability spans. + properties: + data: + description: List of spans matching the query. + items: + $ref: "#/components/schemas/LLMObsSpanData" + type: array + links: + $ref: "#/components/schemas/LLMObsSpansResponseLinks" + meta: + $ref: "#/components/schemas/LLMObsSpansResponseMeta" + required: + - data + - meta + type: object + LLMObsSpansResponseLinks: + description: Pagination links accompanying the spans response. + properties: + next: + description: URL to retrieve the next page of results. + example: "https://api.datadoghq.com/api/v2/llm-obs/v1/spans/events?page[cursor]=eyJzdGFydCI6MTAwfQ==" + type: string + type: object + LLMObsSpansResponseMeta: + description: Metadata accompanying the spans response. + properties: + elapsed: + description: Time elapsed for the query in milliseconds. + example: 132 + format: int64 + type: integer + page: + $ref: "#/components/schemas/LLMObsSpansResponsePage" + request_id: + description: Unique identifier for the request. + example: "req-abc123" + type: string + status: + description: Status of the query execution. + example: "done" + type: string + required: + - elapsed + - request_id + - status + - page + type: object + LLMObsSpansResponsePage: + description: Pagination cursor for the spans response. + properties: + after: + description: Cursor to retrieve the next page of results. Absent when there are no more results. + example: "eyJzdGFydCI6MTAwfQ==" + type: string + type: object + LLMObsTraceAnnotatedInteractionItem: + description: A trace, experiment trace, or session interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Upstream entity identifier supplied by the caller. + example: "trace-abc-123" + type: string + created_at: + description: Timestamp when the interaction was added to the queue. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + modified_at: + description: Timestamp when the interaction was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - id + - type + - content_id + - created_at + - modified_at + - annotations + type: object + LLMObsTraceInteractionItem: + description: An interaction that references an upstream trace, experiment trace, or session. + properties: + content_id: + description: Upstream entity identifier (trace, experiment trace, or session ID). + example: "trace-abc-123" + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - type + - content_id + type: object + LLMObsTraceInteractionResponseItem: + description: A trace, experiment trace, or session interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Upstream entity identifier supplied by the caller. + example: "trace-abc-123" + type: string + created_at: + description: Timestamp when the interaction was added to the queue. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + modified_at: + description: Timestamp when the interaction was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - id + - type + - content_id + - already_existed + - created_at + - modified_at + type: object + LLMObsTraceInteractionType: + description: Type of an upstream-entity interaction. + enum: + - trace + - experiment_trace + - session + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + - SESSION + LLMObsVertexAIMetadata: + description: Vertex AI-specific metadata for an integration account or inference request. + properties: + location: + description: The Vertex AI region. + example: "us-central1" + type: string + project: + description: The Google Cloud project ID. + example: "my-gcp-project" + type: string + project_ids: + description: List of Google Cloud project IDs available to the service account. + example: + - "my-gcp-project" + items: + type: string + type: array + type: object Language: description: Programming language enum: @@ -41402,6 +46262,17 @@ components: format: int64 type: integer type: object + ListAppVersionsResponse: + description: A paginated list of versions for an app. + properties: + data: + description: The list of app versions. + items: + $ref: "#/components/schemas/AppVersion" + type: array + meta: + $ref: "#/components/schemas/ListAppsResponseMeta" + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -41519,6 +46390,15 @@ components: required: - data type: object + ListBlueprintsResponse: + description: The response for listing available blueprints. + properties: + data: + description: An array of blueprint metadata. + items: + $ref: "#/components/schemas/BlueprintMetadataData" + type: array + type: object ListCampaignsResponse: description: Response containing a list of campaigns. properties: @@ -41650,6 +46530,52 @@ components: type: string x-enum-varnames: - LIST_CONNECTIONS_RESPONSE + ListDashboardsUsageResponse: + description: Paginated list of dashboard usage records. + properties: + data: + description: Dashboard usage records, one per dashboard in the caller's organization. + items: + $ref: "#/components/schemas/DashboardUsage" + type: array + links: + $ref: "#/components/schemas/ListDashboardsUsageResponseLinks" + meta: + $ref: "#/components/schemas/ListDashboardsUsageResponseMeta" + required: + - data + - meta + type: object + ListDashboardsUsageResponseLinks: + description: Pagination links for a list of dashboard usage records. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=250" + type: string + last: + description: Link to the last page, or `null` if the total is unknown. + nullable: true + type: string + next: + description: Link to the next page. Absent when there is no next page. + nullable: true + type: string + prev: + description: Link to the previous page. Absent when there is no previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/dashboards/usage" + type: string + type: object + ListDashboardsUsageResponseMeta: + description: Pagination metadata for a list of dashboard usage records. + properties: + page: + $ref: "#/components/schemas/PaginationMetaPage" + type: object ListDeploymentRuleResponseData: description: Data for a list of deployment rules. properties: @@ -42135,8 +47061,41 @@ components: example: "/api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2" type: string type: object - ListScorecardsResponse: - description: Response containing a list of scorecards. + ListScorecardScoresMeta: + description: Pagination metadata for scores. + properties: + count: + description: The number of results returned in this page. + format: int64 + type: integer + limit: + description: The page limit. + format: int64 + type: integer + offset: + description: The page offset. + format: int64 + type: integer + total: + description: The total number of results. + format: int64 + type: integer + type: object + ListScorecardScoresResponse: + description: A list of scorecard scores for a given aggregation type. + properties: + data: + description: Array of score objects. + items: + $ref: "#/components/schemas/ScorecardScoreData" + type: array + links: + $ref: "#/components/schemas/ListRulesResponseLinks" + meta: + $ref: "#/components/schemas/ListScorecardScoresMeta" + type: object + ListScorecardsResponse: + description: Response containing a list of scorecards. properties: data: $ref: "#/components/schemas/ListScorecardsResponseData" @@ -43627,6 +48586,167 @@ components: - type - id type: object + MaintenanceWindow: + description: A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowAttributes" + id: + description: The maintenance window's identifier. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - id + - type + - attributes + type: object + MaintenanceWindowAttributes: + description: Attributes of a maintenance window, including its schedule and the query that determines which cases are affected. + properties: + created_by: + description: The UUID of the user who created this maintenance window. Read-only. + readOnly: true + type: string + end_at: + description: The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes. + example: "2026-06-01T06:00:00Z" + format: date-time + type: string + name: + description: "A human-readable name for the maintenance window (for example, `Database migration - Dec 15`)." + example: "Weekly maintenance" + type: string + query: + description: A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar. + example: "project:SEC" + type: string + start_at: + description: The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed. + example: "2026-06-01T00:00:00Z" + format: date-time + type: string + updated_by: + description: The UUID of the user who last modified this maintenance window. Read-only. + readOnly: true + type: string + required: + - name + - query + - start_at + - end_at + type: object + MaintenanceWindowCreate: + description: Data object for creating a maintenance window. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowCreateAttributes" + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - type + - attributes + type: object + MaintenanceWindowCreateAttributes: + description: Attributes required to create a maintenance window. + properties: + end_at: + description: The end time of the maintenance window. + example: "2026-06-01T06:00:00Z" + format: date-time + type: string + name: + description: The name of the maintenance window. + example: "Weekly maintenance" + type: string + query: + description: The query to filter event management cases for this maintenance window. + example: "project:SEC" + type: string + start_at: + description: The start time of the maintenance window. + example: "2026-06-01T00:00:00Z" + format: date-time + type: string + required: + - name + - query + - start_at + - end_at + type: object + MaintenanceWindowCreateRequest: + description: Request payload for creating a maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindowCreate" + required: + - data + type: object + MaintenanceWindowResourceType: + default: maintenance_window + description: JSON:API resource type for maintenance windows. + enum: + - maintenance_window + example: maintenance_window + type: string + x-enum-varnames: + - MAINTENANCE_WINDOW + MaintenanceWindowResponse: + description: Response containing a single maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindow" + required: + - data + type: object + MaintenanceWindowUpdate: + description: Data object for updating a maintenance window. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowUpdateAttributes" + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - type + type: object + MaintenanceWindowUpdateAttributes: + description: Attributes that can be updated on a maintenance window. All fields are optional; only provided fields are changed. + properties: + end_at: + description: The end time of the maintenance window. + format: date-time + type: string + name: + description: The name of the maintenance window. + type: string + query: + description: The query to filter event management cases for this maintenance window. + type: string + start_at: + description: The start time of the maintenance window. + format: date-time + type: string + type: object + MaintenanceWindowUpdateRequest: + description: Request payload for updating a maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindowUpdate" + required: + - data + type: object + MaintenanceWindowsResponse: + description: Response containing a list of maintenance windows. + properties: + data: + description: List of maintenance windows. + items: + $ref: "#/components/schemas/MaintenanceWindow" + type: array + required: + - data + type: object ManagedOrgsData: description: The managed organizations resource. properties: @@ -45446,6 +50566,758 @@ components: maxLength: 255 type: string type: object + ModelLabArtifactInfo: + description: Information about a project-level artifact file. + properties: + artifact_path: + description: The full artifact path relative to the project's artifact root. + example: projects/1/artifacts/model.pkl + type: string + created_at: + description: The date and time the artifact was created. + example: "2024-01-20T10:00:00Z" + format: date-time + type: string + file_size: + description: The size of the file in bytes. + format: int64 + nullable: true + type: integer + filename: + description: The filename of the artifact. + example: model.pkl + type: string + required: + - filename + - artifact_path + - created_at + type: object + ModelLabArtifactObjectInfo: + description: Information about an artifact file or directory within a run. + properties: + file_size: + description: The size of the file in bytes. + format: int64 + nullable: true + type: integer + is_dir: + description: Whether this artifact entry is a directory. + example: false + type: boolean + path: + description: The path of the artifact relative to the run's artifact root. + example: model/weights.pt + type: string + required: + - path + - is_dir + type: object + ModelLabFacetKeysAttributes: + description: Available facet key names for filtering resources. + properties: + metrics: + description: The list of available metric facet keys. + example: + - accuracy + items: + type: string + nullable: true + type: array + parameters: + description: The list of available parameter facet keys. + example: + - learning_rate + items: + type: string + type: array + tags: + description: The list of available tag facet keys. + example: + - model + items: + type: string + type: array + required: + - parameters + - tags + - metrics + type: object + ModelLabFacetKeysData: + description: A facet keys JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabFacetKeysAttributes" + id: + description: The unique identifier of the facet keys resource. + example: "1" + type: string + type: + $ref: "#/components/schemas/ModelLabFacetKeysType" + required: + - id + - type + - attributes + type: object + ModelLabFacetKeysResponse: + description: Response containing available facet keys. + properties: + data: + $ref: "#/components/schemas/ModelLabFacetKeysData" + required: + - data + type: object + ModelLabFacetKeysType: + description: The JSON:API type for a facet keys resource. + enum: + - facet_keys + example: facet_keys + type: string + x-enum-varnames: + - FACET_KEYS + ModelLabFacetType: + description: The type of facet for filtering Model Lab runs. + enum: + - parameter + - attribute + - tag + - metric + example: tag + type: string + x-enum-varnames: + - PARAMETER + - ATTRIBUTE + - TAG + - METRIC + ModelLabFacetValuesAttributes: + description: Available values for a specific facet key. + properties: + facet_name: + description: The name of the facet. + example: model + type: string + facet_type: + description: The type of the facet. + example: tag + type: string + metric_stat_ranges: + description: The ranges for each metric statistic. + items: + $ref: "#/components/schemas/ModelLabMetricStatRange" + type: array + numeric_range: + $ref: "#/components/schemas/ModelLabNumericRange" + values: + description: The list of available string values for this facet. + example: + - gpt4 + items: + type: string + type: array + required: + - facet_type + - facet_name + - values + type: object + ModelLabFacetValuesData: + description: A facet values JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabFacetValuesAttributes" + id: + description: The unique identifier of the facet values resource. + example: "1" + type: string + type: + $ref: "#/components/schemas/ModelLabFacetValuesType" + required: + - id + - type + - attributes + type: object + ModelLabFacetValuesResponse: + description: Response containing available values for a facet key. + properties: + data: + $ref: "#/components/schemas/ModelLabFacetValuesData" + required: + - data + type: object + ModelLabFacetValuesType: + description: The JSON:API type for a facet values resource. + enum: + - facet_values + example: facet_values + type: string + x-enum-varnames: + - FACET_VALUES + ModelLabMetricStatRange: + description: The range of values for a specific metric statistic. + properties: + max: + description: The maximum value of the statistic. + example: 1.0 + format: double + type: number + min: + description: The minimum value of the statistic. + example: 0.0 + format: double + type: number + stat: + description: The metric statistic name. + example: mean + type: string + required: + - stat + - min + - max + type: object + ModelLabMetricSummary: + description: Summary statistics for a metric recorded during a Model Lab run. + properties: + count: + description: The total number of recorded values. + example: 100 + format: int64 + type: integer + first_step: + description: The first step at which the metric was recorded. + format: int64 + nullable: true + type: integer + key: + description: The metric name. + example: accuracy + type: string + last_step: + description: The last step at which the metric was recorded. + format: int64 + nullable: true + type: integer + latest: + description: The most recently recorded value. + format: double + nullable: true + type: number + max: + description: The maximum recorded value. + format: double + nullable: true + type: number + mean: + description: The mean of recorded values. + format: double + nullable: true + type: number + min: + description: The minimum recorded value. + format: double + nullable: true + type: number + stddev: + description: The standard deviation of recorded values. + format: double + nullable: true + type: number + required: + - key + - count + type: object + ModelLabNumericRange: + description: The numeric range of values for a facet. + properties: + max: + description: The maximum value. + example: 1.0 + format: double + type: number + min: + description: The minimum value. + example: 0.0 + format: double + type: number + required: + - min + - max + type: object + ModelLabPageMeta: + description: Pagination metadata for a list response. + properties: + page: + $ref: "#/components/schemas/ModelLabPageMetaPage" + required: + - page + type: object + ModelLabPageMetaPage: + description: Pagination details for a list response. + properties: + first_number: + description: The first page number. + format: int64 + type: integer + last_number: + description: The last page number. + format: int64 + type: integer + next_number: + description: The next page number. + format: int64 + nullable: true + type: integer + number: + description: The current page number. + example: 1 + format: int64 + type: integer + prev_number: + description: The previous page number. + format: int64 + nullable: true + type: integer + size: + description: The number of items per page. + example: 25 + format: int64 + type: integer + total: + description: The total number of items. + example: 100 + format: int64 + type: integer + type: + description: The pagination type. + type: string + required: + - number + - size + - total + type: object + ModelLabPaginationLinks: + description: Pagination links for navigating list responses. + properties: + first: + description: Link to the first page. + type: string + last: + description: Link to the last page. + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + type: string + type: object + ModelLabProjectArtifactsAttributes: + description: Artifact listing for a Model Lab project. + properties: + files: + description: The list of artifact files associated with the project. + items: + $ref: "#/components/schemas/ModelLabArtifactInfo" + type: array + required: + - files + type: object + ModelLabProjectArtifactsData: + description: A project artifacts JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabProjectArtifactsAttributes" + id: + description: The unique identifier of the project artifacts resource. + example: "1" + type: string + type: + $ref: "#/components/schemas/ModelLabProjectArtifactsType" + required: + - id + - type + - attributes + type: object + ModelLabProjectArtifactsResponse: + description: Response containing the artifact listing for a Model Lab project. + properties: + data: + $ref: "#/components/schemas/ModelLabProjectArtifactsData" + required: + - data + type: object + ModelLabProjectArtifactsType: + description: The JSON:API type for a project artifacts resource. + enum: + - project_files + example: project_files + type: string + x-enum-varnames: + - PROJECT_FILES + ModelLabProjectAttributes: + description: Attributes of a Model Lab project. + properties: + artifact_storage_location: + description: The storage location for project artifacts. + example: s3://bucket/active-project + type: string + created_at: + description: The date and time the project was created. + example: "2024-01-20T10:00:00Z" + format: date-time + type: string + deleted_at: + description: The date and time the project was soft-deleted. + format: date-time + nullable: true + type: string + description: + description: A description of the project. + example: A machine learning training project. + type: string + external_url: + description: An optional external URL associated with the project. + nullable: true + type: string + is_starred: + description: Whether the project is starred by the current user. + example: false + type: boolean + name: + description: The name of the project. + example: active-project + type: string + owner_id: + description: The UUID of the project owner. + nullable: true + type: string + tags: + description: The list of tags associated with the project. + items: + $ref: "#/components/schemas/ModelLabTag" + type: array + updated_at: + description: The date and time the project was last updated. + example: "2024-01-20T11:00:00Z" + format: date-time + type: string + required: + - name + - description + - artifact_storage_location + - created_at + - updated_at + - tags + - is_starred + type: object + ModelLabProjectData: + description: A Model Lab project JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabProjectAttributes" + id: + description: The unique identifier of the project. + example: "2" + type: string + type: + $ref: "#/components/schemas/ModelLabProjectType" + required: + - id + - type + - attributes + type: object + ModelLabProjectFacetType: + description: The type of facet for filtering Model Lab projects. + enum: + - tag + example: tag + type: string + x-enum-varnames: + - TAG + ModelLabProjectResponse: + description: Response containing a single Model Lab project. + properties: + data: + $ref: "#/components/schemas/ModelLabProjectData" + required: + - data + type: object + ModelLabProjectType: + description: The JSON:API type for a Model Lab project resource. + enum: + - projects + example: projects + type: string + x-enum-varnames: + - PROJECTS + ModelLabProjectsResponse: + description: Response containing a list of Model Lab projects with pagination metadata. + properties: + data: + description: The list of projects. + items: + $ref: "#/components/schemas/ModelLabProjectData" + type: array + links: + $ref: "#/components/schemas/ModelLabPaginationLinks" + meta: + $ref: "#/components/schemas/ModelLabPageMeta" + required: + - data + - meta + type: object + ModelLabRunArtifactsAttributes: + description: Artifact listing for a Model Lab run. + properties: + files: + description: The list of artifact files and directories. + items: + $ref: "#/components/schemas/ModelLabArtifactObjectInfo" + type: array + path_in_project: + description: The path of the run's artifacts relative to the project's artifact root. + example: runs/42 + type: string + required: + - path_in_project + - files + type: object + ModelLabRunArtifactsData: + description: A run artifacts JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabRunArtifactsAttributes" + id: + description: The unique identifier of the artifacts resource. + example: "42" + type: string + type: + $ref: "#/components/schemas/ModelLabRunArtifactsType" + required: + - id + - type + - attributes + type: object + ModelLabRunArtifactsResponse: + description: Response containing the artifact listing for a Model Lab run. + properties: + data: + $ref: "#/components/schemas/ModelLabRunArtifactsData" + required: + - data + type: object + ModelLabRunArtifactsType: + description: The JSON:API type for a run artifacts resource. + enum: + - artifacts + example: artifacts + type: string + x-enum-varnames: + - ARTIFACTS + ModelLabRunAttributes: + description: Attributes of a Model Lab run. + properties: + completed_at: + description: The date and time the run completed. + format: date-time + nullable: true + type: string + created_at: + description: The date and time the run was created. + example: "2024-01-20T10:00:00Z" + format: date-time + type: string + deleted_at: + description: The date and time the run was soft-deleted. + format: date-time + nullable: true + type: string + descendant_match: + description: Whether a descendant run matched the applied filters. + example: false + type: boolean + description: + description: A description of the run. + example: Fine-tuning run with custom hyperparameters. + type: string + duration: + description: The duration of the run in seconds. + format: double + nullable: true + type: number + external_url: + description: An optional external URL associated with the run. + nullable: true + type: string + has_children: + description: Whether the run has child runs. + example: false + type: boolean + is_pinned: + description: Whether the run is pinned by the current user. + example: false + type: boolean + metric_summaries: + description: Summary statistics for metrics recorded during the run. + items: + $ref: "#/components/schemas/ModelLabMetricSummary" + type: array + mlflow_artifact_location: + description: The MLflow artifact storage location for this run. + example: s3://bucket/active-run + type: string + name: + description: The name of the run. + example: training-run-1 + type: string + owner_id: + description: The UUID of the run owner. + nullable: true + type: string + params: + description: The list of parameters used for the run. + items: + $ref: "#/components/schemas/ModelLabRunParam" + nullable: true + type: array + project_id: + description: The ID of the project this run belongs to. + example: 101 + format: int64 + type: integer + started_at: + description: The date and time the run started. + example: "2024-01-20T10:00:00Z" + format: date-time + type: string + status: + $ref: "#/components/schemas/ModelLabRunStatus" + tags: + description: The list of tags associated with the run. + items: + $ref: "#/components/schemas/ModelLabTag" + type: array + updated_at: + description: The date and time the run was last updated. + example: "2024-01-20T11:00:00Z" + format: date-time + type: string + required: + - project_id + - name + - description + - status + - mlflow_artifact_location + - started_at + - created_at + - updated_at + - tags + - params + - metric_summaries + - is_pinned + - has_children + - descendant_match + type: object + ModelLabRunData: + description: A Model Lab run JSON:API resource object. + properties: + attributes: + $ref: "#/components/schemas/ModelLabRunAttributes" + id: + description: The unique identifier of the run. + example: "42" + type: string + type: + $ref: "#/components/schemas/ModelLabRunType" + required: + - id + - type + - attributes + type: object + ModelLabRunParam: + description: A key-value parameter for a Model Lab run. + properties: + key: + description: The parameter key. + example: algorithm + type: string + value: + description: The parameter value. + example: gpt4 + type: string + required: + - key + - value + type: object + ModelLabRunResponse: + description: Response containing a single Model Lab run. + properties: + data: + $ref: "#/components/schemas/ModelLabRunData" + required: + - data + type: object + ModelLabRunStatus: + description: The status of a Model Lab run. + enum: + - pending + - running + - completed + - failed + - killed + - unresponsive + - paused + example: running + type: string + x-enum-varnames: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - KILLED + - UNRESPONSIVE + - PAUSED + ModelLabRunType: + description: The JSON:API type for a Model Lab run resource. + enum: + - runs + example: runs + type: string + x-enum-varnames: + - RUNS + ModelLabRunsResponse: + description: Response containing a list of Model Lab runs with pagination metadata. + properties: + data: + description: The list of runs. + items: + $ref: "#/components/schemas/ModelLabRunData" + type: array + links: + $ref: "#/components/schemas/ModelLabPaginationLinks" + meta: + $ref: "#/components/schemas/ModelLabPageMeta" + required: + - data + - meta + type: object + ModelLabTag: + description: A key-value tag attached to a resource. + properties: + key: + description: The tag key. + example: model + type: string + value: + description: The tag value. + example: opus + type: string + required: + - key + - value + type: object MonitorAlertTriggerAttributes: description: Attributes for a monitor alert trigger. properties: @@ -47334,6 +53206,8 @@ components: description: S3 bucket name. example: "my-bucket" type: string + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" compression: $ref: "#/components/schemas/ObservabilityPipelineAmazonS3GenericCompression" encoding: @@ -47583,6 +53457,8 @@ components: **Supported pipeline types:** logs properties: + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" endpoint_url_key: description: Name of the environment variable or secret that holds the CloudPrem endpoint URL. example: CLOUDPREM_ENDPOINT_URL @@ -47989,9 +53865,9 @@ components: description: The unique identifier for this component. example: databricks-zerobus-destination type: string - ingestion_endpoint: - description: Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse. - example: https://my-workspace-id.zerobus.us-east-1.cloud.databricks.com + ingestion_endpoint_key: + description: Name of the environment variable or the secret identifier that references the Databricks Zerobus ingestion endpoint, which is used to stream data directly into your Databricks Lakehouse. + example: DD_OP_DESTINATION_DATABRICKS_ZEROBUS_INGESTION_ENDPOINT type: string inputs: description: A list of component IDs whose output is used as the `input` for this component. @@ -48006,17 +53882,15 @@ components: type: string type: $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestinationType" - unity_catalog_endpoint: - description: Your Databricks workspace URL. This is used to communicate with the Unity Catalog API. - example: https://my-workspace.cloud.databricks.com + unity_catalog_endpoint_key: + description: Name of the environment variable or the secret identifier that references your Databricks workspace URL, which is used to communicate with the Unity Catalog API. + example: DD_OP_DESTINATION_DATABRICKS_ZEROBUS_UNITY_CATALOG_ENDPOINT type: string required: - id - type - inputs - - ingestion_endpoint - table_name - - unity_catalog_endpoint - auth type: object x-pipeline-types: [logs, rehydration] @@ -48785,7 +54659,7 @@ components: example: "fluent-source" type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineFluentBitSourceType" required: @@ -48817,7 +54691,7 @@ components: example: "fluent-source" type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineFluentdSourceType" required: @@ -49235,6 +55109,8 @@ components: properties: auth_strategy: $ref: "#/components/schemas/ObservabilityPipelineHttpClientDestinationAuthStrategy" + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" compression: $ref: "#/components/schemas/ObservabilityPipelineHttpClientDestinationCompression" custom_key: @@ -49418,13 +55294,23 @@ components: example: HTTP_AUTH_PASSWORD type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceType" username_key: description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`). example: HTTP_AUTH_USERNAME type: string + valid_tokens: + description: |- + A list of tokens that are accepted for authenticating incoming HTTP requests. When set, + the source rejects any request whose token does not match an enabled entry in this list. + Cannot be combined with the `plain` auth strategy. + items: + $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken" + maxItems: 1000 + minItems: 1 + type: array required: - id - type @@ -49450,6 +55336,55 @@ components: type: string x-enum-varnames: - HTTP_SERVER + ObservabilityPipelineHttpServerSourceValidToken: + description: An accepted token used to authenticate incoming HTTP server requests. + properties: + enabled: + default: true + description: |- + Indicates whether this token is currently accepted. Disabled tokens are rejected without + being removed from the configuration. + example: true + type: boolean + field_to_add: + $ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd" + path_to_token: + $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken" + token_key: + description: Name of the environment variable or secret that holds the expected token value. + example: HTTP_SERVER_TOKEN + pattern: "^[A-Za-z0-9_]+$" + type: string + required: + - token_key + type: object + ObservabilityPipelineHttpServerSourceValidTokenPathToToken: + description: |- + Specifies where the worker extracts the token from in the incoming HTTP request. + This can be either a built-in location (`path` or `address`) or an HTTP header object. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation" + - $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader" + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader: + description: Extract the token from a specific HTTP request header. + properties: + header: + description: The name of the HTTP header that carries the token. + example: X-Token + type: string + required: + - header + type: object + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation: + description: Built-in token location on the incoming HTTP request. + enum: + - path + - address + example: path + type: string + x-enum-varnames: + - PATH + - ADDRESS ObservabilityPipelineKafkaDestination: description: |- The `kafka` destination sends logs to Apache Kafka topics. @@ -49460,6 +55395,8 @@ components: description: Name of the environment variable or secret that holds the Kafka bootstrap servers list. example: KAFKA_BOOTSTRAP_SERVERS type: string + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" compression: $ref: "#/components/schemas/ObservabilityPipelineKafkaDestinationCompression" encoding: @@ -49673,7 +55610,7 @@ components: example: logstash-source type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineLogstashSourceType" required: @@ -49824,6 +55761,29 @@ components: oneOf: - $ref: "#/components/schemas/ObservabilityPipelineGeneratedMetricIncrementByOne" - $ref: "#/components/schemas/ObservabilityPipelineGeneratedMetricIncrementByField" + ObservabilityPipelineMtlsServerTls: + description: Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + properties: + ca_file: + description: Path to the Certificate Authority (CA) file used to validate connecting clients' TLS certificates. + type: string + crt_file: + description: Path to the TLS server certificate file used to used to identify the pipeline component to connecting clients. + example: "/path/to/cert.crt" + type: string + key_file: + description: Path to the private key file associated with the TLS server certificate. + type: string + key_pass_key: + description: Name of the environment variable or secret that holds the passphrase for the private key file. + example: TLS_KEY_PASSPHRASE + type: string + verify_certificate: + description: When `true`, requires client connections to present a valid certificate, enabling mutual TLS authentication. + type: boolean + required: + - crt_file + type: object ObservabilityPipelineNewRelicDestination: description: |- The `new_relic` destination sends logs to the New Relic platform. @@ -50163,7 +56123,7 @@ components: example: opentelemetry-source type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineOpentelemetrySourceType" required: @@ -50791,7 +56751,7 @@ components: mode: $ref: "#/components/schemas/ObservabilityPipelineSyslogSourceMode" tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineRsyslogSourceType" required: @@ -51362,7 +57322,7 @@ components: mode: $ref: "#/components/schemas/ObservabilityPipelineSocketSourceMode" tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" description: TLS configuration. Relevant only when `mode` is `tcp`. type: $ref: "#/components/schemas/ObservabilityPipelineSocketSourceType" @@ -51473,6 +57433,27 @@ components: type: string x-enum-varnames: - SOCKET + ObservabilityPipelineSourceValidTokenFieldToAdd: + description: |- + An optional metadata field that is attached to every event authenticated by the + associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`. + properties: + key: + description: The metadata field name to add to incoming events. + example: token_name + maxLength: 256 + pattern: "^[A-Za-z0-9_]+$" + type: string + value: + description: The metadata field value to add to incoming events. + example: my_token + maxLength: 1024 + pattern: "^[A-Za-z0-9_]+$" + type: string + required: + - key + - value + type: object ObservabilityPipelineSpec: description: Input schema representing an observability pipeline configuration. Used in create and validate requests. properties: @@ -51666,9 +57647,18 @@ components: example: true type: boolean tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType" + valid_tokens: + description: |- + A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source + rejects any request whose HEC token does not match an enabled entry in this list. + items: + $ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken" + maxItems: 1000 + minItems: 1 + type: array required: - id - type @@ -51683,6 +57673,26 @@ components: type: string x-enum-varnames: - SPLUNK_HEC + ObservabilityPipelineSplunkHecSourceValidToken: + description: An accepted HEC token used to authenticate incoming Splunk HEC requests. + properties: + enabled: + default: true + description: |- + Indicates whether this token is currently accepted. Disabled tokens are rejected without + being removed from the configuration. + example: true + type: boolean + field_to_add: + $ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd" + token_key: + description: Name of the environment variable or secret that holds the expected HEC token value. + example: SPLUNK_HEC_TOKEN + pattern: "^[A-Za-z0-9_]+$" + type: string + required: + - token_key + type: object ObservabilityPipelineSplunkTcpSource: description: |- The `splunk_tcp` source receives logs from a Splunk Universal Forwarder over TCP. @@ -51699,7 +57709,7 @@ components: example: splunk-tcp-source type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineSplunkTcpSourceType" required: @@ -51893,7 +57903,7 @@ components: mode: $ref: "#/components/schemas/ObservabilityPipelineSyslogSourceMode" tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineMtlsServerTls" type: $ref: "#/components/schemas/ObservabilityPipelineSyslogNgSourceType" required: @@ -57002,6 +63012,39 @@ components: required: - data type: object + ProjectFavorite: + description: Represents a case project that the current user has bookmarked for quick access. Favorited projects appear prominently in the Case Management UI. + properties: + id: + description: The UUID of the favorited project. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + type: string + type: + $ref: "#/components/schemas/ProjectFavoriteResourceType" + required: + - id + - type + type: object + ProjectFavoriteResourceType: + default: project_favorite + description: "JSON:API resource type for project favorites." + enum: + - project_favorite + example: project_favorite + type: string + x-enum-varnames: + - PROJECT_FAVORITE + ProjectFavoritesResponse: + description: Response containing the list of projects the current user has favorited. + properties: + data: + description: List of project favorites. + items: + $ref: "#/components/schemas/ProjectFavorite" + type: array + required: + - data + type: object ProjectNotificationSettings: description: Project notification settings. properties: @@ -57214,6 +63257,15 @@ components: data: $ref: "#/components/schemas/Deployment" type: object + PublishRequestType: + default: publishRequest + description: The publish-request resource type. + enum: + - publishRequest + example: publishRequest + type: string + x-enum-varnames: + - PUBLISHREQUEST PutAppsDatastoreItemResponseArray: description: Response after successfully inserting multiple items into a datastore, containing the identifiers of the created items. properties: @@ -58459,6 +64511,64 @@ components: type: string x-enum-varnames: - RECOMMENDATION + RecommendationsFilterRequest: + description: Request body for filtering cost recommendations. + example: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + properties: + filter: + description: Filter expression applied to the recommendations. + type: string + scope: + description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + type: string + sort: + description: Ordered list of sort clauses applied to the result set. + items: + $ref: "#/components/schemas/RecommendationsFilterRequestSortItems" + type: array + view: + description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + type: string + type: object + RecommendationsFilterRequestSortItems: + description: A single sort clause applied to the cost recommendations result set. + properties: + expression: + description: Field to sort by (for example, `potential_daily_savings.amount`). + type: string + order: + description: Sort direction, either `ASC` or `DESC`. + type: string + type: object + RecommendationsPageMeta: + description: Top-level JSON:API meta object for paginated cost recommendation responses. + properties: + page: + $ref: "#/components/schemas/RecommendationsPageMetaPage" + type: object + RecommendationsPageMetaPage: + description: Pagination metadata for a page of cost recommendations. + properties: + filter: + description: The filter expression that was applied to produce this page. + type: string + next_page_token: + description: Opaque token used to fetch the next page; absent on the last page. + type: string + page_size: + description: Number of items returned in this page (1–10000). + format: int32 + maximum: 10000 + minimum: 1 + type: integer + page_token: + description: Pagination token echoed back from the request. + type: string + type: object ReferenceTableCreateSourceType: description: The source type for creating reference table data. Only these source types can be created through this API. enum: @@ -60504,6 +66614,7 @@ components: - $ref: "#/components/schemas/SendSlackMessageAction" - $ref: "#/components/schemas/SendTeamsMessageAction" - $ref: "#/components/schemas/TriggerWorkflowAutomationAction" + - $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction" RoutingRuleAttributes: description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency. properties: @@ -60521,6 +66632,52 @@ components: urgency: $ref: "#/components/schemas/Urgency" type: object + RoutingRuleEscalationPolicyAction: + description: "Triggers an escalation policy." + properties: + ack_timeout_minutes: + description: "The number of minutes before an acknowledged page is re-triggered." + example: 30 + format: int64 + type: integer + policy_id: + description: "The ID of the escalation policy to route to." + example: "00000000-0000-0000-0000-000000000000" + type: string + support_hours: + $ref: "#/components/schemas/RoutingRuleEscalationPolicyActionSupportHours" + type: + $ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType" + urgency: + $ref: "#/components/schemas/Urgency" + required: + - type + - policy_id + type: object + RoutingRuleEscalationPolicyActionSupportHours: + description: "Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule." + properties: + restrictions: + description: "The list of support hours time windows." + items: + $ref: "#/components/schemas/TimeRestriction" + type: array + time_zone: + description: "The time zone in which the support hours are expressed." + example: "" + type: string + required: + - time_zone + type: object + RoutingRuleEscalationPolicyActionType: + default: escalation_policy + description: "Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule." + enum: + - escalation_policy + example: escalation_policy + type: string + x-enum-varnames: + - ESCALATION_POLICY RoutingRuleRelationships: description: Specifies relationships for a routing rule, linking to associated policy resources. properties: @@ -60636,6 +66793,194 @@ components: example: Deployments automated via Deployment Trains type: string type: object + RuleBasedViewAttributes: + description: Attributes of the rule-based view. + properties: + count: + description: Total number of rules in the view. + example: 1 + format: int64 + type: integer + rules: + $ref: "#/components/schemas/RuleBasedViewRules" + required: + - count + - rules + type: object + RuleBasedViewComplianceFramework: + description: Compliance framework mapping for a rule. + properties: + control: + description: Identifier of the control inside the requirement. + example: 164.308-a-4-i + type: string + framework: + description: Handle of the compliance framework. + example: hipaa + type: string + is_default: + description: Whether the framework is a Datadog default framework. `true` indicates a Datadog framework and `false` indicates a custom framework. + example: true + type: boolean + message: + description: Optional message describing the framework mapping for the rule. + example: "" + type: string + requirement: + description: Name of the requirement that contains the control. + example: Information-Access-Management + type: string + version: + description: Version of the compliance framework. + example: "1" + type: string + type: object + RuleBasedViewComplianceFrameworks: + description: List of compliance framework mappings associated with the rule. + items: + $ref: "#/components/schemas/RuleBasedViewComplianceFramework" + type: array + RuleBasedViewData: + description: Data envelope for the rule-based view response. + properties: + attributes: + $ref: "#/components/schemas/RuleBasedViewAttributes" + id: + description: Unique identifier of the rule-based view document. + example: JSONAPI_USELESS_ID + type: string + type: + $ref: "#/components/schemas/RuleBasedViewType" + required: + - attributes + - id + - type + type: object + RuleBasedViewResourceAttributes: + description: List of resource attribute names exposed by the rule. + example: + - instance_id + items: + description: Name of a resource attribute exposed by the rule. + example: instance_id + type: string + type: array + RuleBasedViewResponse: + description: Response containing an aggregated view of compliance rules with their finding statistics. + properties: + data: + $ref: "#/components/schemas/RuleBasedViewData" + required: + - data + type: object + RuleBasedViewRule: + description: A compliance rule along with its evaluation statistics and framework mappings. + properties: + compliance_frameworks: + $ref: "#/components/schemas/RuleBasedViewComplianceFrameworks" + enabled: + description: Whether the rule is enabled. + example: true + type: boolean + id: + description: Unique identifier of the rule. + example: qjx-udx-xo8 + type: string + name: + description: Human-readable name of the rule. + example: IAM roles should not allow untrusted GitHub Actions to assume them + type: string + resourceAttributes: + $ref: "#/components/schemas/RuleBasedViewResourceAttributes" + resourceCategory: + description: Resource category targeted by the rule. + example: identity + type: string + resourceType: + description: Resource type targeted by the rule. + example: aws_iam_role + type: string + stats: + $ref: "#/components/schemas/RuleBasedViewRuleStats" + status: + description: Severity associated with the rule (for example, `info`, `low`, `medium`, `high`, or `critical`). + example: critical + type: string + tags: + $ref: "#/components/schemas/RuleBasedViewRuleTags" + type: + $ref: "#/components/schemas/RuleBasedViewRuleCategory" + required: + - compliance_frameworks + - enabled + - id + - name + - resourceAttributes + - resourceCategory + - resourceType + - stats + - status + - tags + - type + type: object + RuleBasedViewRuleCategory: + description: The category of the security rule. + enum: + - cloud_configuration + - infrastructure_configuration + - api_security + example: cloud_configuration + type: string + x-enum-varnames: + - CLOUD_CONFIGURATION + - INFRASTRUCTURE_CONFIGURATION + - API_SECURITY + RuleBasedViewRuleStats: + description: Counts of findings for the rule, grouped by their evaluation status. + properties: + fail: + description: Number of findings that failed evaluation. + example: 0 + format: int64 + type: integer + muted: + description: Number of findings that have been muted. + example: 0 + format: int64 + type: integer + pass: + description: Number of findings that passed evaluation. + example: 3 + format: int64 + type: integer + required: + - fail + - pass + - muted + type: object + RuleBasedViewRuleTags: + description: List of tags attached to the rule. + example: + - security:compliance + items: + description: A tag attached to the rule. + example: security:compliance + type: string + type: array + RuleBasedViewRules: + description: List of rules in the rule-based view. + items: + $ref: "#/components/schemas/RuleBasedViewRule" + type: array + RuleBasedViewType: + default: rule_based_view + description: The type of the resource. The value should always be `rule_based_view`. + enum: + - rule_based_view + example: rule_based_view + type: string + x-enum-varnames: + - RULE_BASED_VIEW RuleId: description: The unique ID for a scorecard rule. example: q8MQxk8TCqrHnWkx @@ -62153,6 +68498,272 @@ components: example: "report_id" type: string type: object + SampleLogGenerationBulkSubscriptionAttributes: + description: The attributes for creating sample log generation subscriptions for multiple content packs. + properties: + content_pack_ids: + description: The identifiers of the Cloud SIEM content packs to subscribe to. At most five content packs can be requested in a single call. + example: + - aws-cloudtrail + items: + description: A Cloud SIEM content pack identifier. + type: string + maxItems: 5 + type: array + duration: + $ref: "#/components/schemas/SampleLogGenerationDuration" + required: + - content_pack_ids + type: object + SampleLogGenerationBulkSubscriptionData: + description: The bulk subscription request body. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionAttributes" + type: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionRequestType" + required: + - type + - attributes + type: object + SampleLogGenerationBulkSubscriptionItemMeta: + description: Per-item status returned for a bulk subscription request. + properties: + error: + description: A description of the error encountered for this content pack, if the subscription could not be created. + example: content pack does not exist + type: string + status: + description: The HTTP status code that resulted from creating the subscription for this content pack. + example: 200 + format: int32 + maximum: 599 + type: integer + required: + - status + type: object + SampleLogGenerationBulkSubscriptionRequest: + description: Request body to create sample log generation subscriptions for multiple content packs at once. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionData" + required: + - data + type: object + SampleLogGenerationBulkSubscriptionRequestType: + default: bulk_subscription_requests + description: The type of the resource. The value should always be `bulk_subscription_requests`. + enum: + - bulk_subscription_requests + example: bulk_subscription_requests + type: string + x-enum-varnames: + - BULK_SUBSCRIPTION_REQUESTS + SampleLogGenerationBulkSubscriptionResponse: + description: Response containing the per-content-pack results of a bulk subscription request. + properties: + data: + description: The list of bulk subscription results, one per requested content pack. + items: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionResultItem" + type: array + required: + - data + type: object + SampleLogGenerationBulkSubscriptionResultItem: + description: A single result entry returned by the bulk subscription endpoint. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionAttributes" + id: + description: The unique identifier of the subscription, when one was created. + example: "123" + type: string + meta: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionItemMeta" + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResourceType" + required: + - id + - type + - attributes + - meta + type: object + SampleLogGenerationDuration: + default: 3d + description: How long the subscription should remain active before expiring. + enum: + - 1h + - 1d + - 3d + - 7d + example: 3d + type: string + x-enum-varnames: + - ONE_HOUR + - ONE_DAY + - THREE_DAYS + - SEVEN_DAYS + SampleLogGenerationSubscriptionAttributes: + description: The attributes describing a sample log generation subscription. + properties: + content_pack_id: + description: The identifier of the Cloud SIEM content pack the subscription targets. + example: aws-cloudtrail + type: string + created_at: + description: The time at which the subscription was created. + example: "2026-05-08T20:02:13.77481Z" + format: date-time + type: string + expires_at: + description: The time at which the subscription expires and stops generating logs. + example: "2026-05-11T20:02:13.77481Z" + format: date-time + type: string + is_active: + description: Whether the subscription is currently active and generating logs. + example: true + type: boolean + status: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionStatus" + required: + - content_pack_id + - status + - is_active + - created_at + - expires_at + type: object + SampleLogGenerationSubscriptionCreateAttributes: + description: The attributes for creating a sample log generation subscription. + properties: + content_pack_id: + description: The identifier of the Cloud SIEM content pack to subscribe to. + example: aws-cloudtrail + type: string + duration: + $ref: "#/components/schemas/SampleLogGenerationDuration" + required: + - content_pack_id + type: object + SampleLogGenerationSubscriptionCreateData: + description: The subscription request body. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateAttributes" + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionRequestType" + required: + - type + - attributes + type: object + SampleLogGenerationSubscriptionCreateRequest: + description: Request body to create a sample log generation subscription for a single content pack. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateData" + required: + - data + type: object + SampleLogGenerationSubscriptionData: + description: A sample log generation subscription. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionAttributes" + id: + description: The unique identifier of the subscription. + example: "789" + type: string + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResourceType" + required: + - id + - type + - attributes + type: object + SampleLogGenerationSubscriptionRequestType: + default: subscription_requests + description: The type of the resource. The value should always be `subscription_requests`. + enum: + - subscription_requests + example: subscription_requests + type: string + x-enum-varnames: + - SUBSCRIPTION_REQUESTS + SampleLogGenerationSubscriptionResourceType: + default: subscriptions + description: The type of the resource. The value should always be `subscriptions`. + enum: + - subscriptions + example: subscriptions + type: string + x-enum-varnames: + - SUBSCRIPTIONS + SampleLogGenerationSubscriptionResponse: + description: Response containing a single sample log generation subscription. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionData" + required: + - data + type: object + SampleLogGenerationSubscriptionStatus: + description: The status of the subscription. + enum: + - subscribed + - renewed + - unsubscribed + - no_active_subscription + - not_available + - active + - expired + example: subscribed + type: string + x-enum-varnames: + - SUBSCRIBED + - RENEWED + - UNSUBSCRIBED + - NO_ACTIVE_SUBSCRIPTION + - NOT_AVAILABLE + - ACTIVE + - EXPIRED + SampleLogGenerationSubscriptionsResponse: + description: Response containing a list of sample log generation subscriptions. + properties: + data: + description: The list of sample log generation subscriptions. + items: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionData" + type: array + meta: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsResponseMeta" + required: + - data + - meta + type: object + SampleLogGenerationSubscriptionsResponseMeta: + description: Metadata returned alongside a list of sample log generation subscriptions. + properties: + total_subscriptions: + description: The total number of subscriptions matching the request, irrespective of pagination. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - total_subscriptions + type: object + SampleLogGenerationSubscriptionsStatusFilter: + default: active + description: Filter that controls whether to return only active subscriptions or every subscription on record. + enum: + - active + - all + example: active + type: string + x-enum-varnames: + - ACTIVE + - ALL ScaRequest: description: The top-level request object for submitting a Software Composition Analysis (SCA) scan result. properties: @@ -63253,6 +69864,119 @@ components: type: string x-enum-varnames: - SCORECARD + ScorecardScoreAttributes: + description: Attributes of a scorecard score. + properties: + aggregation: + $ref: "#/components/schemas/ScorecardScoresAggregation" + denominator: + description: The denominator used to compute the score ratio. + format: int64 + type: integer + level: + description: The maturity level of the associated rule. + format: int64 + type: integer + numerator: + description: The numerator used to compute the score ratio. + format: int64 + type: integer + score: + description: The computed score ratio (numerator/denominator), from 0 to 1. + format: double + type: number + total_entities: + description: The total number of entities evaluated. + format: int64 + type: integer + total_fail: + description: The number of rules that failed. + format: int64 + type: integer + total_no_data: + description: The number of rules with no data. + format: int64 + type: integer + total_pass: + description: The number of rules that passed. + format: int64 + type: integer + total_skip: + description: The number of rules that were skipped. + format: int64 + type: integer + type: object + ScorecardScoreData: + description: A scorecard score object for a single entity, rule, scorecard, service, or team. + properties: + attributes: + $ref: "#/components/schemas/ScorecardScoreAttributes" + id: + description: The ID of the entity or resource being scored. + example: "" + type: string + relationships: + $ref: "#/components/schemas/ScorecardScoreRelationships" + type: + $ref: "#/components/schemas/ScorecardScoreDataType" + required: + - id + - type + type: object + ScorecardScoreDataType: + default: score + description: The JSON:API resource type. + enum: [score] + example: score + type: string + x-enum-varnames: + - SCORE + ScorecardScoreRelationshipData: + description: A relationship data object for a score. + properties: + id: + description: The ID of the related resource. + example: "" + type: string + type: + description: The type of the related resource. + example: "" + type: string + required: + - id + - type + type: object + ScorecardScoreRelationshipItem: + description: A relationship item for a score. + properties: + data: + $ref: "#/components/schemas/ScorecardScoreRelationshipData" + type: object + ScorecardScoreRelationships: + description: Relationships for a scorecard score, depending on the aggregation type. + properties: + entity: + $ref: "#/components/schemas/ScorecardScoreRelationshipItem" + rule: + $ref: "#/components/schemas/ScorecardScoreRelationshipItem" + scorecard: + $ref: "#/components/schemas/ScorecardScoreRelationshipItem" + service: + $ref: "#/components/schemas/ScorecardScoreRelationshipItem" + team: + $ref: "#/components/schemas/ScorecardScoreRelationshipItem" + type: object + ScorecardScoresAggregation: + description: Dimension to group scores by. + enum: [by-entity, by-rule, by-scorecard, by-team, by-kind] + example: by-entity + type: string + x-enum-varnames: + - BY_ENTITY + - BY_RULE + - BY_SCORECARD + - BY_TEAM + - BY_KIND ScorecardType: default: scorecard description: The JSON:API type for scorecard. @@ -64420,6 +71144,112 @@ components: required: - data type: object + SecurityFilterVersion: + description: A snapshot of all security filters at a specific configuration version. + properties: + attributes: + $ref: "#/components/schemas/SecurityFilterVersionAttributes" + id: + description: The identifier of the configuration version. + example: "1" + type: string + type: + $ref: "#/components/schemas/SecurityFilterVersionType" + required: + - id + - type + - attributes + type: object + SecurityFilterVersionAttributes: + description: The attributes describing a single security filter configuration version. + properties: + date: + description: The Unix timestamp in milliseconds at which this configuration version was applied. + example: 1758177253469 + format: int64 + type: integer + filters: + description: The set of security filters at this configuration version. + items: + $ref: "#/components/schemas/SecurityFilterVersionEntry" + type: array + version: + description: The configuration version number. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - version + - date + - filters + type: object + SecurityFilterVersionEntry: + description: A single security filter as it existed at a given configuration version. + properties: + exclusion_filters: + description: The list of exclusion filters applied in this security filter. + items: + $ref: "#/components/schemas/SecurityFilterExclusionFilterResponse" + type: array + filtered_data_type: + $ref: "#/components/schemas/SecurityFilterFilteredDataType" + id: + description: The ID of the security filter. + example: "123" + type: string + is_builtin: + description: Whether the security filter is the built-in filter. + example: false + type: boolean + is_enabled: + description: Whether the security filter is enabled. + example: true + type: boolean + name: + description: The name of the security filter. + example: Test Security Filter + type: string + query: + description: The query of the security filter. + example: source:test + type: string + version: + description: The version of this security filter. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - id + - name + - version + - query + - is_enabled + - exclusion_filters + - filtered_data_type + - is_builtin + type: object + SecurityFilterVersionType: + default: security_filters_configuration + description: The type of the resource. The value should always be `security_filters_configuration`. + enum: + - security_filters_configuration + example: security_filters_configuration + type: string + x-enum-varnames: + - SECURITY_FILTERS_CONFIGURATION + SecurityFilterVersionsResponse: + description: Response containing the version history of security filters. + properties: + data: + description: A list of historical security filter configurations, ordered from the most recent to the oldest. + items: + $ref: "#/components/schemas/SecurityFilterVersion" + type: array + required: + - data + type: object SecurityFiltersResponse: description: All the available security filters objects. properties: @@ -64956,6 +71786,13 @@ components: $ref: "#/components/schemas/SecurityMonitoringCriticalAsset" type: array type: object + SecurityMonitoringEntityContextEntityType: + default: entity + description: |- + The type of the entity. Reflects the underlying entity kind from the entity context store + (for example, `siem_entity_identity` for identities). Defaults to `entity` when the kind is unknown. + example: siem_entity_identity + type: string SecurityMonitoringFilter: description: The rule's suppression filter. properties: @@ -64974,6 +71811,240 @@ components: x-enum-varnames: - REQUIRE - SUPPRESS + SecurityMonitoringIntegrationConfigAttributes: + description: The attributes of an entity context sync configuration as returned by the API. + properties: + created_at: + description: The time at which the entity context sync configuration was created. + example: "2026-05-01T12:00:00Z" + format: date-time + type: string + domain: + description: The domain associated with the external entity source (for example, the customer's identity provider domain). + example: siem-test.com + type: string + enabled: + description: Whether the sync is enabled and actively ingesting entities into Cloud SIEM. + example: true + type: boolean + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + modified_at: + description: The time at which the entity context sync configuration was last modified. + example: "2026-05-01T12:00:00Z" + format: date-time + type: string + name: + description: The display name of the entity context sync configuration. + example: My GWS Integration + type: string + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + state: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigState" + required: + - enabled + - domain + - integration_type + type: object + SecurityMonitoringIntegrationConfigCreateAttributes: + description: The attributes of the entity context sync configuration to create. + properties: + domain: + description: The domain associated with the external entity source. + example: siem-test.com + type: string + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + name: + description: The display name for the entity context sync configuration. + example: My GWS Integration + type: string + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + required: + - integration_type + - domain + - name + - secrets + type: object + SecurityMonitoringIntegrationConfigCreateData: + description: The entity context sync configuration to create. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigCreateRequest: + description: Request body to create an entity context sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigData: + description: An entity context sync configuration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigAttributes" + id: + description: The unique identifier of the integration configuration. + example: 11111111-2222-3333-4444-555555555555 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigResourceType: + default: integration_config + description: The type of the resource. The value should always be `integration_config`. + enum: + - integration_config + example: integration_config + type: string + x-enum-varnames: + - INTEGRATION_CONFIG + SecurityMonitoringIntegrationConfigResponse: + description: Response containing a single entity context sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigSecrets: + additionalProperties: {} + description: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + example: + admin_email: test@example.com + type: object + SecurityMonitoringIntegrationConfigSettings: + additionalProperties: {} + description: Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + example: + setting1: value1 + type: object + SecurityMonitoringIntegrationConfigState: + description: The state of the credentials configured on the entity context sync. + enum: + - valid + - invalid + - initializing + example: valid + type: string + x-enum-varnames: + - VALID + - INVALID + - INITIALIZING + SecurityMonitoringIntegrationConfigUpdateAttributes: + description: Fields to update on the entity context sync configuration. All fields are optional. + properties: + domain: + description: The new domain associated with the external entity source. + example: siem-test.com + type: string + enabled: + description: Whether the entity context sync should be enabled. + example: true + type: boolean + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + name: + description: The new display name for the entity context sync configuration. + example: My GWS Integration (renamed) + type: string + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + type: object + SecurityMonitoringIntegrationConfigUpdateData: + description: The entity context sync configuration fields to update. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigUpdateRequest: + description: Request body to update an entity context sync configuration. Supports partial updates. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigsResponse: + description: Response containing a list of entity context sync configurations. + properties: + data: + description: The list of integration configurations. + items: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigData" + type: array + required: + - data + type: object + SecurityMonitoringIntegrationCredentialsValidateAttributes: + description: The credentials to validate against the external entity source. + properties: + domain: + description: The domain associated with the external entity source. + example: siem-test.com + type: string + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + required: + - integration_type + - domain + - secrets + type: object + SecurityMonitoringIntegrationCredentialsValidateData: + description: The credentials to validate. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationCredentialsValidateRequest: + description: Request body to validate credentials against an external entity source before creating a sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateData" + required: + - data + type: object + SecurityMonitoringIntegrationType: + description: The type of external source that provides entities to Cloud SIEM. + enum: + - GOOGLE_WORKSPACE + - OKTA + - ENTRA_ID + example: GOOGLE_WORKSPACE + type: string + x-enum-varnames: + - GOOGLE_WORKSPACE + - OKTA + - ENTRA_ID SecurityMonitoringListRulesResponse: description: List of rules. properties: @@ -65380,11 +72451,20 @@ components: properties: baselineUserLocations: $ref: "#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations" + baselineUserLocationsDuration: + $ref: "#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocationsDuration" type: object SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations: description: "If true, signals are suppressed for the first 24 hours. In that time, Datadog learns the user's regular\naccess locations. This can be helpful to reduce noise and infer VPN usage or credentialed API access." example: true type: boolean + SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocationsDuration: + description: The duration in days during which Datadog learns the user's regular access locations. After this period, signals are generated for accesses from unknown locations. + format: int32 + maximum: 30 + minimum: 1 + nullable: true + type: integer SecurityMonitoringRuleInstantaneousBaseline: description: When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time. example: false @@ -70386,6 +77466,60 @@ components: description: Included data for shift operations. oneOf: - $ref: "#/components/schemas/ScheduleUser" + SignalEntitiesAttributes: + description: Attributes containing the entities related to the signal. + properties: + identities: + description: The identity entities related to the signal. Each item is a free-form object describing an identity (for example, a user or principal). + example: + - display_name: Test User + principal_id: user@example.com + items: + $ref: "#/components/schemas/SignalEntityIdentity" + type: array + required: + - identities + type: object + SignalEntitiesData: + description: Entities related to a security signal. + properties: + attributes: + $ref: "#/components/schemas/SignalEntitiesAttributes" + id: + description: The signal ID the entities are associated with. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + type: + $ref: "#/components/schemas/SignalEntitiesType" + required: + - id + - type + - attributes + type: object + SignalEntitiesResponse: + description: Response containing entities related to a security signal. + properties: + data: + $ref: "#/components/schemas/SignalEntitiesData" + required: + - data + type: object + SignalEntitiesType: + default: entities + description: The type of the resource. The value should always be `entities`. + enum: + - entities + example: entities + type: string + x-enum-varnames: + - ENTITIES + SignalEntityIdentity: + additionalProperties: {} + description: An identity entity related to a signal. The set of attributes is dynamic and depends on the source providing the identity. + example: + display_name: Test User + principal_id: user@example.com + type: object SimpleMonitorUserTemplate: description: A simplified version of a monitor user template. properties: @@ -70427,10 +77561,16 @@ components: packets_sent_by_server: 20 rtt_micro_seconds: 800 tcp_closed_connections: 30 + tcp_delivered_ce: 12 tcp_established_connections: 40 + tcp_probe0_count: 2 + tcp_rcv_ooo_pack: 15 + tcp_recovery_count: 8 tcp_refusals: 7 + tcp_reord_seen: 4 tcp_resets: 5 tcp_retransmits: 30 + tcp_rto_count: 3 tcp_timeouts: 6 id: client_team:networks, server_service:hucklebuck type: aggregated_connection @@ -70488,14 +77628,34 @@ components: description: The number of TCP connections in a closed state. Measured in connections per second from the client. format: int64 type: integer + tcp_delivered_ce: + description: The number of TCP segments acknowledged with the ECN Congestion Experienced (CE) mark, indicating that an upstream router marked packets as experiencing congestion. + format: int64 + type: integer tcp_established_connections: description: The number of TCP connections in an established state. Measured in connections per second from the client. format: int64 type: integer + tcp_probe0_count: + description: The number of TCP zero-window probes sent. These probes are sent when the receiver advertises a zero receive window, indicating it cannot accept more data. + format: int64 + type: integer + tcp_rcv_ooo_pack: + description: The number of TCP packets received out of order. This indicates network-level packet reordering, which can degrade TCP performance by triggering spurious retransmissions and reducing throughput. + format: int64 + type: integer + tcp_recovery_count: + description: The number of TCP fast recovery events. Fast recovery retransmits lost segments detected through duplicate ACKs or selective acknowledgment (SACK) without waiting for a retransmission timeout. + format: int64 + type: integer tcp_refusals: description: The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration. format: int64 type: integer + tcp_reord_seen: + description: The number of times reordering of sent packets was detected. Reordering detection adjusts the duplicate ACK threshold, preventing spurious retransmissions caused by out-of-order delivery. + format: int64 + type: integer tcp_resets: description: The number of TCP connections that were reset by the server. format: int64 @@ -70504,6 +77664,10 @@ components: description: TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client. format: int64 type: integer + tcp_rto_count: + description: The number of TCP retransmission timeouts (RTOs). An RTO occurs when an ACK is not received within the estimated round-trip time, forcing the sender to retransmit and halve its congestion window. + format: int64 + type: integer tcp_timeouts: description: The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues. format: int64 @@ -73494,6 +80658,8 @@ components: example: 1 format: int64 type: integer + weekdayPositions: + $ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions" weekdays: $ref: "#/components/schemas/SyntheticsDowntimeWeekdays" required: @@ -73511,6 +80677,8 @@ components: type: integer until: $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate" + weekdayPositions: + $ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions" weekdays: $ref: "#/components/schemas/SyntheticsDowntimeWeekdays" required: @@ -73622,6 +80790,32 @@ components: - FRIDAY - SATURDAY - SUNDAY + SyntheticsDowntimeWeekdayPosition: + description: >- + The position of a weekday within a month for a monthly Synthetics downtime recurrence. `1` through `4` select the first through fourth occurrence of the weekday in the month, and `-1` selects the last occurrence. + enum: + - 1 + - 2 + - 3 + - 4 + - -1 + example: 1 + format: int64 + type: integer + x-enum-varnames: + - FIRST + - SECOND + - THIRD + - FOURTH + - LAST + SyntheticsDowntimeWeekdayPositions: + description: >- + Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month". + example: + - 1 + items: + $ref: "#/components/schemas/SyntheticsDowntimeWeekdayPosition" + type: array SyntheticsDowntimeWeekdays: description: Days of the week for a Synthetics downtime recurrence schedule. example: @@ -77347,6 +84541,28 @@ components: - type - id type: object + TagData: + description: A tag resource associated with an app. + properties: + id: + description: The name of the tag. + example: production + type: string + type: + $ref: "#/components/schemas/TagDataType" + required: + - id + - type + type: object + TagDataType: + description: The resource type for a tag. + enum: + - tag + example: tag + minLength: 3 + type: string + x-enum-varnames: + - TAG TagsEventAttribute: description: Array of tags associated with your event. example: ["team:A"] @@ -79333,6 +86549,34 @@ components: required: - data type: object + TestExample: + description: A test example resource. + properties: + created_at: + description: Creation time of the test example. + format: date-time + readOnly: true + type: string + id: + description: The ID of the test example. + example: "abc-123" + type: string + name: + description: The name of the test example. + example: "My Test Example" + type: string + required: + - id + - name + type: object + TestExamplesResponse: + description: Response containing a list of test examples. + properties: + data: + items: + $ref: "#/components/schemas/TestExample" + type: array + type: object TestOptimizationDeleteServiceSettingsRequest: description: Request object for deleting Test Optimization service settings. properties: @@ -79892,7 +87136,7 @@ components: type: string type: object TimeRestrictions: - description: Holds time zone information and a list of time restrictions for a routing rule. + description: Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field. properties: restrictions: description: Defines the list of time-based restrictions. @@ -79908,7 +87152,7 @@ components: - restrictions type: object TimelineCell: - description: timeline cell + description: "Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update)." properties: author: $ref: "#/components/schemas/TimelineCellAuthor" @@ -79933,11 +87177,11 @@ components: $ref: "#/components/schemas/TimelineCellType" type: object TimelineCellAuthor: - description: author of the timeline cell + description: The author of the timeline cell. Currently only user authors are supported. oneOf: - $ref: "#/components/schemas/TimelineCellAuthorUser" TimelineCellAuthorUser: - description: timeline cell user author + description: A user who authored a timeline cell. properties: content: $ref: "#/components/schemas/TimelineCellAuthorUserContent" @@ -79945,23 +87189,23 @@ components: $ref: "#/components/schemas/TimelineCellAuthorUserType" type: object TimelineCellAuthorUserContent: - description: user author content. + description: Profile information for the user who authored the timeline cell. properties: email: - description: user email + description: The email address of the user. type: string handle: - description: user handle + description: The Datadog handle of the user. type: string id: - description: user UUID + description: The UUID of the user. type: string name: - description: user name + description: The display name of the user. type: string type: object TimelineCellAuthorUserType: - description: user author type. + description: The type of timeline cell author. Currently only `USER` is supported. enum: - USER example: USER @@ -79969,18 +87213,18 @@ components: x-enum-varnames: - USER TimelineCellContent: - description: timeline cell content + description: The content payload of a timeline cell, varying by cell type. oneOf: - $ref: "#/components/schemas/TimelineCellContentComment" TimelineCellContentComment: - description: comment content + description: The content of a comment timeline cell. properties: message: - description: comment message + description: The text content of the comment. Supports Markdown formatting. type: string type: object TimelineCellResource: - description: Timeline cell JSON:API resource + description: A timeline cell resource representing a single entry in a case's activity timeline. properties: attributes: $ref: "#/components/schemas/TimelineCell" @@ -79997,7 +87241,7 @@ components: type: object TimelineCellResourceType: default: timeline_cell - description: Timeline cell JSON:API resource type + description: JSON:API resource type for timeline cells. enum: - timeline_cell example: timeline_cell @@ -80005,7 +87249,7 @@ components: x-enum-varnames: - TIMELINE_CELL TimelineCellType: - description: Timeline cell content type + description: The type of content in the timeline cell. Currently only `COMMENT` is supported in this endpoint. enum: - COMMENT example: COMMENT @@ -80013,7 +87257,7 @@ components: x-enum-varnames: - COMMENT TimelineResponse: - description: Timeline response + description: Response containing the chronological list of timeline cells for a case. properties: data: description: The `TimelineResponse` `data`. @@ -80199,321 +87443,6 @@ components: type: string x-enum-varnames: - SECRET - TransportWebhookLog: - description: A single email transport webhook log event. - properties: - attributes: - $ref: "#/components/schemas/TransportWebhookLogAttributes" - date: - description: The ISO 8601 timestamp of the event. - example: "2024-01-15T10:30:00Z" - format: date-time - type: string - log_id: - description: The unique log event identifier. - example: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR" - type: string - source: - description: The email transport provider. - example: "sendgrid" - type: string - status: - description: The log status level. - example: "info" - type: string - tags: - description: A list of tags associated with the event. - example: ["env:production"] - items: - description: A tag in key:value or key-only form (for example, env:production). - type: string - type: array - required: - - date - - log_id - - source - - status - - tags - - attributes - type: object - TransportWebhookLogAttributes: - description: Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. - properties: - category: - description: The event categories. - example: ["transactional"] - items: - description: An event category assigned by the transport provider. - type: string - type: array - email: - $ref: "#/components/schemas/TransportWebhookLogEmail" - email_id: - description: The unique email identifier. - example: "abc123-def456" - type: string - email_type_display_name: - description: The human-readable email type name. - example: "Monitor Alert" - type: string - message: - $ref: "#/components/schemas/TransportWebhookLogMessage" - network: - $ref: "#/components/schemas/TransportWebhookLogNetwork" - org: - description: The numeric organization identifier. - example: 1234 - format: int64 - type: integer - org_metadata: - $ref: "#/components/schemas/TransportWebhookLogOrgMetadata" - org_uuid: - description: The organization UUID. - example: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" - type: string - queue_time: - description: The timestamp when the email was queued. - example: "2024-01-15T10:29:00Z" - type: string - sg_machine_open: - description: Indicates whether the open event was triggered by automated machine activity rather than a human recipient (SendGrid-specific). - type: boolean - subject: - description: The email subject line. - example: "[Monitor Alert] CPU usage is high" - type: string - useragent: - description: The user agent string for open events. - example: "Mozilla/5.0" - type: string - type: object - TransportWebhookLogBatchRequest: - description: A batch of email transport webhook log events. - items: - $ref: "#/components/schemas/TransportWebhookLog" - type: array - TransportWebhookLogEmail: - description: The email address details. - properties: - address: - description: The recipient email address. - example: "user@example.com" - type: string - domain: - description: The recipient domain. - example: "example.com" - type: string - subject: - description: The email subject line. - example: "[Monitor Alert] CPU usage is high" - type: string - type: - description: Email categorization tags applied by the transport provider (for example, "transactional", "marketing"). - example: ["transactional"] - items: - description: An email type classification (for example, "transactional", "user"). - type: string - type: array - type: object - TransportWebhookLogIpAttribute: - description: An IP attribute with its sources. - properties: - ip: - description: The IP address. - example: "192.168.1.1" - type: string - source: - description: The transport providers or systems that reported this IP address. - example: ["sendgrid"] - items: - description: A transport provider or system that reported this IP address. - type: string - type: array - type: object - TransportWebhookLogMessage: - description: The message delivery event details. - properties: - auth: - $ref: "#/components/schemas/TransportWebhookLogMessageAuth" - custom_args: - $ref: "#/components/schemas/TransportWebhookLogMessageCustomArgs" - id: - $ref: "#/components/schemas/TransportWebhookLogMessageId" - name: - description: The delivery event type emitted by the transport provider (for example, "delivered", "dropped", "bounced"). - example: "delivered" - type: string - response: - $ref: "#/components/schemas/TransportWebhookLogMessageResponse" - sender_ip: - description: The IP address of the sending server. - example: "192.168.1.1" - type: string - timestamp: - $ref: "#/components/schemas/TransportWebhookLogMessageTimestamp" - type: object - TransportWebhookLogMessageAuth: - description: The message authentication details. - properties: - delivered_with_tls: - description: The TLS version or negotiation information. - example: "TLSv1.2" - type: string - type: object - TransportWebhookLogMessageCustomArgs: - description: Custom arguments passed through the email transport provider for tracking. - properties: - email_id: - description: The unique email identifier. - example: "abc123-def456" - type: string - email_type_display_name: - description: The human-readable email type name. - example: "Monitor Alert" - type: string - org_uuid: - description: The organization UUID. - example: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" - type: string - queue_time: - description: The timestamp when the email was queued. - example: "2024-01-15T10:29:00Z" - type: string - subject: - description: The email subject line. - example: "[Monitor Alert] CPU usage is high" - type: string - type: object - TransportWebhookLogMessageId: - description: The message identifiers. - properties: - message_id: - description: The RFC 5322 Message-ID. - example: "" - type: string - smtp_id: - description: The SMTP transaction identifier. - example: "" - type: string - transport_event_id: - description: The transport provider event identifier. - example: "evt_abc123" - type: string - type: object - TransportWebhookLogMessageResponse: - description: The SMTP response information. - properties: - enhanced_smtp_code: - description: The enhanced SMTP status code. - example: "2.0.0" - type: string - reason: - description: The SMTP response message. - example: "250 2.0.0 OK" - type: string - smtp_code: - description: The SMTP status code. - example: "250" - type: string - type: object - TransportWebhookLogMessageTimestamp: - description: The message delivery timing information. - properties: - event_timestamp: - description: The Unix timestamp of the event. - example: 1705312200.0 - format: double - type: number - lifetime: - description: The total delivery time in seconds. - example: 3.2 - format: double - type: number - queue_time: - description: Number of seconds the message spent in the delivery queue. - example: 1.5 - format: double - type: number - scheduled_time: - description: The scheduled delivery time as a Unix timestamp. - example: 1705312190.0 - format: double - type: number - type: object - TransportWebhookLogNetwork: - description: The network information for the event. - properties: - ip: - $ref: "#/components/schemas/TransportWebhookLogNetworkIp" - type: object - TransportWebhookLogNetworkIp: - description: The IP address information. - properties: - attributes: - description: Per-IP attribute records, each pairing an IP address with the providers that observed it. - items: - $ref: "#/components/schemas/TransportWebhookLogIpAttribute" - type: array - list: - description: The list of IP addresses. - example: ["192.168.1.1"] - items: - description: An IP address observed during message delivery. - type: string - type: array - type: object - TransportWebhookLogOrgMetadata: - description: Metadata about the organization that sent the email. - properties: - billing_country: - description: Country code or name used for billing purposes. - type: string - billing_plan: - description: The Datadog billing plan for the organization (for example, "pro", "enterprise"). - type: string - customer_tier: - description: Support or account tier assigned to the organization (for example, "tier-1"). - type: string - domain: - description: Primary email domain associated with the organization (for example, "example.com"). - type: string - industry: - description: Industry classification of the organization (for example, "technology", "finance"). - type: string - is_bugbounty: - description: Whether the organization is enrolled in the Datadog bug bounty program. - type: string - is_msp: - description: Whether the organization operates as a Managed Service Provider managing child orgs. - type: string - name: - description: Display name of the organization as configured in Datadog account settings. - type: string - org_uuid: - description: Globally unique identifier for the Datadog organization (UUID v1 format). - type: string - parent_org_id: - description: Identifier of the immediate parent organization, if this is a child org. - type: string - premium_support: - description: Whether the organization has a premium support plan with Datadog. - type: string - root_org_id: - description: Identifier of the top-level parent organization in a multi-org account hierarchy. - type: string - root_org_name: - description: Display name of the top-level parent organization in a multi-org account hierarchy. - type: string - shipping_country: - description: Country code or name used for shipping or regional assignment. - type: string - website: - description: Website URL provided during organization registration. - type: string - when_created: - description: ISO 8601 timestamp of when the Datadog organization was created. - type: string - type: object Trigger: description: "One of the triggers that can start the execution of a workflow." oneOf: @@ -80877,6 +87806,62 @@ components: data: $ref: "#/components/schemas/ActionConnectionData" type: object + UpdateAppFavoriteRequest: + description: A request to add or remove an app from the current user's favorites. + example: + data: + attributes: + favorite: true + type: favorites + properties: + data: + $ref: "#/components/schemas/UpdateAppFavoriteRequestData" + type: object + UpdateAppFavoriteRequestData: + description: Data for updating an app's favorite status. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppFavoriteRequestDataAttributes" + type: + $ref: "#/components/schemas/AppFavoriteType" + type: object + UpdateAppFavoriteRequestDataAttributes: + description: Attributes for updating an app's favorite status. + properties: + favorite: + description: Whether the app should be marked as a favorite for the current user. + example: true + type: boolean + required: + - favorite + type: object + UpdateAppProtectionLevelRequest: + description: A request to update an app's publication protection level. + example: + data: + attributes: + protectionLevel: approval_required + type: protectionLevel + properties: + data: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequestData" + type: object + UpdateAppProtectionLevelRequestData: + description: Data for updating an app's publication protection level. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequestDataAttributes" + type: + $ref: "#/components/schemas/AppProtectionLevelType" + type: object + UpdateAppProtectionLevelRequestDataAttributes: + description: Attributes for updating an app's publication protection level. + properties: + protectionLevel: + $ref: "#/components/schemas/AppProtectionLevel" + required: + - protectionLevel + type: object UpdateAppRequest: description: A request object for updating an existing app. example: @@ -81036,6 +88021,99 @@ components: type: string type: array type: object + UpdateAppSelfServiceRequest: + description: A request to enable or disable self-service for an app. + example: + data: + attributes: + selfService: true + type: selfService + properties: + data: + $ref: "#/components/schemas/UpdateAppSelfServiceRequestData" + type: object + UpdateAppSelfServiceRequestData: + description: Data for updating an app's self-service status. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppSelfServiceRequestDataAttributes" + type: + $ref: "#/components/schemas/AppSelfServiceType" + type: object + UpdateAppSelfServiceRequestDataAttributes: + description: Attributes for updating an app's self-service status. + properties: + selfService: + description: Whether the app is enabled for self-service. + example: true + type: boolean + required: + - selfService + type: object + UpdateAppTagsRequest: + description: A request to replace the tags on an app. + example: + data: + attributes: + tags: + - team:platform + - service:ops + type: tags + properties: + data: + $ref: "#/components/schemas/UpdateAppTagsRequestData" + type: object + UpdateAppTagsRequestData: + description: Data for replacing an app's tags. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppTagsRequestDataAttributes" + type: + $ref: "#/components/schemas/AppTagsType" + type: object + UpdateAppTagsRequestDataAttributes: + description: Attributes for replacing an app's tags. + properties: + tags: + description: The full list of tags that should be set on the app. Existing tags not present in this list are removed. + example: + - team:platform + - service:ops + items: + type: string + type: array + required: + - tags + type: object + UpdateAppVersionNameRequest: + description: A request to assign a human-readable name to a specific app version. + example: + data: + attributes: + name: v1.2.0 - bug fix release + type: versionNames + properties: + data: + $ref: "#/components/schemas/UpdateAppVersionNameRequestData" + type: object + UpdateAppVersionNameRequestData: + description: Data for naming a specific app version. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppVersionNameRequestDataAttributes" + type: + $ref: "#/components/schemas/AppVersionNameType" + type: object + UpdateAppVersionNameRequestDataAttributes: + description: Attributes for naming a specific app version. + properties: + name: + description: The name to assign to the app version. + example: v1.2.0 - bug fix release + type: string + required: + - name + type: object UpdateAppsDatastoreItemRequest: description: Request to update specific fields on an existing datastore item. properties: @@ -84816,6 +91894,7 @@ components: bits_investigations_read: View Bits AI investigations. bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. + cases_shared_settings_write: Update shared case management settings. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. ci_visibility_read: View CI Visibility. @@ -84837,6 +91916,8 @@ components: embeddable_graphs_share: Generate public links to share embeddable graphs externally. error_tracking_read: Read Error Tracking data. error_tracking_write: Edit Error Tracking issues. + event_correlation_config_read: View event correlation configurations. + event_correlation_config_write: Create and update event correlation configurations. events_read: Read Events data. hosts_read: List hosts and their attributes. incident_notification_settings_read: View Incident Notification Rule Settings. @@ -84845,6 +91926,10 @@ components: incident_settings_read: View Incident Settings. incident_settings_write: Configure Incident Settings. incident_write: Create, view, and manage incidents in Datadog. + integrations_read: View configured integrations and their settings. + logs_modify_indexes: Modify log indexes, filters, exclusion filters, and configurations. + logs_read_index_data: Read indexed log data. + manage_integrations: Install, uninstall, and configure integrations. metrics_read: View custom metrics. monitors_downtime: Set downtimes to suppress alerts from any monitor in an organization. Mute and unmute monitors. The ability to write monitors is not required to set downtimes. monitors_read: View monitors. @@ -84865,6 +91950,7 @@ components: security_monitoring_suppressions_write: Write Rule Suppressions. security_pipelines_read: View Security Pipelines. security_pipelines_write: Create, edit, and delete CSM Security Pipelines. + siem_entities_read: View Cloud SIEM entities. slos_corrections: Apply, edit, and delete SLO status corrections. A user with this permission can make status corrections, even if they do not have permission to edit those SLOs. slos_read: View SLOs and status corrections. slos_write: Create, edit, and delete SLOs. @@ -90143,6 +97229,780 @@ paths: operator: OR permissions: - apps_write + "/api/v2/app-builder/apps/{app_id}/favorite": + patch: + description: Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. + operationId: UpdateAppFavorite + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + favorite: true + type: favorites + schema: + $ref: "#/components/schemas/UpdateAppFavoriteRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update App Favorite Status + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + "/api/v2/app-builder/apps/{app_id}/protection-level": + patch: + description: Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. + operationId: UpdateProtectionLevel + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + protectionLevel: approval_required + type: protectionLevel + schema: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + components: [] + description: This is a simple example app + favorite: false + name: Example App + queries: [] + rootInstanceName: grid0 + tags: [] + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: appDefinitions + schema: + $ref: "#/components/schemas/UpdateAppResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "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" + summary: Update App Protection Level + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/publish-request": + post: + description: Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. + operationId: CreatePublishRequest + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Adds new dashboard widgets and a few bug fixes. + title: Release v1.2 to production + type: publishRequest + schema: + $ref: "#/components/schemas/CreatePublishRequestRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + app_version_id: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + meta: + created_at: "2026-04-01T12:00:00Z" + user_name: jane.doe@example.com + user_uuid: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: deployment + schema: + $ref: "#/components/schemas/PublishAppResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "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" + summary: Create Publish Request + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/revert": + post: + description: Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. + operationId: RevertApp + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The version number of the app to revert to. Cannot be `latest`. The special value `deployed` can be used to revert to the currently published version. + example: "2" + in: query + name: version + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + components: [] + description: This is a simple example app + favorite: false + name: Example App + queries: [] + rootInstanceName: grid0 + tags: [] + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: appDefinitions + schema: + $ref: "#/components/schemas/UpdateAppResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "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" + summary: Revert App + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/self-service": + patch: + description: Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. + operationId: UpdateAppSelfService + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + selfService: true + type: selfService + schema: + $ref: "#/components/schemas/UpdateAppSelfServiceRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update App Self-Service Status + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/tags": + patch: + description: Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. + operationId: UpdateAppTags + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + tags: + - team:platform + - service:ops + type: tags + schema: + $ref: "#/components/schemas/UpdateAppTagsRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update App Tags + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/version-name": + patch: + description: Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. + operationId: UpdateAppVersionName + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The version number of the app to name. The special values `latest` and `deployed` can also be used to target the latest or currently published version. + example: "3" + in: query + name: version + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: v1.2.0 - bug fix release + type: versionNames + schema: + $ref: "#/components/schemas/UpdateAppVersionNameRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Name App Version + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/versions": + get: + description: List the versions of an app. This endpoint is paginated. + operationId: ListAppVersions + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The number of versions to return per page. + in: query + name: limit + required: false + schema: + format: int64 + type: integer + - description: The page number to return. + in: query + name: page + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + app_id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + created_at: "2026-04-01T12:00:00Z" + has_ever_been_published: true + name: v1.2.0 - bug fix release + updated_at: "2026-04-01T12:00:00Z" + user_name: jane.doe@example.com + user_uuid: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + version: 3 + id: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + type: appVersions + meta: + page: + totalCount: 1 + schema: + $ref: "#/components/schemas/ListAppVersionsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "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" + summary: List App Versions + tags: + - App Builder + "x-permission": + operator: AND + permissions: + - apps_run + - connections_read + "/api/v2/app-builder/blueprint/{blueprint_id}": + get: + description: Retrieve an app blueprint by its ID. + operationId: GetBlueprint + parameters: + - description: The ID of the blueprint to retrieve. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: blueprint_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintResponse" + 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" + summary: Get Blueprint + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + /api/v2/app-builder/blueprints: + get: + description: List available app blueprints. + operationId: ListBlueprints + parameters: + - description: The number of blueprints to return per page. Defaults to 10. Maximum is 100. + in: query + name: limit + required: false + schema: + format: int64 + type: integer + - description: The page of results to return. Starts at 0. + in: query + name: page + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/ListBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Blueprints + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + "/api/v2/app-builder/blueprints/integration-id/{integration_id}": + get: + description: List app blueprints associated with a specific integration ID. + operationId: GetBlueprintsByIntegrationId + parameters: + - description: The integration ID to filter blueprints by. + example: aws + in: path + name: integration_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + integration_id: aws + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Blueprints by Integration ID + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + "/api/v2/app-builder/blueprints/slugs/{slugs}": + get: + description: Retrieve app blueprints by their slugs. + operationId: GetBlueprintsBySlugs + parameters: + - description: A comma-separated list of blueprint slugs. + example: aws-service-manager + in: path + name: slugs + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Blueprints by Slugs + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + /api/v2/app-builder/tags: + get: + description: List all tags associated with the authenticated user's apps. + operationId: ListTags + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: production + type: tag + schema: + $ref: "#/components/schemas/AppBuilderListTagsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Tags + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run /api/v2/application_keys: get: description: List all application keys available for your org @@ -91137,6 +98997,336 @@ paths: summary: Create a case tags: - Case Management + /api/v2/cases/aggregate: + post: + description: Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics. + operationId: AggregateCases + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + group_by: + groups: + - "status" + limit: 14 + query_filter: "service:case-api" + type: aggregate + schema: + $ref: "#/components/schemas/CaseAggregateRequest" + description: Case aggregate request payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + groups: + - group: OPEN + value: + - 42.0 + total: 100.0 + id: agg-result-001 + type: aggregate + schema: + $ref: "#/components/schemas/CaseAggregateResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Aggregate cases + tags: + - Case Management + 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/cases/bulk: + post: + description: Applies a single action (such as changing priority, status, assignment, or archiving) to multiple cases at once. The list of case IDs and the action type with its payload are specified in the request body. + operationId: BulkUpdateCases + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + case_ids: + - "case-id-1" + - "case-id-2" + payload: + priority: "P1" + type: priority + type: bulk + schema: + $ref: "#/components/schemas/CaseBulkUpdateRequest" + description: Case bulk update request payload. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Bulk update cases + tags: + - Case Management + 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/cases/count: + get: + description: Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope. + operationId: CountCases + parameters: + - description: Filter query for cases. + in: query + name: query_filter + required: false + schema: + type: string + - description: Comma-separated fields to group by. + example: "status,priority" + in: query + name: group_bys + required: false + schema: + type: string + - description: Maximum facet values to return. + in: query + name: limit + required: false + schema: + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + groups: + - group: status + group_values: + - count: 42 + value: OPEN + id: count-result-001 + type: count + schema: + $ref: "#/components/schemas/CaseCountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Count cases + tags: + - Case Management + 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/cases/link: + get: + description: Returns all links associated with a case. Links define relationships (for example, BLOCKS) between cases. Requires entity_type and entity_id query parameters. + operationId: ListCaseLinks + parameters: + - description: "The entity type to look up links for. Use `CASE` to find links for a specific case." + in: query + name: entity_type + required: true + schema: + example: "CASE" + type: string + - description: "The UUID of the entity to look up links for." + in: query + name: entity_id + required: true + schema: + example: "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f" + type: string + - description: "Optional filter to only return links of a specific relationship type (for example, `BLOCKS` or `CAUSES`)." + in: query + name: relationship + required: false + schema: + example: "BLOCKS" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + id: 804cd682-55f6-4541-ab00-b608b282ea7d + type: link + schema: + $ref: "#/components/schemas/CaseLinksResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case links + tags: + - Case Management + 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/). + post: + description: Creates a directional link between two cases (for example, case A blocks case B). The parent and child cases and their relationship type must be specified. + operationId: CreateCaseLink + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + type: link + schema: + $ref: "#/components/schemas/CaseLinkCreateRequest" + description: "Case link create request." + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + id: 804cd682-55f6-4541-ab00-b608b282ea7d + type: link + schema: + $ref: "#/components/schemas/CaseLinkResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case link + tags: + - Case Management + 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/cases/link/{link_id}: + delete: + description: Deletes an existing link between cases by link ID. + operationId: DeleteCaseLink + parameters: + - $ref: "#/components/parameters/LinkIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a case link + tags: + - Case Management + 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/cases/projects: get: description: >- @@ -91228,6 +99418,44 @@ paths: summary: Create a project tags: - Case Management + /api/v2/cases/projects/favorites: + get: + description: Returns the list of case projects that the current authenticated user has marked as favorites. + operationId: ListUserCaseProjectFavorites + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: project_favorite + schema: + $ref: "#/components/schemas/ProjectFavoritesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List project favorites + tags: + - Case Management + 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/cases/projects/{project_id}: delete: description: Remove a project using the project's `id`. @@ -91347,6 +99575,65 @@ paths: summary: Update a project tags: - Case Management + /api/v2/cases/projects/{project_id}/favorites: + delete: + description: Removes a case project from the current user's favorites list. + operationId: UnfavoriteCaseProject + parameters: + - $ref: "#/components/parameters/ProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unfavorite a project + tags: + - Case Management + 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/). + post: + description: Marks a case project as a favorite for the current authenticated user. + operationId: FavoriteCaseProject + parameters: + - $ref: "#/components/parameters/ProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Favorite a project + tags: + - Case Management + 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/cases/projects/{project_id}/notification_rules: get: description: >- @@ -91555,6 +99842,418 @@ paths: summary: Update a notification rule tags: - Case Management + /api/v2/cases/projects/{project_id}/rules: + get: + description: Returns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes. + operationId: ListCaseAutomationRules + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRulesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List automation rules + tags: + - Case Management + 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/). + post: + description: Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute. + operationId: CreateCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleCreateRequest" + description: Automation rule payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create an automation rule + tags: + - Case Management + 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/cases/projects/{project_id}/rules/{rule_id}: + delete: + description: Permanently deletes an automation rule from a project. + operationId: DeleteCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete an automation rule + tags: + - Case Management + 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/). + get: + description: Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled). + operationId: GetCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get an automation rule + tags: + - Case Management + 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/). + put: + description: Updates the trigger, action, name, or state of an existing automation rule. + operationId: UpdateCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleUpdateRequest" + description: Automation rule payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update an automation rule + tags: + - Case Management + 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/cases/projects/{project_id}/rules/{rule_id}/disable: + post: + description: Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved. + operationId: DisableCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: DISABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Disable an automation rule + tags: + - Case Management + 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/cases/projects/{project_id}/rules/{rule_id}/enable: + post: + description: Enables a previously disabled automation rule so it triggers on matching case events. + operationId: EnableCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Enable an automation rule + tags: + - Case Management + 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/cases/types: get: description: Get all case types @@ -91683,6 +100382,65 @@ paths: summary: Delete a case type tags: - Case Management Type + put: + description: Updates the name, emoji, or description of an existing case type. + operationId: UpdateCaseType + parameters: + - $ref: "#/components/parameters/CaseTypeIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Investigations done in case management + emoji: "🕵🏻‍♂️" + name: Investigation + type: case_type + schema: + $ref: "#/components/schemas/CaseTypeUpdateRequest" + description: Case type payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Investigations done in case management + emoji: "🕵🏻‍♂️" + name: Investigation + id: 00000000-0000-0000-0000-000000000001 + type: case_type + schema: + $ref: "#/components/schemas/CaseTypeResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_shared_settings_write + summary: Update a case type + tags: + - Case Management Type + 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/cases/types/{case_type_id}/custom_attributes: get: description: Get all custom attribute config of case type @@ -91797,6 +100555,305 @@ paths: summary: Delete custom attributes config tags: - Case Management Attribute + put: + description: Updates the display name, description, type, or options of an existing custom attribute configuration for a case type. + operationId: UpdateCustomAttributeConfig + parameters: + - $ref: "#/components/parameters/CaseTypeIDPathParameter" + - $ref: "#/components/parameters/CaseCustomAttributeIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Updated description. + display_name: AWS Region + type: custom_attribute + schema: + $ref: "#/components/schemas/CustomAttributeConfigUpdateRequest" + description: Custom attribute config payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + case_type_id: 00000000-0000-0000-0000-000000000006 + description: Updated description. + display_name: AWS Region + is_multi: true + key: aws_region + type: TEXT + id: 00000000-0000-0000-0000-000000000005 + type: custom_attribute + schema: + $ref: "#/components/schemas/CustomAttributeConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_shared_settings_write + summary: Update custom attribute config + tags: + - Case Management Attribute + 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/cases/views: + get: + description: Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases. + operationId: ListCaseViews + parameters: + - description: Filter views by project identifier. + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: query + name: project_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case views + tags: + - Case Management + 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/). + post: + description: Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view. + operationId: CreateCaseView + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Open bugs + project_id: e555e290-ed65-49bd-ae18-8acbfcf18db7 + query: "status:open type:bug" + type: view + schema: + $ref: "#/components/schemas/CaseViewCreateRequest" + description: Case view payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case view + tags: + - Case Management + 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/cases/views/{view_id}: + delete: + description: Permanently deletes a saved case view. + operationId: DeleteCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a case view + tags: + - Case Management + 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/). + get: + description: Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps. + operationId: GetCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get a case view + tags: + - Case Management + 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/). + put: + description: Updates the name, query, or notification rule of an existing case view. + operationId: UpdateCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Updated view name + type: view + schema: + $ref: "#/components/schemas/CaseViewUpdateRequest" + description: Case view payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Updated view name + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update a case view + tags: + - Case Management + 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/cases/{case_id}: get: description: >- @@ -92115,6 +101172,50 @@ paths: summary: Delete case comment tags: - Case Management + put: + description: Updates the text content of an existing comment on a case timeline. The comment is identified by its cell ID. + operationId: UpdateCaseComment + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/CellIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + comment: Updated comment text + type: case + schema: + $ref: "#/components/schemas/CaseUpdateCommentRequest" + description: Case update comment payload. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case comment + tags: + - Case Management + 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/cases/{case_id}/custom_attributes/{custom_attribute_key}: delete: description: Delete custom attribute from case @@ -92274,13 +101375,246 @@ paths: $ref: "#/components/schemas/CaseResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case description + tags: + - Case Management + /api/v2/cases/{case_id}/due_date: + post: + description: Sets or updates the due date for a case. The due date is a calendar date (without a time component) indicating when the case should be resolved. + operationId: UpdateCaseDueDate + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + due_date: "2026-12-31" + type: case + schema: + $ref: "#/components/schemas/CaseUpdateDueDateRequest" + description: Case due date update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case due date + tags: + - Case Management + 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/cases/{case_id}/insights: + delete: + description: Removes one or more previously added insights from a case by specifying their type and resource identifier in the request body. + operationId: RemoveCaseInsights + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + insights: + - ref: "/monitors/12345?q=total" + resource_id: "12345" + type: SECURITY_SIGNAL + type: case + schema: + $ref: "#/components/schemas/CaseInsightsRequest" + description: Case insights request. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove insights from a case + tags: + - Case Management + 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/). + put: + description: >- + Adds one or more insights to a case. Insights are references to related Datadog resources (such as monitors, security signals, incidents, or error tracking issues) that provide investigative context. Up to 100 insights can be added per request. Each insight requires a type (see `CaseInsightType` for allowed values), a ref (URL path to the resource), and a resource_id. + operationId: AddCaseInsights + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + insights: + - ref: "/monitors/12345?q=total" + resource_id: "12345" + type: SECURITY_SIGNAL + type: case + schema: + $ref: "#/components/schemas/CaseInsightsRequest" + description: Case insights request. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "401": - $ref: "#/components/responses/UnauthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": - $ref: "#/components/responses/ForbiddenResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -92288,9 +101622,12 @@ paths: appKeyAuth: [] - AuthZ: - cases_write - summary: Update case description + summary: Add insights to a case tags: - Case Management + 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/cases/{case_id}/priority: post: description: Update case priority @@ -92794,6 +102131,72 @@ paths: 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/cases/{case_id}/resolved_reason: + post: + description: Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). Applicable to security-type cases. + operationId: UpdateCaseResolvedReason + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + security_resolved_reason: "FALSE_POSITIVE" + type: case + schema: + $ref: "#/components/schemas/CaseUpdateResolvedReasonRequest" + description: Case resolved reason update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case resolved reason + tags: + - Case Management + 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/cases/{case_id}/status: post: description: Update case status @@ -92858,6 +102261,72 @@ paths: summary: Update case status tags: - Case Management + /api/v2/cases/{case_id}/timelines: + get: + description: Returns the timeline of events for a case, including comments, status changes, and other activity. Supports pagination and sort order. + operationId: ListCaseTimeline + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - description: Number of timeline cells to return per page. + in: query + name: page[size] + required: false + schema: + default: 100 + type: integer + - description: Zero-based page number for pagination. + in: query + name: page[number] + required: false + schema: + default: 0 + type: integer + - description: "If `true`, returns timeline cells in chronological order (oldest first). Defaults to `false` (newest first)." + in: query + name: sort[ascending] + required: false + schema: + default: false + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cell_content: + message: This is a comment + created_at: "2024-01-01T00:00:00+00:00" + type: COMMENT + id: 00000000-0000-0000-0000-000000000001 + type: timeline_cell + schema: + $ref: "#/components/schemas/TimelineResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get case timeline + tags: + - Case Management + 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/cases/{case_id}/title: post: description: Update case title @@ -93043,6 +102512,112 @@ paths: summary: Unassign case tags: - Case Management + /api/v2/cases/{case_id}/watchers: + get: + description: Returns the list of users who are watching a case. Watchers receive notifications about updates to the case. + operationId: ListCaseWatchers + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: 8146583c-0b5f-11ec-abf8-da7ad0900001 + relationships: + user: + data: + id: 8146583c-0b5f-11ec-abf8-da7ad0900001 + type: user + type: watcher + schema: + $ref: "#/components/schemas/CaseWatchersResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case watchers + tags: + - Case Management + 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/cases/{case_id}/watchers/{user_uuid}: + delete: + description: Removes a user from the watchers list of a case. The user no longer receives notifications about updates to the case. + operationId: UnwatchCase + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/UserUUIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unwatch a case + tags: + - Case Management + 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/). + post: + description: Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications about subsequent updates to the case. + operationId: WatchCase + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/UserUUIDPathParameter" + responses: + "201": + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Watch a case + tags: + - Case Management + 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/catalog/entity: get: description: Get a list of entities from Software Catalog. @@ -95543,6 +105118,89 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and may be subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/compliance_findings/rule_based_view: + get: + description: |- + Get an aggregated view of compliance rules with their pass, fail, and muted finding counts. + Supports filtering by compliance framework, framework version, and additional query filters. + operationId: GetRuleBasedView + parameters: + - $ref: "#/components/parameters/RuleBasedViewTo" + - $ref: "#/components/parameters/RuleBasedViewFramework" + - $ref: "#/components/parameters/RuleBasedViewVersion" + - $ref: "#/components/parameters/RuleBasedViewQueryFindingsWithoutFrameworkVersion" + - $ref: "#/components/parameters/RuleBasedViewIncludeRulesWithoutFindings" + - $ref: "#/components/parameters/RuleBasedViewIsCustom" + - $ref: "#/components/parameters/RuleBasedViewQuery" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + count: 1 + rules: + - compliance_frameworks: + - control: 164.308-a-4-i + framework: hipaa + is_default: true + message: "" + requirement: Information-Access-Management + version: "1" + enabled: true + id: qjx-udx-xo8 + name: IAM roles should not allow untrusted GitHub Actions to assume them + resourceAttributes: [] + resourceCategory: identity + resourceType: aws_iam_role + stats: + fail: 0 + muted: 0 + pass: 3 + status: critical + tags: + - security:compliance + - cloud_provider:aws + - framework:hipaa + type: cloud_configuration + id: JSONAPI_USELESS_ID + type: rule_based_view + schema: + $ref: "#/components/schemas/RuleBasedViewResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "503": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Service Unavailable + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_findings_read + summary: Get the rule-based view of compliance findings + tags: ["Compliance"] + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_read + x-unstable: |- + **Note**: This endpoint is in Preview and subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/container_images: get: description: |- @@ -97203,6 +106861,545 @@ paths: summary: List budgets tags: - Cloud Cost Management + /api/v2/cost/commitments/commitment-list: + get: + description: Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + operationId: GetCommitmentsCommitmentList + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + commitments: + - commitment_id: ri-0123456789abcdef0 + expiration_date: "2025-12-31T00:00:00Z" + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + start_date: "2023-01-01T00:00:00Z" + term_length: 1 + utilization: 0.85 + schema: + $ref: "#/components/schemas/CommitmentsListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments list + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/coverage/scalar: + get: + description: Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + operationId: GetCommitmentsCoverageScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: hours_coverage + type: number + values: + - 0.78 + schema: + $ref: "#/components/schemas/CommitmentsCoverageScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/coverage/timeseries: + get: + description: Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + operationId: GetCommitmentsCoverageTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + cost: + series: + on_demand_only: + - 1000.0 + - 900.0 + ri: + - 3600.0 + - 3700.0 + sp: + - 400.0 + - 400.0 + spot_only: + - 50.0 + - 50.0 + times: + - 1693526400 + - 1693612800 + hours: + series: + on_demand_only: + - 500.0 + - 450.0 + ri: + - 1800.0 + - 1850.0 + sp: + - 200.0 + - 200.0 + spot_only: + - 100.0 + - 100.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsCoverageTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/on-demand-hot-spots/scalar: + get: + description: Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + operationId: GetCommitmentsOnDemandHotspotsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + total: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + schema: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments on-demand hot spots (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/savings/scalar: + get: + description: Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + operationId: GetCommitmentsSavingsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: realized_savings + type: number + values: + - 2500.0 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: effective_savings_rate + type: number + values: + - 0.33 + schema: + $ref: "#/components/schemas/CommitmentsSavingsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/savings/timeseries: + get: + description: Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + operationId: GetCommitmentsSavingsTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + actual_cost: + series: + total: + - 5000.0 + - 5200.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + effective_savings_rate: + series: + total: + - 0.33 + - 0.33 + times: + - 1693526400 + - 1693612800 + on_demand_equivalent_cost: + series: + total: + - 7500.0 + - 7800.0 + times: + - 1693526400 + - 1693612800 + realized_savings: + series: + total: + - 2500.0 + - 2600.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsSavingsTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/utilization/scalar: + get: + description: Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + operationId: GetCommitmentsUtilizationScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - - rds + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: utilization + type: number + values: + - 0.85 + - 0.72 + schema: + $ref: "#/components/schemas/CommitmentsUtilizationScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/commitments/utilization/timeseries: + get: + description: Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + operationId: GetCommitmentsUtilizationTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + series: + unused: + - 750.0 + - 600.0 + used: + - 4250.0 + - 4400.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + schema: + $ref: "#/components/schemas/CommitmentsUtilizationTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/custom_costs: get: description: List the Custom Costs files. @@ -97733,18 +107930,351 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - cloud_cost_management_write - summary: Update Google Cloud Usage Cost config + - cloud_cost_management_write + summary: Update Google Cloud Usage Cost config + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + /api/v2/cost/oci_config: + get: + description: List the OCI configs. + operationId: ListCostOCIConfigs + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + account_id: "ocid1.tenancy.oc1..example" + created_at: "2026-01-01T12:00:00Z" + status: active + status_updated_at: "2026-01-01T12:00:00Z" + updated_at: "2026-01-01T12:00:00Z" + id: "1" + type: oci_config + schema: + $ref: "#/components/schemas/OCIConfigsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management OCI configs + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + /api/v2/cost/recommendations: + post: + description: List cost recommendations matching a filter, with pagination and sorting. + operationId: SearchCostRecommendations + parameters: + - description: Number of results per page (1–10000). + in: query + name: page[size] + schema: + type: string + - description: Pagination token from a previous response. + in: query + name: page[token] + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + schema: + $ref: "#/components/schemas/RecommendationsFilterRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0" + potential_daily_savings: + amount: 1.23 + currency: USD + recommendation_type: terminate + resource_id: i-1234567890abcdef0 + resource_type: aws_ec2_instance + tags: + - "env:prod" + - "team:ccm" + id: encoded-event-id-1 + type: recommendation + meta: + page: + filter: "@resource_table:aws_ec2_instance" + next_page_token: "" + page_size: 100 + schema: + $ref: "#/components/schemas/CostRecommendationArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Search cost recommendations + tags: + - Cloud Cost Management + 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/cost/tag_descriptions: + get: + description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + operationId: ListCostTagDescriptions + parameters: + - description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag descriptions + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + /api/v2/cost/tag_keys: + get: + description: List Cloud Cost Management tag keys. + operationId: ListCostTagKeys + parameters: + - description: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. + in: query + name: filter[metric] + schema: + type: string + - description: |- + Filter to return only tag keys that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tag keys found on the same cost data, such as `is_aws_ec2_compute` and `aws_instance_type`. + in: query + name: filter[tags] + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + sources: + - focus + value: providername + id: providername + type: cost_tag_key + - attributes: + sources: [] + value: service + id: service + type: cost_tag_key + schema: + $ref: "#/components/schemas/CostTagKeysResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag keys + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + /api/v2/cost/tag_keys/{tag_key}: + get: + description: Get details for a specific Cloud Cost Management tag key, including example tag values and description. + operationId: GetCostTagKey + parameters: + - $ref: "#/components/parameters/TagKey" + - description: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. + in: query + name: filter[metric] + schema: + type: string + - description: |- + Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. + in: query + name: page[size] + schema: + default: 50 + format: int32 + maximum: 10000 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + details: + description: The cloud provider name reported for the cost line item. + tag_values: + - aws + - gcp + - azure + sources: + - focus + value: providername + id: providername + type: cost_tag_key + schema: + $ref: "#/components/schemas/CostTagKeyResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get a Cloud Cost Management tag key tags: - Cloud Cost Management "x-permission": operator: OR permissions: - - cloud_cost_management_write - /api/v2/cost/oci_config: + - cloud_cost_management_read + /api/v2/cost/tag_metadata: get: - description: List the OCI configs. - operationId: ListCostOCIConfigs + description: List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, and a sample of top tag values per cloud account. Use `filter[daily]=true` to return daily rows instead of the default monthly roll-up. + operationId: ListCostTagMetadata + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + - description: Filter results to a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, every available metric for the requested period is returned. + in: query + name: filter[metric] + schema: + type: string + - description: Restrict results to a single tag key. + in: query + name: filter[tag_key] + schema: + type: string + - description: When `true`, return one row per day with the day in the `date` attribute. Defaults to the monthly roll-up when omitted. + in: query + name: filter[daily] + schema: + $ref: "#/components/schemas/CostTagMetadataDailyFilter" responses: "200": content: @@ -97754,16 +108284,28 @@ paths: value: data: - attributes: - account_id: "ocid1.tenancy.oc1..example" - created_at: "2026-01-01T12:00:00Z" - status: active - status_updated_at: "2026-01-01T12:00:00Z" - updated_at: "2026-01-01T12:00:00Z" - id: "1" - type: oci_config + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata schema: - $ref: "#/components/schemas/OCIConfigsResponse" + $ref: "#/components/schemas/CostTagKeyMetadataResponse" description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request "403": content: application/json: @@ -97777,22 +108319,31 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: List Cloud Cost Management OCI configs + summary: List Cloud Cost Management tag key metadata tags: - Cloud Cost Management "x-permission": operator: OR permissions: - cloud_cost_management_read - /api/v2/cost/tag_descriptions: + 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/cost/tag_metadata/currency: get: - description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. - operationId: ListCostTagDescriptions + description: Get the dominant billing currency observed in Cloud Cost Management data for the requested period. The response wraps the currency in a JSON:API `data` array containing at most one entry; the array is empty when no currency data is available. + operationId: GetCostTagMetadataCurrency parameters: - - description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" in: query - name: filter[cloud] - required: false + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] schema: type: string responses: @@ -97803,18 +108354,17 @@ paths: default: value: data: - - attributes: - cloud: aws - created_at: "2026-01-01T12:00:00Z" - description: AWS account that owns this cost. - source: human - tag_key: account_id - updated_at: "2026-01-01T12:00:00Z" - id: account_id - type: cost_tag_description + - id: USD + type: cost_currency schema: - $ref: "#/components/schemas/CostTagDescriptionsResponse" + $ref: "#/components/schemas/CostCurrencyResponse" description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request "403": content: application/json: @@ -97828,31 +108378,33 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: List Cloud Cost Management tag descriptions + summary: Get the Cloud Cost Management billing currency tags: - Cloud Cost Management "x-permission": operator: OR permissions: - cloud_cost_management_read - /api/v2/cost/tag_keys: + 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/cost/tag_metadata/metrics: get: - description: List Cloud Cost Management tag keys. - operationId: ListCostTagKeys + description: List Cloud Cost Management metrics that have data for the requested period. + operationId: ListCostTagMetadataMetrics parameters: - - description: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" in: query - name: filter[metric] + name: filter[month] + required: true schema: type: string - - description: |- - Filter to return only tag keys that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tag keys found on the same cost data, such as `is_aws_ec2_compute` and `aws_instance_type`. + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. in: query - name: filter[tags] + name: filter[provider] schema: - items: - type: string - type: array + type: string responses: "200": content: @@ -97861,19 +108413,12 @@ paths: default: value: data: - - attributes: - sources: - - focus - value: providername - id: providername - type: cost_tag_key - - attributes: - sources: [] - value: service - id: service - type: cost_tag_key + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric schema: - $ref: "#/components/schemas/CostTagKeysResponse" + $ref: "#/components/schemas/CostMetricsResponse" description: OK "400": content: @@ -97894,33 +108439,33 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: List Cloud Cost Management tag keys + summary: List available Cloud Cost Management metrics tags: - Cloud Cost Management "x-permission": operator: OR permissions: - cloud_cost_management_read - /api/v2/cost/tag_keys/{tag_key}: + 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/cost/tag_metadata/orchestrators: get: - description: Get details for a specific Cloud Cost Management tag key, including example tag values and description. - operationId: GetCostTagKey + description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. + operationId: ListCostTagMetadataOrchestrators parameters: - - $ref: "#/components/parameters/TagKey" - - description: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" in: query - name: filter[metric] + name: filter[month] + required: true schema: type: string - - description: |- - Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. in: query - name: page[size] + name: filter[provider] schema: - default: 50 - format: int32 - maximum: 10000 - type: integer + type: string responses: "200": content: @@ -97929,20 +108474,12 @@ paths: default: value: data: - attributes: - details: - description: The cloud provider name reported for the cost line item. - tag_values: - - aws - - gcp - - azure - sources: - - focus - value: providername - id: providername - type: cost_tag_key + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator schema: - $ref: "#/components/schemas/CostTagKeyResponse" + $ref: "#/components/schemas/CostOrchestratorsResponse" description: OK "400": content: @@ -97956,12 +108493,76 @@ paths: schema: $ref: "#/components/schemas/APIErrorResponse" description: Forbidden - "404": + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management orchestrators + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/cost/tag_metadata/tag_sources: + get: + description: List Cloud Cost Management tag keys observed for the requested period, along with the origin sources that produced them (for example, `aws-user-defined`, `custom`). + operationId: ListCostTagKeySources + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + schema: + $ref: "#/components/schemas/CostTagKeySourcesResponse" + description: OK + "400": content: application/json: schema: $ref: "#/components/schemas/APIErrorResponse" - description: Not Found + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -97969,13 +108570,16 @@ paths: appKeyAuth: [] - AuthZ: - cloud_cost_management_read - summary: Get a Cloud Cost Management tag key + summary: List Cloud Cost Management tag sources tags: - Cloud Cost Management "x-permission": operator: OR permissions: - cloud_cost_management_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/cost/tags: get: description: List Cloud Cost Management tags for a given metric. @@ -99362,6 +109966,181 @@ paths: 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/dashboards/usage: + get: + description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set. + operationId: ListDashboardsUsage + parameters: + - description: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request. + in: query + name: page[limit] + required: false + schema: + default: 250 + format: int64 + type: integer + - description: Zero-based offset into the result set. + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + author: + handle: "jane.doe@example.com" + id: "00000000-0000-0000-0000-000000000000" + is_disabled: false + name: "Jane Doe" + created_at: "2026-01-15T09:30:00.000Z" + dashboard_quality_score: 0.85 + edited_at: "2026-04-20T11:05:00.000Z" + org_id: 100 + teams: ["sre"] + title: "My production overview" + total_views: 42 + total_views_by_type: + embed: 12 + in_app: 30 + viewed_at: "2026-05-01T14:22:10.000Z" + viewer: + handle: "john.smith@example.com" + id: "00000000-0000-0000-0000-000000000001" + is_disabled: false + name: "John Smith" + widget_count: 12 + widget_count_by_type: + query_value: 4 + timeseries: 8 + id: "q5j-nti-fv6" + type: "dashboards-usages" + links: + first: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=250" + last: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=1000&page[limit]=250" + next: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=250&page[limit]=250" + self: "https://api.datadoghq.com/api/v2/dashboards/usage" + meta: + page: + first_offset: 0 + last_offset: 1000 + limit: 250 + next_offset: 250 + offset: 0 + prev_offset: + total: 1234 + type: offset_limit + schema: + $ref: "#/components/schemas/ListDashboardsUsageResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - dashboards_read + summary: Get usage stats for all dashboards + tags: + - Dashboards + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + x-permission: + operator: OR + permissions: + - dashboards_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/dashboards/{dashboard_id}/usage: + get: + description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score. + operationId: GetDashboardUsage + parameters: + - description: The ID of the dashboard. + in: path + name: dashboard_id + required: true + schema: + example: "q5j-nti-fv6" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: + handle: "jane.doe" + id: "00000000-0000-0000-0000-000000000000" + is_disabled: false + name: "Jane Doe" + created_at: "2026-01-15T09:30:00.000Z" + dashboard_quality_score: 0.85 + edited_at: "2026-04-20T11:05:00.000Z" + org_id: 100 + teams: ["sre"] + title: "My production overview" + total_views: 42 + total_views_by_type: + embed: 12 + in_app: 30 + viewed_at: "2026-05-01T14:22:10.000Z" + viewer: + handle: "john.smith" + id: "00000000-0000-0000-0000-000000000001" + is_disabled: false + name: "John Smith" + widget_count: 12 + widget_count_by_type: + query_value: 4 + timeseries: 8 + id: "q5j-nti-fv6" + type: "dashboards-usages" + schema: + $ref: "#/components/schemas/DashboardUsageResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - dashboards_read + summary: Get usage stats for a dashboard + tags: + - Dashboards + x-permission: + operator: OR + permissions: + - dashboards_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/datasets: get: description: Get all datasets that have been configured for an organization. @@ -101726,70 +112505,6 @@ paths: operator: OR permissions: - monitors_downtime - /api/v2/email/transport/webhook_intake: - post: - description: |- - Receives a batch of email transport webhook log events and emits an audit trail entry - for each event with a final delivery status (delivered, dropped, or bounced). - Only authorized organizations can submit events. - operationId: CreateEmailTransportWebhookIntake - requestBody: - content: - application/json: - examples: - default: - value: - - attributes: - email: - address: "user@example.com" - domain: "example.com" - email_id: "abc123-def456" - email_type_display_name: "Monitor Alert" - message: - id: - message_id: "" - smtp_id: "" - name: "delivered" - response: - reason: "250 2.0.0 OK" - smtp_code: "250" - timestamp: - event_timestamp: 1705312200.0 - org: 1234 - org_uuid: "8dee7c38-00cb-11ea-a77b-8b5a08d3b091" - subject: "[Monitor Alert] CPU usage is high" - date: "2024-01-15T10:30:00Z" - log_id: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR" - source: "sendgrid" - status: "info" - tags: - - "env:production" - schema: - $ref: "#/components/schemas/TransportWebhookLogBatchRequest" - required: true - responses: - "204": - description: No Content - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Ingest email transport webhook events - tags: - - Email Transport - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/error-tracking/issues/search: post: description: Search issues endpoint allows you to programmatically search for issues within your organization. This endpoint returns a list of issues that match a given search query, following the event search syntax. The search results are limited to a maximum of 100 issues per request. @@ -111482,6 +122197,77 @@ paths: operator: OR permissions: - org_management + /api/v2/llm-obs/deletion/data/llmobs: + post: + description: Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + operationId: DeleteLLMObsData + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1705314600000 + query: + query: "@trace_id:abc123def456" + to: 1705315200000 + type: create_deletion_req + schema: + $ref: "#/components/schemas/LLMObsDataDeletionRequest" + description: Data deletion request payload. + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + created_by: "user-uuid-1234" + from_time: 1705314600000 + org_id: 12345 + product: llmobs + query: "@trace_id:abc123def456" + to_time: 1705315200000 + id: msg-abc123 + type: deletion_request + schema: + $ref: "#/components/schemas/LLMObsDataDeletionResponse" + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete LLM Observability data + tags: + - LLM Observability + 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/llm-obs/v1/annotation-queues: get: description: |- @@ -111827,8 +122613,16 @@ paths: /api/v2/llm-obs/v1/annotation-queues/{queue_id}/interactions: post: description: |- - Add one or more interactions (traces or sessions) to an annotation queue. - At least one interaction must be provided. + Add one or more interactions to an annotation queue. At least one + interaction must be provided. Each interaction has a `type`: + + - `trace`, `experiment_trace`, `session`: `content_id` references the + upstream entity; the server fetches the actual content. + - `display_block`: omit `content_id` and provide the rendered content + in `display_block`. The server generates `content_id` as a + deterministic hash of the block list. + + Items of different types can be mixed in a single request. operationId: CreateLLMObsAnnotationQueueInteractions parameters: - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" @@ -111844,6 +122638,24 @@ paths: - content_id: trace-abc-123 type: trace type: interactions + display_block: + summary: Add a display_block interaction + value: + data: + attributes: + interactions: + - display_block: + - content: "## Triage Instructions" + type: markdown + - content: "Inputs" + level: md + type: header + - content: + experiment_id: abc-123 + label: "Experiments" + type: json + type: display_block + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsRequest" description: Add interactions payload. @@ -111864,6 +122676,21 @@ paths: type: trace id: 00000000-0000-0000-0000-000000000001 type: interactions + display_block: + summary: display_block response + value: + data: + attributes: + interactions: + - already_existed: false + content_id: 9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2 + display_block: + - content: "## Triage Instructions" + type: markdown + id: 00000000-0000-0000-0000-000000000000 + type: display_block + id: 00000000-0000-0000-0000-000000000001 + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsResponse" description: Created @@ -112177,6 +123004,296 @@ paths: 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/llm-obs/v1/experimentation/analytics: + post: + description: |- + Execute an analytics aggregation over LLM Observability experimentation data. + Use this endpoint to compute metrics (for example average eval scores) grouped by fields such as `span_id` or `experiment_id`. + + At least one `compute` definition and one `index` must be provided. + operationId: AggregateLLMObsExperimentation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + aggregate: + compute: + - metric: score_value + name: avg_faithfulness + group_by: + - field: span_id + indexes: + - experiment-evals + search: + query: "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012 @label:faithfulness" + type: experimentation + schema: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsRequest" + description: Analytics payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + hit_count: 42 + result: + values: + - by: + span_id: span-7a1b2c3d + metrics: + avg_faithfulness: 0.87 + id: 00000000-0000-0000-0000-000000000001 + type: experimentation + schema: + $ref: "#/components/schemas/LLMObsExperimentationAnalyticsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Aggregate LLM Observability experimentation + tags: + - LLM Observability + 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/llm-obs/v1/experimentation/search: + post: + description: |- + Search across LLM Observability experimentation entities — projects, datasets, dataset records, experiments, and experiment runs — using cursor-based pagination. + + The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. + + Returns `200 OK` when all results fit in a single page. Returns `206 Partial Content` with a cursor in `meta.after` when additional pages are available. + operationId: SearchLLMObsExperimentation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + filter: + query: "@project_id:a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + scope: + - experiments + page: + limit: 50 + type: experimentation + schema: + $ref: "#/components/schemas/LLMObsExperimentationSearchRequest" + description: Experimentation search payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + experiments: + - created_at: "2024-01-01T00:00:00+00:00" + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + description: "" + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + name: My Experiment v1 + project_id: a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000001 + type: experimentation + meta: + after: + schema: + $ref: "#/components/schemas/LLMObsExperimentationSearchResponse" + description: OK — all results returned in a single page. + "206": + content: + application/json: + examples: + default: + value: + data: + attributes: + experiments: + - created_at: "2024-01-01T00:00:00+00:00" + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + description: "" + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + name: My Experiment v1 + project_id: a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000001 + type: experimentation + meta: + after: eyJpZCI6ImFiYzEyMyJ9 + schema: + $ref: "#/components/schemas/LLMObsExperimentationSearchResponse" + description: Partial Content — more results are available. Use `meta.after` as the next `page.cursor`. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search LLM Observability experimentation entities + tags: + - LLM Observability + 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/llm-obs/v1/experimentation/simple-search: + post: + description: |- + Search across LLM Observability experimentation entities using offset-based (page-number) pagination. + Use this endpoint when you need total page count or want to navigate to a specific page number. + + The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. + operationId: SimpleSearchLLMObsExperimentation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + filter: + query: "@project_id:a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + scope: + - experiments + page: + limit: 50 + number: 1 + sort: + - direction: desc + field: created_at + type: experimentation + schema: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchRequest" + description: Simple search payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + experiments: + - created_at: "2024-01-01T00:00:00+00:00" + description: "" + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + name: My Experiment v1 + project_id: a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000001 + type: experimentation + meta: + page: + current: 1 + limit: 50 + total_count: 63 + total_pages: 2 + schema: + $ref: "#/components/schemas/LLMObsExperimentationSimpleSearchResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Simple search experimentation entities + tags: + - LLM Observability + 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/llm-obs/v1/experiments: get: description: List all LLM Observability experiments sorted by creation date, newest first. @@ -112548,6 +123665,199 @@ paths: 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/llm-obs/v1/integrations/{integration}/accounts: + get: + description: Retrieve the list of configured accounts for the specified LLM provider integration. + operationId: ListLLMObsIntegrationAccounts + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - account_id: "org-XYZ123" + account_name: "Production OpenAI" + account_region: "" + id: "account-abc123" + integration: "openai" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationAccount" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration accounts + tags: + - LLM Observability + 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/llm-obs/v1/integrations/{integration}/{account_id}/inference: + post: + description: Run an LLM inference request through the specified integration and account, returning the model response and token usage. + operationId: CreateLLMObsIntegrationInference + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" + description: Inference request parameters. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + response: + assessment: "pass" + content: "The capital of France is Paris." + finish_reason: "stop" + inference_codes: [] + input_tokens: 15 + latency: 843 + output_tokens: 9 + tools: [] + total_tokens: 24 + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Run an LLM inference + tags: + - LLM Observability + 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/llm-obs/v1/integrations/{integration}/{account_id}/models: + get: + description: Retrieve the list of models available for the specified LLM provider integration and account. + operationId: ListLLMObsIntegrationModels + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - has_access: true + id: "gpt-4o" + integration: "openai" + integration_display_name: "OpenAI" + json_schema: true + model_display_name: "GPT-4o" + model_id: "gpt-4o" + provider: "openai" + provider_display_name: "OpenAI" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationModel" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration models + tags: + - LLM Observability + 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/llm-obs/v1/projects: get: description: List all LLM Observability projects sorted by creation date, newest first. @@ -112615,161 +123925,406 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM Observability projects + summary: List LLM Observability projects + tags: + - LLM Observability + 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/). + post: + description: Create a new LLM Observability project. Returns the existing project if a name conflict occurs. + operationId: CreateLLMObsProject + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: My LLM Project + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectRequest" + description: Create project payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000002 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + description: OK + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000003 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an LLM Observability project + tags: + - LLM Observability + 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/llm-obs/v1/projects/delete: + post: + description: Delete one or more LLM Observability projects. + operationId: DeleteLLMObsProjects + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + project_ids: + - a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + type: projects + schema: + $ref: "#/components/schemas/LLMObsDeleteProjectsRequest" + description: Delete projects payload. + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete LLM Observability projects + tags: + - LLM Observability + 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/llm-obs/v1/projects/{project_id}: + patch: + description: Partially update an existing LLM Observability project. + operationId: UpdateLLMObsProject + parameters: + - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectUpdateRequest" + description: Update project payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: "" + name: My LLM Project + updated_at: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000004 + type: projects + schema: + $ref: "#/components/schemas/LLMObsProjectResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update an LLM Observability project + tags: + - LLM Observability + 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/llm-obs/v1/spans/events: + get: + description: List LLM Observability spans matching the specified filters. + operationId: ListLLMObsSpans + parameters: + - description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + in: query + name: filter[from] + schema: + example: "now-900s" + type: string + - description: End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. + in: query + name: filter[to] + schema: + example: "now" + type: string + - description: >- + Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`filter[span_id]`, `filter[trace_id]`, etc.) are ignored. + in: query + name: filter[query] + schema: + example: "@session_id:abc123def456" + type: string + - description: Filter by exact span ID. + in: query + name: filter[span_id] + schema: + type: string + - description: Filter by exact trace ID. + in: query + name: filter[trace_id] + schema: + type: string + - description: Filter by span kind (e.g., llm, agent, tool, task, workflow). + in: query + name: filter[span_kind] + schema: + type: string + - description: Filter by span name. + in: query + name: filter[span_name] + schema: + type: string + - description: Filter by ML application name. + in: query + name: filter[ml_app] + schema: + type: string + - description: Maximum number of spans to return. Defaults to `10`. + in: query + name: page[limit] + schema: + format: int64 + type: integer + - description: Cursor from the previous response to retrieve the next page. + in: query + name: page[cursor] + schema: + type: string + - description: Sort order for the results. + in: query + name: sort + schema: + type: string + - description: Whether to include attachment data in the response. Defaults to `true`. + in: query + name: include_attachments + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + summary: List spans for an ML app + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done + session_id: + summary: List spans filtered by session ID + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + tags: + - "session_id:abc123def456" + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 87 + page: {} + request_id: req-def456 + status: done + schema: + $ref: "#/components/schemas/LLMObsSpansResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM Observability spans tags: - LLM Observability 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/llm-obs/v1/spans/events/search: post: - description: Create a new LLM Observability project. Returns the existing project if a name conflict occurs. - operationId: CreateLLMObsProject + description: Search LLM Observability spans using structured filters in the request body. + operationId: SearchLLMObsSpans requestBody: content: application/json: examples: default: + summary: Search spans for an ML app value: data: attributes: - name: My LLM Project - type: projects - schema: - $ref: "#/components/schemas/LLMObsProjectRequest" - description: Create project payload. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000002 - type: projects - schema: - $ref: "#/components/schemas/LLMObsProjectResponse" - description: OK - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000003 - type: projects - schema: - $ref: "#/components/schemas/LLMObsProjectResponse" - description: Created - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Create an LLM Observability project - tags: - - LLM Observability - 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/llm-obs/v1/projects/delete: - post: - description: Delete one or more LLM Observability projects. - operationId: DeleteLLMObsProjects - requestBody: - content: - application/json: - examples: - default: + filter: + from: "now-900s" + ml_app: "my-llm-app" + span_kind: "llm" + to: "now" + options: + include_attachments: true + page: + limit: 10 + type: spans + session_id: + summary: Search all spans in a session value: data: attributes: - project_ids: - - a33671aa-24fd-4dcd-9b33-a8ec7dde7751 - type: projects - schema: - $ref: "#/components/schemas/LLMObsDeleteProjectsRequest" - description: Delete projects payload. - required: true - responses: - "204": - description: No Content - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Delete LLM Observability projects - tags: - - LLM Observability - 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/llm-obs/v1/projects/{project_id}: - patch: - description: Partially update an existing LLM Observability project. - operationId: UpdateLLMObsProject - parameters: - - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - type: projects + filter: + from: "now-900s" + query: "@session_id:abc123def456" + to: "now" + options: + include_attachments: true + page: + limit: 50 + type: spans schema: - $ref: "#/components/schemas/LLMObsProjectUpdateRequest" - description: Update project payload. + $ref: "#/components/schemas/LLMObsSearchSpansRequest" + description: Search spans payload. required: true responses: "200": @@ -112779,15 +124334,26 @@ paths: default: value: data: - attributes: - created_at: "2024-01-01T00:00:00+00:00" - description: "" - name: My LLM Project - updated_at: "2024-01-01T00:00:00+00:00" - id: 00000000-0000-0000-0000-000000000004 - type: projects + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done schema: - $ref: "#/components/schemas/LLMObsProjectResponse" + $ref: "#/components/schemas/LLMObsSpansResponse" description: OK "400": content: @@ -112807,18 +124373,12 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update an LLM Observability project + summary: Search LLM Observability spans tags: - LLM Observability x-unstable: |- @@ -113282,30 +124842,184 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update LLM Observability dataset records + summary: Update LLM Observability dataset records + tags: + - LLM Observability + 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/). + post: + description: Append one or more records to an LLM Observability dataset. + operationId: CreateLLMObsDatasetRecords + parameters: + - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" + - $ref: "#/components/parameters/LLMObsDatasetIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + type: records + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsRequest" + description: Append records payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - records: + - created_at: "2024-01-01T00:00:00+00:00" + dataset_id: 00000000-0000-0000-0000-000000000024 + expected_output: + answer: "Paris" + id: 00000000-0000-0000-0000-000000000023 + input: + question: "What is the capital of France?" + metadata: + updated_at: "2024-01-01T00:00:00+00:00" + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" + description: OK + "201": + content: + application/json: + examples: + default: + value: + data: + - records: + - created_at: "2024-01-01T00:00:00+00:00" + dataset_id: 00000000-0000-0000-0000-000000000026 + expected_output: + answer: "Paris" + id: 00000000-0000-0000-0000-000000000025 + input: + question: "What is the capital of France?" + metadata: + updated_at: "2024-01-01T00:00:00+00:00" + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Append records to an LLM Observability dataset + tags: + - LLM Observability + 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/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete: + post: + description: Delete one or more records from an LLM Observability dataset. + operationId: DeleteLLMObsDatasetRecords + parameters: + - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" + - $ref: "#/components/parameters/LLMObsDatasetIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + record_ids: + - rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c + type: records + schema: + $ref: "#/components/schemas/LLMObsDeleteDatasetRecordsRequest" + description: Delete records payload. + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete LLM Observability dataset records tags: - LLM Observability 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/). - post: - description: Append one or more records to an LLM Observability dataset. - operationId: CreateLLMObsDatasetRecords + /api/v2/llm-obs/v3/experiments/{experiment_id}/events: + get: + description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. + operationId: ListLLMObsExperimentEvents parameters: - - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" - - $ref: "#/components/parameters/LLMObsDatasetIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - type: records - schema: - $ref: "#/components/schemas/LLMObsDatasetRecordsRequest" - description: Append records payload. - required: true + - $ref: "#/components/parameters/LLMObsExperimentIDPathParameter" + - description: Maximum number of spans to return per page. Defaults to 5000. + in: query + name: page[limit] + schema: + default: 5000 + format: int64 + type: integer + - description: Opaque cursor from a previous response to fetch the next page of results. + in: query + name: page[cursor] + schema: + type: string responses: "200": content: @@ -113314,39 +125028,25 @@ paths: default: value: data: - - records: - - created_at: "2024-01-01T00:00:00+00:00" - dataset_id: 00000000-0000-0000-0000-000000000024 - expected_output: - answer: "Paris" - id: 00000000-0000-0000-0000-000000000023 - input: - question: "What is the capital of France?" - metadata: - updated_at: "2024-01-01T00:00:00+00:00" + attributes: + spans: + - duration: 1500000000.0 + eval_metrics: [] + id: 00000000-0000-0000-0000-000000000002 + name: llm_call + span_id: span-7a1b2c3d + start_ns: 1705314600000000000 + status: ok + tags: [] + trace_id: abc123def456 + summary_metrics: [] + id: 00000000-0000-0000-0000-000000000001 + type: experiment_events + meta: + after: schema: - $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" + $ref: "#/components/schemas/LLMObsExperimentEventsV2Response" description: OK - "201": - content: - application/json: - examples: - default: - value: - data: - - records: - - created_at: "2024-01-01T00:00:00+00:00" - dataset_id: 00000000-0000-0000-0000-000000000026 - expected_output: - answer: "Paris" - id: 00000000-0000-0000-0000-000000000025 - input: - question: "What is the capital of France?" - metadata: - updated_at: "2024-01-01T00:00:00+00:00" - schema: - $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" - description: Created "400": content: application/json: @@ -113373,70 +125073,16 @@ paths: description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Append records to an LLM Observability dataset - tags: - - LLM Observability - 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/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete: - post: - description: Delete one or more records from an LLM Observability dataset. - operationId: DeleteLLMObsDatasetRecords - parameters: - - $ref: "#/components/parameters/LLMObsProjectIDPathParameter" - - $ref: "#/components/parameters/LLMObsDatasetIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - record_ids: - - rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c - type: records - schema: - $ref: "#/components/schemas/LLMObsDeleteDatasetRecordsRequest" - description: Delete records payload. - required: true - responses: - "204": - description: No Content - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": + "500": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" + description: Internal Server Error security: - apiKeyAuth: [] appKeyAuth: [] - summary: Delete LLM Observability dataset records + summary: List events for an LLM Observability experiment tags: - LLM Observability x-unstable: |- @@ -115575,6 +127221,199 @@ paths: operator: OR permissions: - logs_read_data + /api/v2/maintenance_windows: + get: + description: Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query. + operationId: ListMaintenanceWindows + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_read + summary: List maintenance windows + tags: + - Case Management + 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/). + post: + description: Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end). + operationId: CreateMaintenanceWindow + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowCreateRequest" + description: Maintenance window payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Create a maintenance window + tags: + - Case Management + 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/maintenance_windows/{maintenance_window_id}: + delete: + description: Permanently deletes a maintenance window. + operationId: DeleteMaintenanceWindow + parameters: + - $ref: "#/components/parameters/MaintenanceWindowIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Delete a maintenance window + tags: + - Case Management + 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/). + put: + description: Updates the name, query, start time, or end time of an existing maintenance window. + operationId: UpdateMaintenanceWindow + parameters: + - $ref: "#/components/parameters/MaintenanceWindowIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowUpdateRequest" + description: Maintenance window payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Update a maintenance window + tags: + - Case Management + 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/metrics: get: description: |- @@ -116576,6 +128415,947 @@ paths: "x-permission": operator: OPEN permissions: [] + /api/v2/model-lab-api/artifacts/content: + get: + description: Download the raw content of a Model Lab artifact file. + operationId: GetModelLabArtifactContent + parameters: + - description: ID of the project. + in: query + name: project_id + required: true + schema: + example: "1" + type: string + - description: Path to the artifact relative to the project directory. + in: query + name: artifact_path + required: true + schema: + example: runs/42/model/weights.pt + type: string + responses: + "200": + content: + application/octet-stream: + examples: + default: + value: "" + schema: + format: binary + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get Model Lab artifact content + tags: + - Model Lab API + 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/model-lab-api/facet-keys: + get: + description: List all available facet keys for filtering Model Lab runs. + operationId: ListModelLabRunFacetKeys + parameters: + - description: Filter by project ID. + in: query + name: filter[project_id] + required: true + schema: + example: 101 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + metrics: + - accuracy + - loss + parameters: + - learning_rate + - algorithm + tags: + - model + - stage + id: "1" + type: facet_keys + schema: + $ref: "#/components/schemas/ModelLabFacetKeysResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab run facet keys + tags: + - Model Lab API + 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/model-lab-api/facet-values: + get: + description: List available facet values for a specific run facet key. + operationId: ListModelLabRunFacetValues + parameters: + - description: Filter by project ID. + in: query + name: filter[project_id] + required: true + schema: + example: 101 + format: int64 + type: integer + - description: "Facet type. Valid values: parameter, attribute, tag, metric." + in: query + name: facet_type + required: true + schema: + $ref: "#/components/schemas/ModelLabFacetType" + - description: Facet name. + in: query + name: facet_name + required: true + schema: + example: algorithm + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + facet_name: algorithm + facet_type: parameter + values: + - gpt4 + - dbscan + id: "1" + type: facet_values + schema: + $ref: "#/components/schemas/ModelLabFacetValuesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab run facet values + tags: + - Model Lab API + 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/model-lab-api/project-facet-keys: + get: + description: List all available facet keys for filtering Model Lab projects. + operationId: ListModelLabProjectFacetKeys + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + metrics: [] + parameters: [] + tags: + - model + - stage + id: "1" + type: facet_keys + schema: + $ref: "#/components/schemas/ModelLabFacetKeysResponse" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab project facet keys + tags: + - Model Lab API + 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/model-lab-api/project-facet-values: + get: + description: List available facet values for a specific project facet key. + operationId: ListModelLabProjectFacetValues + parameters: + - description: "Facet type. Valid values: tag." + in: query + name: facet_type + required: true + schema: + $ref: "#/components/schemas/ModelLabProjectFacetType" + - description: Facet name. + in: query + name: facet_name + required: true + schema: + example: model + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + facet_name: model + facet_type: tag + values: + - opus + - gpt4 + id: "1" + type: facet_values + schema: + $ref: "#/components/schemas/ModelLabFacetValuesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab project facet values + tags: + - Model Lab API + 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/model-lab-api/projects: + get: + description: List all Model Lab projects for the current organization. + operationId: ListModelLabProjects + parameters: + - description: Text search filter for project name or description. + in: query + name: filter + required: false + schema: + type: string + - description: Filter by owner UUID. + in: query + name: filter[owner_id] + required: false + schema: + format: uuid + type: string + - description: "Filter by tags. Format: key:value,key2:value2." + in: query + name: filter[tags] + required: false + schema: + type: string + - description: "Sort field. Valid values: name, created_at, updated_at. Prefix with '-' for descending order (e.g., -updated_at)." + in: query + name: sort + required: false + schema: + default: "-updated_at" + type: string + - description: Number of items per page. Maximum is 100. + in: query + name: page[size] + required: false + schema: + default: 25 + maximum: 100 + type: integer + - description: Page number (1-indexed). + in: query + name: page[number] + required: false + schema: + default: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + artifact_storage_location: s3://bucket/active-project + created_at: "2024-01-20T10:00:00Z" + description: A machine learning training project. + is_starred: false + name: active-project + tags: + - key: model + value: opus + updated_at: "2024-01-20T11:00:00Z" + id: "2" + type: projects + meta: + page: + number: 1 + size: 25 + total: 1 + schema: + $ref: "#/components/schemas/ModelLabProjectsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab projects + tags: + - Model Lab API + 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/model-lab-api/projects/{project_id}: + get: + description: Get a single Model Lab project by its ID. + operationId: GetModelLabProject + parameters: + - $ref: "#/components/parameters/ModelLabProjectIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + artifact_storage_location: s3://bucket/active-project + created_at: "2024-01-20T10:00:00Z" + description: A machine learning training project. + is_starred: false + name: active-project + tags: + - key: model + value: opus + updated_at: "2024-01-20T11:00:00Z" + id: "2" + type: projects + schema: + $ref: "#/components/schemas/ModelLabProjectResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get a Model Lab project + tags: + - Model Lab API + 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/model-lab-api/projects/{project_id}/artifacts: + get: + description: List all artifact files for a specific Model Lab project. + operationId: ListModelLabProjectArtifacts + parameters: + - $ref: "#/components/parameters/ModelLabProjectIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + files: + - artifact_path: projects/1/artifacts/model.pkl + created_at: "2024-01-20T10:00:00Z" + file_size: 204800 + filename: model.pkl + id: "1" + type: project_files + schema: + $ref: "#/components/schemas/ModelLabProjectArtifactsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab project artifacts + tags: + - Model Lab API + 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/model-lab-api/projects/{project_id}/star: + delete: + description: Remove the star from a Model Lab project for the current user. + operationId: UnstarModelLabProject + parameters: + - $ref: "#/components/parameters/ModelLabProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Remove star from a Model Lab project + tags: + - Model Lab API + 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/). + post: + description: Star a Model Lab project for the current user. + operationId: StarModelLabProject + parameters: + - $ref: "#/components/parameters/ModelLabProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Star a Model Lab project + tags: + - Model Lab API + 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/model-lab-api/runs: + get: + description: List all Model Lab runs for the current organization. + operationId: ListModelLabRuns + parameters: + - description: Filter by run ID(s). Comma-separated list for multiple IDs. + in: query + name: filter[id] + required: false + schema: + type: string + - description: Text search filter for run name or description. + in: query + name: filter + required: false + schema: + type: string + - description: Filter by owner UUID. + in: query + name: filter[owner_id] + required: false + schema: + type: string + - description: "Filter by run status. Valid values: pending, running, completed, failed, killed, unresponsive, paused." + in: query + name: filter[status] + required: false + schema: + $ref: "#/components/schemas/ModelLabRunStatus" + - description: Filter by project ID. + in: query + name: filter[project_id] + required: false + schema: + format: int64 + type: integer + - description: "Filter by tags. Format: key:value,key2:value2." + in: query + name: filter[tags] + required: false + schema: + type: string + - description: "Filter by params. Format: key:value,key2:>0.5,key3:true." + in: query + name: filter[params] + required: false + schema: + type: string + - description: Filter by parent run ID. Use 'null' to return only root runs (runs with no parent). + in: query + name: filter[parent_run_id] + required: false + schema: + type: string + - description: Sort pinned runs before non-pinned runs. Pinned runs are ordered by pin time descending. + in: query + name: pinned_first + required: false + schema: + type: boolean + - description: Include all runs pinned by the current user, regardless of other filters. + in: query + name: include_pinned + required: false + schema: + type: boolean + - description: When true, also return runs whose descendants match the active filters. The descendant_match field in each result indicates whether the run was included via a descendant match. + in: query + name: include_descendant_matches + required: false + schema: + type: boolean + - description: "Sort field. Valid values: name, created_at, updated_at, duration. Prefix with '-' for descending order (e.g., -updated_at)." + in: query + name: sort + required: false + schema: + default: "-updated_at" + type: string + - description: Number of items per page. Maximum is 100. + in: query + name: page[size] + required: false + schema: + default: 25 + maximum: 100 + type: integer + - description: Page number (1-indexed). + in: query + name: page[number] + required: false + schema: + default: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-20T10:00:00Z" + descendant_match: false + description: Fine-tuning run with custom hyperparameters. + has_children: false + is_pinned: false + metric_summaries: [] + mlflow_artifact_location: s3://bucket/active-run + name: active-run + params: + - key: algorithm + value: gpt4 + project_id: 101 + started_at: "2024-01-20T10:00:00Z" + status: running + tags: + - key: model + value: opus + updated_at: "2024-01-20T11:00:00Z" + id: "2" + type: runs + meta: + page: + number: 1 + size: 25 + total: 1 + schema: + $ref: "#/components/schemas/ModelLabRunsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab runs + tags: + - Model Lab API + 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/model-lab-api/runs/{run_id}: + delete: + description: Delete a Model Lab run by its ID. + operationId: DeleteModelLabRun + parameters: + - $ref: "#/components/parameters/ModelLabRunIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Delete a Model Lab run + tags: + - Model Lab API + 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/). + get: + description: Get a single Model Lab run by its ID. + operationId: GetModelLabRun + parameters: + - $ref: "#/components/parameters/ModelLabRunIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-20T10:00:00Z" + descendant_match: false + description: Fine-tuning run with custom hyperparameters. + has_children: false + is_pinned: false + metric_summaries: [] + mlflow_artifact_location: s3://bucket/active-run + name: active-run + params: + - key: algorithm + value: gpt4 + project_id: 101 + started_at: "2024-01-20T10:00:00Z" + status: running + tags: + - key: model + value: opus + updated_at: "2024-01-20T11:00:00Z" + id: "2" + type: runs + schema: + $ref: "#/components/schemas/ModelLabRunResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get a Model Lab run + tags: + - Model Lab API + 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/model-lab-api/runs/{run_id}/artifacts: + get: + description: List artifact files for a specific Model Lab run. + operationId: ListModelLabRunArtifacts + parameters: + - $ref: "#/components/parameters/ModelLabRunIDPathParameter" + - description: Optional subdirectory path within the run's artifacts. + in: query + name: path + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + files: + - file_size: 204800 + is_dir: false + path: model/weights.pt + - is_dir: true + path: model + path_in_project: runs/42 + id: "42" + type: artifacts + schema: + $ref: "#/components/schemas/ModelLabRunArtifactsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List Model Lab run artifacts + tags: + - Model Lab API + 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/model-lab-api/runs/{run_id}/pin: + delete: + description: Remove the pin from a Model Lab run for the current user. + operationId: UnpinModelLabRun + parameters: + - $ref: "#/components/parameters/ModelLabRunIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Unpin a Model Lab run + tags: + - Model Lab API + 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/). + post: + description: Pin a Model Lab run for the current user. + operationId: PinModelLabRun + parameters: + - $ref: "#/components/parameters/ModelLabRunIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Pin a Model Lab run + tags: + - Model Lab API + 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/monitor/notification_rule: get: description: Returns a list of all monitor notification rules. @@ -129352,6 +142132,121 @@ paths: summary: List all scorecards tags: - Scorecards + /api/v2/scorecard/scores/{aggregation}: + get: + description: Returns a list of scorecard scores for each aggregation type, with score breakdowns. + operationId: ListScorecardScores + parameters: + - description: The type of scores being requested. + in: path + name: aggregation + required: true + schema: + $ref: "#/components/schemas/ScorecardScoresAggregation" + - description: Filter scores by rule ID(s), comma-separated. + in: query + name: filter[rule][id] + required: false + schema: + type: string + - description: Filter scores by rule name. + in: query + name: filter[rule][name] + required: false + schema: + type: string + - description: Filter scores by rule level(s), comma-separated. + in: query + name: filter[rule][level] + required: false + schema: + type: string + - description: Filter scores by scorecard ID(s), comma-separated. + in: query + name: filter[rule][scorecard_id] + required: false + schema: + type: string + - description: Filter scores to show only custom rules. + in: query + name: filter[rule][is_custom] + required: false + schema: + type: boolean + - description: Filter scores to show only enabled rules. + in: query + name: filter[rule][is_enabled] + required: false + schema: + type: boolean + - description: "Sort scores by field. Use a hyphen prefix for descending order. Options: score, numerator, denominator, total_pass, total_fail, total_skip, total_no_data." + in: query + name: sort + required: false + schema: + type: string + - description: Offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + type: integer + - description: Number of scores to return. Max is 1000. + in: query + name: page[limit] + required: false + schema: + default: 100 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + aggregation: by-entity + denominator: 4 + numerator: 3 + score: 0.75 + total_fail: 1 + total_no_data: 0 + total_pass: 3 + total_skip: 0 + id: service:my-service + relationships: + entity: + data: + id: service:my-service + type: entity + type: score + links: + next: /api/v2/scorecard/scores/by-entity?page[offset]=100&page[limit]=100 + meta: + count: 1 + limit: 100 + offset: 0 + total: 42 + schema: + $ref: "#/components/schemas/ListScorecardScoresResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: List all scores + tags: + - Scorecards /api/v2/seats/users: delete: description: |- @@ -132410,6 +145305,355 @@ paths: summary: Update a critical asset tags: - Security Monitoring + /api/v2/security_monitoring/configuration/integration_config: + get: + description: |- + List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud SIEM + to an external source that provides entities (for example, users from an identity provider) for use + in signals and the entity explorer. + operationId: ListSecurityMonitoringIntegrationConfigs + parameters: + - description: Filter the entity context sync configurations by source type. + in: query + name: filter[integration_type] + required: false + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: List entity context sync configurations + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_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/). + post: + description: |- + Create a new entity context sync configuration so Cloud SIEM can ingest entities from an external + source. The credentials provided in `secrets` are validated against the source before the configuration + is stored and never returned in subsequent responses. + operationId: CreateSecurityMonitoringIntegrationConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain: siem-test.com + integration_type: GOOGLE_WORKSPACE + name: My GWS Integration + secrets: + admin_email: test@example.com + settings: + setting1: value1 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateRequest" + description: The definition of the new integration configuration. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Create an entity context sync configuration + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + 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/security_monitoring/configuration/integration_config/validate: + post: + description: |- + Validate a set of credentials against the external entity source before creating a sync configuration. + Returns a 200 status code if the credentials are valid. + operationId: ValidateSecurityMonitoringIntegrationCredentials + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain: siem-test.com + integration_type: GOOGLE_WORKSPACE + secrets: + admin_email: test@example.com + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateRequest" + description: The credentials to validate. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Validate entity context sync credentials + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - integrations_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/security_monitoring/configuration/integration_config/{integration_config_id}: + delete: + description: |- + Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, + and the credentials stored for the configuration are removed from the secrets store. + operationId: DeleteSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Delete an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - manage_integrations + 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/). + get: + description: Get the details of a specific entity context sync configuration. + operationId: GetSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Get an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_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/). + patch: + description: Update an existing entity context sync configuration. Supports partial updates; only the fields provided in the request body are modified. + operationId: UpdateSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + name: My GWS Integration (renamed) + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateRequest" + description: The fields to update on the integration configuration. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: false + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-08T12:00:00Z" + name: My GWS Integration (renamed) + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Update an entity context sync configuration + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + 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/security_monitoring/configuration/integration_config/{integration_config_id}/validate: + post: + description: |- + Validate the credentials currently stored on an existing entity context sync configuration. + Returns a 200 status code if the credentials are still valid against the external entity source. + operationId: ValidateSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Validate an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_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/security_monitoring/configuration/security_filters: get: description: Get the list of configured security filters with their definitions. @@ -132522,6 +145766,53 @@ paths: operator: OR permissions: - security_monitoring_filters_write + /api/v2/security_monitoring/configuration/security_filters/versions: + get: + description: |- + Get the configured security filters at each historical version of the configuration. + Each entry in the response represents the set of all security filters at a given version, + ordered from the most recent version to the oldest. + operationId: ListSecurityFilterVersions + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + date: 1758177253469 + filters: + - exclusion_filters: [] + filtered_data_type: logs + id: "123" + is_builtin: false + is_enabled: true + name: Test Security Filter + query: source:test + version: 1 + version: 1 + id: "1" + type: security_filters_configuration + schema: + $ref: "#/components/schemas/SecurityFilterVersionsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + summary: Get the version history of security filters + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_read /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}: delete: description: Delete a specific security filter. @@ -132833,6 +146124,7 @@ paths: hardcodedEvaluatorType: log4shell impossibleTravelOptions: baselineUserLocations: true + baselineUserLocationsDuration: 7 newValueOptions: instantaneousBaseline: false learningMethod: duration @@ -133301,6 +146593,113 @@ paths: 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/security_monitoring/entity_context: + get: + description: |- + Search the Cloud SIEM entity context store for entities that match a query, and return the historical + revisions of each entity in the requested time range. The endpoint can either return revisions across an + interval (`from` / `to`) or the snapshot of each entity at a single point in time (`as_of`); the two modes + are mutually exclusive. + operationId: GetEntityContext + parameters: + - description: A free-text query (for example, an email address or principal ID) used to filter the entities returned. + example: user@example.com + in: query + name: query + required: false + schema: + type: string + - description: |- + The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`). + Defaults to `now-7d`. Ignored when `as_of` is set. + in: query + name: from + required: false + schema: + default: now-7d + example: now-7d + type: string + - description: |- + The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`). + Defaults to `now`. Ignored when `as_of` is set. + in: query + name: to + required: false + schema: + default: now + example: now + type: string + - description: |- + A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp + (in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored. + Cannot be combined with custom `from` / `to` values. + example: now-1d + in: query + name: as_of + required: false + schema: + type: string + - description: The maximum number of entities to return. + in: query + name: limit + required: false + schema: + default: 250 + example: 100 + format: int64 + type: integer + - description: An opaque token used to fetch the next page of results, as returned in `meta.page.next_token` of a previous response. + in: query + name: page_token + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + revisions: + - attributes: + display_name: Test User + emails: + - user@example.com + principal_id: user@example.com + first_seen_at: "2026-04-01T00:00:00Z" + last_seen_at: "2026-05-01T00:00:00Z" + id: user@example.com + type: siem_entity_identity + meta: + page: + next_token: "" + total_count: 1 + schema: + $ref: "#/components/schemas/EntityContextResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - siem_entities_read + summary: Get entity context + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - siem_entities_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/security_monitoring/rules: get: description: List rules. @@ -133589,6 +146988,7 @@ paths: hardcodedEvaluatorType: log4shell impossibleTravelOptions: baselineUserLocations: true + baselineUserLocationsDuration: 7 keepAlive: 3600 maxSignalDuration: 86400 newValueOptions: @@ -133690,6 +147090,7 @@ paths: hardcodedEvaluatorType: log4shell impossibleTravelOptions: baselineUserLocations: true + baselineUserLocationsDuration: 7 keepAlive: 0 maxSignalDuration: 0 newValueOptions: @@ -133803,6 +147204,7 @@ paths: hardcodedEvaluatorType: log4shell impossibleTravelOptions: baselineUserLocations: true + baselineUserLocationsDuration: 7 keepAlive: 1800 maxSignalDuration: 1800 newValueOptions: @@ -134173,6 +147575,282 @@ paths: - security_monitoring_rules_read x-unstable: |- **Note**: This endpoint is in beta and may be subject to changes. + /api/v2/security_monitoring/sample_log_generation/subscriptions: + get: + description: |- + Get the sample log generation subscriptions for the organization. + Sample log generation injects representative example logs for a given Cloud SIEM content pack into the Logs platform, + which can be used to test detection rules without onboarding the underlying integration first. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an eligible + pricing model. Other organizations receive a `403 Forbidden` (non-trial orgs) or a `400 Bad Request` + (feature disabled), and legacy pricing tiers receive a response with `status: not_available`. + operationId: ListSampleLogGenerationSubscriptions + parameters: + - description: |- + Filter the subscriptions by status. Use `active` to return only currently active + subscriptions, or `all` to return every subscription including expired ones. + Ignored when `start_timestamp` is provided. Defaults to `active`. + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsStatusFilter" + - description: |- + The start of the time range, as an RFC3339 timestamp. When provided, the response includes + every subscription that was active at any point in `[start_timestamp, end_timestamp]`, + and the `status` filter is ignored. + example: "2026-05-01T00:00:00Z" + in: query + name: start_timestamp + required: false + schema: + format: date-time + type: string + - description: |- + The end of the time range, as an RFC3339 timestamp. Ignored unless `start_timestamp` is set. + Defaults to the current time when `start_timestamp` is provided. + example: "2026-05-08T00:00:00Z" + in: query + name: end_timestamp + required: false + schema: + format: date-time + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-11T20:02:13.77481Z" + is_active: true + status: subscribed + id: "999" + type: subscriptions + meta: + total_subscriptions: 1 + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + - logs_read_index_data + summary: Get sample log generation subscriptions + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_read + - logs_read_index_data + 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/). + post: + description: |- + Subscribe to sample log generation for a Cloud SIEM content pack. Sample logs for the + requested content pack are injected into the Logs platform for the duration of the subscription, + so detection rules can be exercised without onboarding the underlying integration first. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + operationId: CreateSampleLogGenerationSubscription + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + duration: 3d + type: subscription_requests + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateRequest" + description: The content pack to subscribe to and the desired duration of the subscription. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-11T20:02:13.77481Z" + is_active: true + status: subscribed + id: "789" + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Subscribe to sample log generation + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + 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/security_monitoring/sample_log_generation/subscriptions/bulk: + post: + description: |- + Subscribe to sample log generation for multiple Cloud SIEM content packs in a single call. + Each requested content pack is processed independently; the response includes a per-item + status so partial successes can be inspected. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive per-item responses with `status: not_available`. + operationId: BulkCreateSampleLogGenerationSubscriptions + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_ids: + - aws-cloudtrail + duration: 3d + type: bulk_subscription_requests + schema: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionRequest" + description: The content packs to subscribe to and the desired duration of the subscriptions. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.655716Z" + expires_at: "2026-05-11T20:02:13.655716Z" + is_active: true + status: subscribed + id: "123" + meta: + status: 200 + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Bulk subscribe to sample log generation + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + 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/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}: + delete: + description: |- + Unsubscribe from sample log generation for a Cloud SIEM content pack. + After unsubscribing, no more sample logs are generated for the requested content pack. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + operationId: DeleteSampleLogGenerationSubscription + parameters: + - $ref: "#/components/parameters/SampleLogGenerationContentPackID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-08T20:30:00Z" + is_active: false + status: unsubscribed + id: "789" + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Unsubscribe from sample log generation + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + 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/security_monitoring/signals: get: description: |- @@ -134593,6 +148271,61 @@ paths: operator: OR permissions: - security_monitoring_signals_write + /api/v2/security_monitoring/signals/{signal_id}/entities: + get: + description: Get the list of entities related to a security signal, captured at the signal's timestamp. + operationId: GetSignalEntities + parameters: + - $ref: "#/components/parameters/SignalID" + - description: The maximum number of entities to return. + in: query + name: limit + required: false + schema: + default: 10 + example: 10 + format: int32 + maximum: 1000 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + identities: + - display_name: Test User + principal_id: user@example.com + id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: entities + schema: + $ref: "#/components/schemas/SignalEntitiesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_signals_read + summary: Get entities related to a signal + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_signals_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/security_monitoring/signals/{signal_id}/incidents: patch: description: |- @@ -140441,6 +154174,7 @@ paths: operator: AND permissions: - synthetics_write + - synthetics_default_settings_write /api/v2/synthetics/downtimes/{downtime_id}: delete: description: Delete a Synthetics downtime by its ID. @@ -140483,6 +154217,7 @@ paths: operator: AND permissions: - synthetics_write + - synthetics_default_settings_write get: description: Get a Synthetics downtime by its ID. operationId: GetSyntheticsDowntime @@ -140656,6 +154391,7 @@ paths: operator: AND permissions: - synthetics_write + - synthetics_default_settings_write /api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}: delete: description: Disassociate a Synthetics test from a downtime. @@ -145034,6 +158770,34 @@ paths: operator: OR permissions: - teams_read + /api/v2/test-examples: + get: + description: Get a list of all test examples. + operationId: ListTestExamples + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "abc-123" + name: "My Test Example" + schema: + $ref: "#/components/schemas/TestExamplesResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List test examples + tags: + - Test Examples + x-permission: + operator: OR + permissions: + - test_read /api/v2/test/flaky-test-management/tests: patch: description: |- @@ -148009,6 +161773,12 @@ tags: - description: |- Retrieve and analyze code coverage data from Code Coverage. See the [Code Coverage page](https://docs.datadoghq.com/code_coverage/) for more information. name: Code Coverage + - description: |- + Datadog Cloud Security Misconfigurations provides aggregated views of + compliance rules and findings across your cloud resources, helping you assess + posture against industry frameworks (such as HIPAA, SOC 2, ISO 27001) and custom + frameworks. Learn more at https://docs.datadoghq.com/security/cloud_security_management/misconfigurations/#maintain-compliance-with-industry-frameworks-and-benchmarks. + name: "Compliance" - description: |- Manage your Datadog Confluent Cloud integration accounts and account resources directly through the Datadog API. See the [Confluent Cloud page](https://docs.datadoghq.com/integrations/confluent_cloud/) for more information. name: Confluent Cloud @@ -148038,6 +161808,12 @@ tags: - **Embed** sharing must be enabled under **Organization Settings** > **Public Sharing** > **Shared Dashboards**. - You need [an API key and an application key](https://docs.datadoghq.com/account_management/api-app-keys/) to interact with these endpoints. name: Dashboard Secure Embed + - description: |- + Get usage statistics for the dashboards in your organization, including view + counts, last-edit times, widget counts, and quality scores. See the + [Dashboards documentation](https://docs.datadoghq.com/dashboards/) for more + information. + name: Dashboards - description: |- The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. name: Data Deletion @@ -148062,8 +161838,6 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes - - description: Endpoints for receiving email transport webhook events for audit trail processing. - name: Email Transport - description: Retrieves security risk scores for entities in your organization. name: Entity Risk Scores - description: View and manage issues within Error Tracking. See the [Error Tracking page](https://docs.datadoghq.com/error_tracking/) for more information. @@ -148140,7 +161914,7 @@ tags: description: Find out more at url: "https://docs.datadoghq.com/account_management/api-app-keys/" name: Key Management - - description: Manage LLM Observability projects, datasets, dataset records, experiments, and annotations. + - description: Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, and annotations. name: LLM Observability - description: |- Search your logs and send them to your Datadog platform over HTTP. See the [Log Management page](https://docs.datadoghq.com/logs/) for more information. @@ -148213,6 +161987,8 @@ tags: description: For more information about the Datadog Microsoft Teams integration, see the integration page. url: https://docs.datadoghq.com/integrations/microsoft_teams/ name: Microsoft Teams Integration + - description: Manage Model Lab projects, runs, artifacts, and facets for ML experiment tracking. + name: Model Lab API - description: |- [Monitors](https://docs.datadoghq.com/monitors) allow you to watch a metric or check that you care about and notifies your team when a defined threshold has exceeded. @@ -148395,6 +162171,8 @@ tags: name: Synthetics - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams + - description: Manage test example resources. + name: Test Examples - description: |- Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information. name: Test Optimization diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index ab63d5b81f0..7cee388bb6a 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -654,287 +654,378 @@ func NewConfiguration() *Configuration { }, }, unstableOperations: map[string]bool{ - "v2.CancelFleetDeployment": false, - "v2.CreateFleetDeploymentConfigure": false, - "v2.CreateFleetDeploymentUpgrade": false, - "v2.CreateFleetSchedule": false, - "v2.DeleteFleetSchedule": false, - "v2.GetFleetAgentInfo": false, - "v2.GetFleetDeployment": false, - "v2.GetFleetSchedule": false, - "v2.ListFleetAgents": false, - "v2.ListFleetAgentTracers": false, - "v2.ListFleetAgentVersions": false, - "v2.ListFleetClusters": false, - "v2.ListFleetDeployments": false, - "v2.ListFleetInstrumentedPods": false, - "v2.ListFleetSchedules": false, - "v2.ListFleetTracers": false, - "v2.TriggerFleetSchedule": false, - "v2.UpdateFleetSchedule": false, - "v2.CreateLLMObsAnnotationQueue": false, - "v2.CreateLLMObsAnnotationQueueInteractions": false, - "v2.CreateLLMObsDataset": false, - "v2.CreateLLMObsDatasetRecords": false, - "v2.CreateLLMObsExperiment": false, - "v2.CreateLLMObsExperimentEvents": false, - "v2.CreateLLMObsProject": false, - "v2.DeleteLLMObsAnnotationQueue": false, - "v2.DeleteLLMObsAnnotationQueueInteractions": false, - "v2.DeleteLLMObsCustomEvalConfig": false, - "v2.DeleteLLMObsDatasetRecords": false, - "v2.DeleteLLMObsDatasets": false, - "v2.DeleteLLMObsExperiments": false, - "v2.DeleteLLMObsProjects": false, - "v2.GetLLMObsAnnotatedInteractions": false, - "v2.GetLLMObsAnnotationQueueLabelSchema": false, - "v2.GetLLMObsCustomEvalConfig": false, - "v2.ListLLMObsAnnotationQueues": false, - "v2.ListLLMObsDatasetRecords": false, - "v2.ListLLMObsDatasets": false, - "v2.ListLLMObsExperiments": false, - "v2.ListLLMObsProjects": false, - "v2.UpdateLLMObsAnnotationQueue": false, - "v2.UpdateLLMObsAnnotationQueueLabelSchema": false, - "v2.UpdateLLMObsCustomEvalConfig": false, - "v2.UpdateLLMObsDataset": false, - "v2.UpdateLLMObsDatasetRecords": false, - "v2.UpdateLLMObsExperiment": false, - "v2.UpdateLLMObsProject": false, - "v2.AnonymizeUsers": false, - "v2.Validate": false, - "v2.CreateOpenAPI": false, - "v2.DeleteOpenAPI": false, - "v2.GetOpenAPI": false, - "v2.ListAPIs": false, - "v2.UpdateOpenAPI": false, - "v2.GetInvestigation": false, - "v2.ListInvestigations": false, - "v2.TriggerInvestigation": false, - "v2.CreateCaseJiraIssue": false, - "v2.CreateCaseNotebook": false, - "v2.CreateCaseServiceNowTicket": false, - "v2.LinkIncident": false, - "v2.LinkJiraIssueToCase": false, - "v2.MoveCaseToProject": false, - "v2.UnlinkJiraIssue": false, - "v2.CreateChangeRequest": false, - "v2.CreateChangeRequestBranch": false, - "v2.DeleteChangeRequestDecision": false, - "v2.GetChangeRequest": false, - "v2.UpdateChangeRequest": false, - "v2.UpdateChangeRequestDecision": false, - "v2.CreateAWSCloudAuthPersonaMapping": false, - "v2.DeleteAWSCloudAuthPersonaMapping": false, - "v2.GetAWSCloudAuthPersonaMapping": false, - "v2.ListAWSCloudAuthPersonaMappings": false, - "v2.ActivateContentPack": false, - "v2.BulkExportSecurityMonitoringTerraformResources": false, - "v2.CancelHistoricalJob": false, - "v2.ConvertJobResultToSignal": false, - "v2.ConvertSecurityMonitoringTerraformResource": false, - "v2.DeactivateContentPack": false, - "v2.DeleteHistoricalJob": false, - "v2.ExportSecurityMonitoringTerraformResource": false, - "v2.GetContentPacksStates": false, - "v2.GetFinding": false, - "v2.GetHistoricalJob": false, - "v2.GetIndicatorOfCompromise": false, - "v2.GetRuleVersionHistory": false, - "v2.GetSecretsRules": false, - "v2.GetSecurityMonitoringHistsignal": false, - "v2.GetSecurityMonitoringHistsignalsByJobId": false, - "v2.ListFindings": false, - "v2.ListHistoricalJobs": false, - "v2.ListIndicatorsOfCompromise": false, - "v2.ListMultipleRulesets": false, - "v2.ListScannedAssetsMetadata": false, - "v2.ListSecurityMonitoringHistsignals": false, - "v2.ListVulnerabilities": false, - "v2.ListVulnerableAssets": false, - "v2.MuteFindings": false, - "v2.MuteSecurityFindings": false, - "v2.RunHistoricalJob": false, - "v2.SearchSecurityMonitoringHistsignals": false, - "v2.GetCodeCoverageBranchSummary": false, - "v2.GetCodeCoverageCommitSummary": false, - "v2.GetCostAnomaly": false, - "v2.ListCostAnomalies": false, - "v2.CreateDashboardSecureEmbed": false, - "v2.DeleteDashboardSecureEmbed": false, - "v2.GetDashboardSecureEmbed": false, - "v2.UpdateDashboardSecureEmbed": false, - "v2.CreateDataset": false, - "v2.DeleteDataset": false, - "v2.GetAllDatasets": false, - "v2.GetDataset": false, - "v2.UpdateDataset": false, - "v2.CancelDataDeletionRequest": false, - "v2.CreateDataDeletionRequest": false, - "v2.GetDataDeletionRequests": false, - "v2.CreateDeploymentGate": false, - "v2.CreateDeploymentRule": false, - "v2.DeleteDeploymentGate": false, - "v2.DeleteDeploymentRule": false, - "v2.GetDeploymentGate": false, - "v2.GetDeploymentGateRules": false, - "v2.GetDeploymentGatesEvaluationResult": false, - "v2.GetDeploymentRule": false, - "v2.ListDeploymentGates": false, - "v2.TriggerDeploymentGatesEvaluation": false, - "v2.UpdateDeploymentGate": false, - "v2.UpdateDeploymentRule": false, - "v2.CreateEmailTransportWebhookIntake": false, - "v2.CreateHamrOrgConnection": false, - "v2.GetHamrOrgConnection": false, - "v2.CreateGlobalIncidentHandle": false, - "v2.CreateIncident": false, - "v2.CreateIncidentAttachment": false, - "v2.CreateIncidentIntegration": false, - "v2.CreateIncidentNotificationRule": false, - "v2.CreateIncidentNotificationTemplate": false, - "v2.CreateIncidentPostmortemAttachment": false, - "v2.CreateIncidentPostmortemTemplate": false, - "v2.CreateIncidentTodo": false, - "v2.CreateIncidentType": false, - "v2.CreateIncidentUserDefinedField": false, - "v2.DeleteGlobalIncidentHandle": false, - "v2.DeleteIncident": false, - "v2.DeleteIncidentAttachment": false, - "v2.DeleteIncidentIntegration": false, - "v2.DeleteIncidentNotificationRule": false, - "v2.DeleteIncidentNotificationTemplate": false, - "v2.DeleteIncidentPostmortemTemplate": false, - "v2.DeleteIncidentTodo": false, - "v2.DeleteIncidentType": false, - "v2.DeleteIncidentUserDefinedField": false, - "v2.GetGlobalIncidentSettings": false, - "v2.GetIncident": false, - "v2.GetIncidentIntegration": false, - "v2.GetIncidentNotificationRule": false, - "v2.GetIncidentNotificationTemplate": false, - "v2.GetIncidentPostmortemTemplate": false, - "v2.GetIncidentTodo": false, - "v2.GetIncidentType": false, - "v2.GetIncidentUserDefinedField": false, - "v2.ImportIncident": false, - "v2.ListGlobalIncidentHandles": false, - "v2.ListIncidentAttachments": false, - "v2.ListIncidentIntegrations": false, - "v2.ListIncidentNotificationRules": false, - "v2.ListIncidentNotificationTemplates": false, - "v2.ListIncidentPostmortemTemplates": false, - "v2.ListIncidents": false, - "v2.ListIncidentTodos": false, - "v2.ListIncidentTypes": false, - "v2.ListIncidentUserDefinedFields": false, - "v2.SearchIncidents": false, - "v2.UpdateGlobalIncidentHandle": false, - "v2.UpdateGlobalIncidentSettings": false, - "v2.UpdateIncident": false, - "v2.UpdateIncidentAttachment": false, - "v2.UpdateIncidentIntegration": false, - "v2.UpdateIncidentNotificationRule": false, - "v2.UpdateIncidentNotificationTemplate": false, - "v2.UpdateIncidentPostmortemTemplate": false, - "v2.UpdateIncidentTodo": false, - "v2.UpdateIncidentType": false, - "v2.UpdateIncidentUserDefinedField": false, - "v2.CreateAWSAccountCCMConfig": false, - "v2.DeleteAWSAccountCCMConfig": false, - "v2.GetAWSAccountCCMConfig": false, - "v2.UpdateAWSAccountCCMConfig": false, - "v2.CreateJiraIssueTemplate": false, - "v2.DeleteJiraAccount": false, - "v2.DeleteJiraIssueTemplate": false, - "v2.GetJiraIssueTemplate": false, - "v2.ListJiraAccounts": false, - "v2.ListJiraIssueTemplates": false, - "v2.UpdateJiraIssueTemplate": false, - "v2.CreateTenancyConfig": false, - "v2.GetTenancyConfigs": false, - "v2.AddRoleToRestrictionQuery": false, - "v2.CreateRestrictionQuery": false, - "v2.DeleteRestrictionQuery": false, - "v2.GetRestrictionQuery": false, - "v2.GetRoleRestrictionQuery": false, - "v2.ListRestrictionQueries": false, - "v2.ListRestrictionQueryRoles": false, - "v2.ListUserRestrictionQueries": false, - "v2.RemoveRoleFromRestrictionQuery": false, - "v2.ReplaceRestrictionQuery": false, - "v2.UpdateRestrictionQuery": false, - "v2.CreateMonitorUserTemplate": false, - "v2.DeleteMonitorUserTemplate": false, - "v2.GetMonitorUserTemplate": false, - "v2.ListMonitorUserTemplates": false, - "v2.UpdateMonitorUserTemplate": false, - "v2.ValidateExistingMonitorUserTemplate": false, - "v2.ValidateMonitorUserTemplate": false, - "v2.BulkUpdateOrgGroupMemberships": false, - "v2.CreateOrgGroup": false, - "v2.CreateOrgGroupPolicy": false, - "v2.CreateOrgGroupPolicyOverride": false, - "v2.DeleteOrgGroup": false, - "v2.DeleteOrgGroupPolicy": false, - "v2.DeleteOrgGroupPolicyOverride": false, - "v2.GetOrgGroup": false, - "v2.GetOrgGroupMembership": false, - "v2.GetOrgGroupPolicy": false, - "v2.GetOrgGroupPolicyOverride": false, - "v2.ListOrgGroupMemberships": false, - "v2.ListOrgGroupPolicies": false, - "v2.ListOrgGroupPolicyConfigs": false, - "v2.ListOrgGroupPolicyOverrides": false, - "v2.ListOrgGroups": false, - "v2.UpdateOrgGroup": false, - "v2.UpdateOrgGroupMembership": false, - "v2.UpdateOrgGroupPolicy": false, - "v2.UpdateOrgGroupPolicyOverride": false, - "v2.ListRoleTemplates": false, - "v2.CreateConnection": false, - "v2.DeleteConnection": false, - "v2.GetAccountFacetInfo": false, - "v2.GetMapping": false, - "v2.GetUserFacetInfo": false, - "v2.ListConnections": false, - "v2.QueryAccounts": false, - "v2.QueryEventFilteredUsers": false, - "v2.QueryUsers": false, - "v2.UpdateConnection": false, - "v2.CreateScorecardOutcomesBatch": false, - "v2.ListEntityRiskScores": false, - "v2.CreateIncidentService": false, - "v2.DeleteIncidentService": false, - "v2.GetIncidentService": false, - "v2.ListIncidentServices": false, - "v2.UpdateIncidentService": false, - "v2.CreateSLOReportJob": false, - "v2.GetSLOReport": false, - "v2.GetSLOReportJobStatus": false, - "v2.GetSloStatus": false, - "v2.GetSPARecommendations": false, - "v2.GetSPARecommendationsWithShard": false, - "v2.CreateCustomRule": false, - "v2.CreateCustomRuleRevision": false, - "v2.CreateSCAResolveVulnerableSymbols": false, - "v2.CreateSCAResult": false, - "v2.DeleteCustomRule": false, - "v2.DeleteCustomRuleset": false, - "v2.GetCustomRule": false, - "v2.GetCustomRuleRevision": false, - "v2.GetCustomRuleset": false, - "v2.ListCustomRuleRevisions": false, - "v2.RevertCustomRuleRevision": false, - "v2.UpdateCustomRuleset": false, - "v2.AddMemberTeam": false, - "v2.ListMemberTeams": false, - "v2.RemoveMemberTeam": false, - "v2.CreateWebIntegrationAccount": false, - "v2.DeleteWebIntegrationAccount": false, - "v2.GetWebIntegrationAccount": false, - "v2.ListWebIntegrationAccounts": false, - "v2.UpdateWebIntegrationAccount": false, + "v2.CancelFleetDeployment": false, + "v2.CreateFleetDeploymentConfigure": false, + "v2.CreateFleetDeploymentUpgrade": false, + "v2.CreateFleetSchedule": false, + "v2.DeleteFleetSchedule": false, + "v2.GetFleetAgentInfo": false, + "v2.GetFleetDeployment": false, + "v2.GetFleetSchedule": false, + "v2.ListFleetAgents": false, + "v2.ListFleetAgentTracers": false, + "v2.ListFleetAgentVersions": false, + "v2.ListFleetClusters": false, + "v2.ListFleetDeployments": false, + "v2.ListFleetInstrumentedPods": false, + "v2.ListFleetSchedules": false, + "v2.ListFleetTracers": false, + "v2.TriggerFleetSchedule": false, + "v2.UpdateFleetSchedule": false, + "v2.AggregateLLMObsExperimentation": false, + "v2.CreateLLMObsAnnotationQueue": false, + "v2.CreateLLMObsAnnotationQueueInteractions": false, + "v2.CreateLLMObsDataset": false, + "v2.CreateLLMObsDatasetRecords": false, + "v2.CreateLLMObsExperiment": false, + "v2.CreateLLMObsExperimentEvents": false, + "v2.CreateLLMObsIntegrationInference": false, + "v2.CreateLLMObsProject": false, + "v2.DeleteLLMObsAnnotationQueue": false, + "v2.DeleteLLMObsAnnotationQueueInteractions": false, + "v2.DeleteLLMObsCustomEvalConfig": false, + "v2.DeleteLLMObsData": false, + "v2.DeleteLLMObsDatasetRecords": false, + "v2.DeleteLLMObsDatasets": false, + "v2.DeleteLLMObsExperiments": false, + "v2.DeleteLLMObsProjects": false, + "v2.GetLLMObsAnnotatedInteractions": false, + "v2.GetLLMObsAnnotationQueueLabelSchema": false, + "v2.GetLLMObsCustomEvalConfig": false, + "v2.ListLLMObsAnnotationQueues": false, + "v2.ListLLMObsDatasetRecords": false, + "v2.ListLLMObsDatasets": false, + "v2.ListLLMObsExperimentEvents": false, + "v2.ListLLMObsExperiments": false, + "v2.ListLLMObsIntegrationAccounts": false, + "v2.ListLLMObsIntegrationModels": false, + "v2.ListLLMObsProjects": false, + "v2.ListLLMObsSpans": false, + "v2.SearchLLMObsExperimentation": false, + "v2.SearchLLMObsSpans": false, + "v2.SimpleSearchLLMObsExperimentation": false, + "v2.UpdateLLMObsAnnotationQueue": false, + "v2.UpdateLLMObsAnnotationQueueLabelSchema": false, + "v2.UpdateLLMObsCustomEvalConfig": false, + "v2.UpdateLLMObsDataset": false, + "v2.UpdateLLMObsDatasetRecords": false, + "v2.UpdateLLMObsExperiment": false, + "v2.UpdateLLMObsProject": false, + "v2.AnonymizeUsers": false, + "v2.Validate": false, + "v2.CreateOpenAPI": false, + "v2.DeleteOpenAPI": false, + "v2.GetOpenAPI": false, + "v2.ListAPIs": false, + "v2.UpdateOpenAPI": false, + "v2.GetInvestigation": false, + "v2.ListInvestigations": false, + "v2.TriggerInvestigation": false, + "v2.AddCaseInsights": false, + "v2.AggregateCases": false, + "v2.BulkUpdateCases": false, + "v2.CountCases": false, + "v2.CreateCaseAutomationRule": false, + "v2.CreateCaseJiraIssue": false, + "v2.CreateCaseLink": false, + "v2.CreateCaseNotebook": false, + "v2.CreateCaseServiceNowTicket": false, + "v2.CreateCaseView": false, + "v2.CreateMaintenanceWindow": false, + "v2.DeleteCaseAutomationRule": false, + "v2.DeleteCaseLink": false, + "v2.DeleteCaseView": false, + "v2.DeleteMaintenanceWindow": false, + "v2.DisableCaseAutomationRule": false, + "v2.EnableCaseAutomationRule": false, + "v2.FavoriteCaseProject": false, + "v2.GetCaseAutomationRule": false, + "v2.GetCaseView": false, + "v2.LinkIncident": false, + "v2.LinkJiraIssueToCase": false, + "v2.ListCaseAutomationRules": false, + "v2.ListCaseLinks": false, + "v2.ListCaseTimeline": false, + "v2.ListCaseViews": false, + "v2.ListCaseWatchers": false, + "v2.ListMaintenanceWindows": false, + "v2.ListUserCaseProjectFavorites": false, + "v2.MoveCaseToProject": false, + "v2.RemoveCaseInsights": false, + "v2.UnfavoriteCaseProject": false, + "v2.UnlinkJiraIssue": false, + "v2.UnwatchCase": false, + "v2.UpdateCaseAutomationRule": false, + "v2.UpdateCaseComment": false, + "v2.UpdateCaseDueDate": false, + "v2.UpdateCaseResolvedReason": false, + "v2.UpdateCaseView": false, + "v2.UpdateMaintenanceWindow": false, + "v2.WatchCase": false, + "v2.UpdateCaseType": false, + "v2.UpdateCustomAttributeConfig": false, + "v2.CreateChangeRequest": false, + "v2.CreateChangeRequestBranch": false, + "v2.DeleteChangeRequestDecision": false, + "v2.GetChangeRequest": false, + "v2.UpdateChangeRequest": false, + "v2.UpdateChangeRequestDecision": false, + "v2.CreateAWSCloudAuthPersonaMapping": false, + "v2.DeleteAWSCloudAuthPersonaMapping": false, + "v2.GetAWSCloudAuthPersonaMapping": false, + "v2.ListAWSCloudAuthPersonaMappings": false, + "v2.ActivateContentPack": false, + "v2.BulkCreateSampleLogGenerationSubscriptions": false, + "v2.BulkExportSecurityMonitoringTerraformResources": false, + "v2.CancelHistoricalJob": false, + "v2.ConvertJobResultToSignal": false, + "v2.ConvertSecurityMonitoringTerraformResource": false, + "v2.CreateSampleLogGenerationSubscription": false, + "v2.CreateSecurityMonitoringIntegrationConfig": false, + "v2.DeactivateContentPack": false, + "v2.DeleteHistoricalJob": false, + "v2.DeleteSampleLogGenerationSubscription": false, + "v2.DeleteSecurityMonitoringIntegrationConfig": false, + "v2.ExportSecurityMonitoringTerraformResource": false, + "v2.GetContentPacksStates": false, + "v2.GetEntityContext": false, + "v2.GetFinding": false, + "v2.GetHistoricalJob": false, + "v2.GetIndicatorOfCompromise": false, + "v2.GetRuleVersionHistory": false, + "v2.GetSecretsRules": false, + "v2.GetSecurityMonitoringHistsignal": false, + "v2.GetSecurityMonitoringHistsignalsByJobId": false, + "v2.GetSecurityMonitoringIntegrationConfig": false, + "v2.GetSignalEntities": false, + "v2.ListFindings": false, + "v2.ListHistoricalJobs": false, + "v2.ListIndicatorsOfCompromise": false, + "v2.ListMultipleRulesets": false, + "v2.ListSampleLogGenerationSubscriptions": false, + "v2.ListScannedAssetsMetadata": false, + "v2.ListSecurityMonitoringHistsignals": false, + "v2.ListSecurityMonitoringIntegrationConfigs": false, + "v2.ListVulnerabilities": false, + "v2.ListVulnerableAssets": false, + "v2.MuteFindings": false, + "v2.MuteSecurityFindings": false, + "v2.RunHistoricalJob": false, + "v2.SearchSecurityMonitoringHistsignals": false, + "v2.UpdateSecurityMonitoringIntegrationConfig": false, + "v2.ValidateSecurityMonitoringIntegrationConfig": false, + "v2.ValidateSecurityMonitoringIntegrationCredentials": false, + "v2.GetCodeCoverageBranchSummary": false, + "v2.GetCodeCoverageCommitSummary": false, + "v2.GetRuleBasedView": false, + "v2.GetCommitmentsCommitmentList": false, + "v2.GetCommitmentsCoverageScalar": false, + "v2.GetCommitmentsCoverageTimeseries": false, + "v2.GetCommitmentsOnDemandHotspotsScalar": false, + "v2.GetCommitmentsSavingsScalar": false, + "v2.GetCommitmentsSavingsTimeseries": false, + "v2.GetCommitmentsUtilizationScalar": false, + "v2.GetCommitmentsUtilizationTimeseries": false, + "v2.GetCostAnomaly": false, + "v2.GetCostTagMetadataCurrency": false, + "v2.ListCostAnomalies": false, + "v2.ListCostTagKeySources": false, + "v2.ListCostTagMetadata": false, + "v2.ListCostTagMetadataMetrics": false, + "v2.ListCostTagMetadataOrchestrators": false, + "v2.SearchCostRecommendations": false, + "v2.CreateDashboardSecureEmbed": false, + "v2.DeleteDashboardSecureEmbed": false, + "v2.GetDashboardSecureEmbed": false, + "v2.UpdateDashboardSecureEmbed": false, + "v2.GetDashboardUsage": false, + "v2.ListDashboardsUsage": false, + "v2.CreateDataset": false, + "v2.DeleteDataset": false, + "v2.GetAllDatasets": false, + "v2.GetDataset": false, + "v2.UpdateDataset": false, + "v2.CancelDataDeletionRequest": false, + "v2.CreateDataDeletionRequest": false, + "v2.GetDataDeletionRequests": false, + "v2.CreateDeploymentGate": false, + "v2.CreateDeploymentRule": false, + "v2.DeleteDeploymentGate": false, + "v2.DeleteDeploymentRule": false, + "v2.GetDeploymentGate": false, + "v2.GetDeploymentGateRules": false, + "v2.GetDeploymentGatesEvaluationResult": false, + "v2.GetDeploymentRule": false, + "v2.ListDeploymentGates": false, + "v2.TriggerDeploymentGatesEvaluation": false, + "v2.UpdateDeploymentGate": false, + "v2.UpdateDeploymentRule": false, + "v2.CreateHamrOrgConnection": false, + "v2.GetHamrOrgConnection": false, + "v2.CreateGlobalIncidentHandle": false, + "v2.CreateIncident": false, + "v2.CreateIncidentAttachment": false, + "v2.CreateIncidentIntegration": false, + "v2.CreateIncidentNotificationRule": false, + "v2.CreateIncidentNotificationTemplate": false, + "v2.CreateIncidentPostmortemAttachment": false, + "v2.CreateIncidentPostmortemTemplate": false, + "v2.CreateIncidentTodo": false, + "v2.CreateIncidentType": false, + "v2.CreateIncidentUserDefinedField": false, + "v2.DeleteGlobalIncidentHandle": false, + "v2.DeleteIncident": false, + "v2.DeleteIncidentAttachment": false, + "v2.DeleteIncidentIntegration": false, + "v2.DeleteIncidentNotificationRule": false, + "v2.DeleteIncidentNotificationTemplate": false, + "v2.DeleteIncidentPostmortemTemplate": false, + "v2.DeleteIncidentTodo": false, + "v2.DeleteIncidentType": false, + "v2.DeleteIncidentUserDefinedField": false, + "v2.GetGlobalIncidentSettings": false, + "v2.GetIncident": false, + "v2.GetIncidentIntegration": false, + "v2.GetIncidentNotificationRule": false, + "v2.GetIncidentNotificationTemplate": false, + "v2.GetIncidentPostmortemTemplate": false, + "v2.GetIncidentTodo": false, + "v2.GetIncidentType": false, + "v2.GetIncidentUserDefinedField": false, + "v2.ImportIncident": false, + "v2.ListGlobalIncidentHandles": false, + "v2.ListIncidentAttachments": false, + "v2.ListIncidentIntegrations": false, + "v2.ListIncidentNotificationRules": false, + "v2.ListIncidentNotificationTemplates": false, + "v2.ListIncidentPostmortemTemplates": false, + "v2.ListIncidents": false, + "v2.ListIncidentTodos": false, + "v2.ListIncidentTypes": false, + "v2.ListIncidentUserDefinedFields": false, + "v2.SearchIncidents": false, + "v2.UpdateGlobalIncidentHandle": false, + "v2.UpdateGlobalIncidentSettings": false, + "v2.UpdateIncident": false, + "v2.UpdateIncidentAttachment": false, + "v2.UpdateIncidentIntegration": false, + "v2.UpdateIncidentNotificationRule": false, + "v2.UpdateIncidentNotificationTemplate": false, + "v2.UpdateIncidentPostmortemTemplate": false, + "v2.UpdateIncidentTodo": false, + "v2.UpdateIncidentType": false, + "v2.UpdateIncidentUserDefinedField": false, + "v2.CreateAWSAccountCCMConfig": false, + "v2.DeleteAWSAccountCCMConfig": false, + "v2.GetAWSAccountCCMConfig": false, + "v2.UpdateAWSAccountCCMConfig": false, + "v2.CreateJiraIssueTemplate": false, + "v2.DeleteJiraAccount": false, + "v2.DeleteJiraIssueTemplate": false, + "v2.GetJiraIssueTemplate": false, + "v2.ListJiraAccounts": false, + "v2.ListJiraIssueTemplates": false, + "v2.UpdateJiraIssueTemplate": false, + "v2.CreateTenancyConfig": false, + "v2.GetTenancyConfigs": false, + "v2.AddRoleToRestrictionQuery": false, + "v2.CreateRestrictionQuery": false, + "v2.DeleteRestrictionQuery": false, + "v2.GetRestrictionQuery": false, + "v2.GetRoleRestrictionQuery": false, + "v2.ListRestrictionQueries": false, + "v2.ListRestrictionQueryRoles": false, + "v2.ListUserRestrictionQueries": false, + "v2.RemoveRoleFromRestrictionQuery": false, + "v2.ReplaceRestrictionQuery": false, + "v2.UpdateRestrictionQuery": false, + "v2.DeleteModelLabRun": false, + "v2.GetModelLabArtifactContent": false, + "v2.GetModelLabProject": false, + "v2.GetModelLabRun": false, + "v2.ListModelLabProjectArtifacts": false, + "v2.ListModelLabProjectFacetKeys": false, + "v2.ListModelLabProjectFacetValues": false, + "v2.ListModelLabProjects": false, + "v2.ListModelLabRunArtifacts": false, + "v2.ListModelLabRunFacetKeys": false, + "v2.ListModelLabRunFacetValues": false, + "v2.ListModelLabRuns": false, + "v2.PinModelLabRun": false, + "v2.StarModelLabProject": false, + "v2.UnpinModelLabRun": false, + "v2.UnstarModelLabProject": false, + "v2.CreateMonitorUserTemplate": false, + "v2.DeleteMonitorUserTemplate": false, + "v2.GetMonitorUserTemplate": false, + "v2.ListMonitorUserTemplates": false, + "v2.UpdateMonitorUserTemplate": false, + "v2.ValidateExistingMonitorUserTemplate": false, + "v2.ValidateMonitorUserTemplate": false, + "v2.BulkUpdateOrgGroupMemberships": false, + "v2.CreateOrgGroup": false, + "v2.CreateOrgGroupPolicy": false, + "v2.CreateOrgGroupPolicyOverride": false, + "v2.DeleteOrgGroup": false, + "v2.DeleteOrgGroupPolicy": false, + "v2.DeleteOrgGroupPolicyOverride": false, + "v2.GetOrgGroup": false, + "v2.GetOrgGroupMembership": false, + "v2.GetOrgGroupPolicy": false, + "v2.GetOrgGroupPolicyOverride": false, + "v2.ListOrgGroupMemberships": false, + "v2.ListOrgGroupPolicies": false, + "v2.ListOrgGroupPolicyConfigs": false, + "v2.ListOrgGroupPolicyOverrides": false, + "v2.ListOrgGroups": false, + "v2.UpdateOrgGroup": false, + "v2.UpdateOrgGroupMembership": false, + "v2.UpdateOrgGroupPolicy": false, + "v2.UpdateOrgGroupPolicyOverride": false, + "v2.ListRoleTemplates": false, + "v2.CreateConnection": false, + "v2.DeleteConnection": false, + "v2.GetAccountFacetInfo": false, + "v2.GetMapping": false, + "v2.GetUserFacetInfo": false, + "v2.ListConnections": false, + "v2.QueryAccounts": false, + "v2.QueryEventFilteredUsers": false, + "v2.QueryUsers": false, + "v2.UpdateConnection": false, + "v2.CreateScorecardOutcomesBatch": false, + "v2.ListEntityRiskScores": false, + "v2.CreateIncidentService": false, + "v2.DeleteIncidentService": false, + "v2.GetIncidentService": false, + "v2.ListIncidentServices": false, + "v2.UpdateIncidentService": false, + "v2.CreateSLOReportJob": false, + "v2.GetSLOReport": false, + "v2.GetSLOReportJobStatus": false, + "v2.GetSloStatus": false, + "v2.GetSPARecommendations": false, + "v2.GetSPARecommendationsWithShard": false, + "v2.CreateCustomRule": false, + "v2.CreateCustomRuleRevision": false, + "v2.CreateSCAResolveVulnerableSymbols": false, + "v2.CreateSCAResult": false, + "v2.DeleteCustomRule": false, + "v2.DeleteCustomRuleset": false, + "v2.GetCustomRule": false, + "v2.GetCustomRuleRevision": false, + "v2.GetCustomRuleset": false, + "v2.ListCustomRuleRevisions": false, + "v2.RevertCustomRuleRevision": false, + "v2.UpdateCustomRuleset": false, + "v2.AddMemberTeam": false, + "v2.ListMemberTeams": false, + "v2.RemoveMemberTeam": false, + "v2.CreateWebIntegrationAccount": false, + "v2.DeleteWebIntegrationAccount": false, + "v2.GetWebIntegrationAccount": false, + "v2.ListWebIntegrationAccounts": false, + "v2.UpdateWebIntegrationAccount": false, }, RetryConfiguration: RetryConfiguration{ EnableRetry: false, diff --git a/api/datadogV1/model_formula_and_function_events_data_source.go b/api/datadogV1/model_formula_and_function_events_data_source.go index ab7376fe550..7afbf9f1793 100644 --- a/api/datadogV1/model_formula_and_function_events_data_source.go +++ b/api/datadogV1/model_formula_and_function_events_data_source.go @@ -28,6 +28,7 @@ const ( FORMULAANDFUNCTIONEVENTSDATASOURCE_INCIDENT_ANALYTICS FormulaAndFunctionEventsDataSource = "incident_analytics" FORMULAANDFUNCTIONEVENTSDATASOURCE_PRODUCT_ANALYTICS FormulaAndFunctionEventsDataSource = "product_analytics" FORMULAANDFUNCTIONEVENTSDATASOURCE_ON_CALL_EVENTS FormulaAndFunctionEventsDataSource = "on_call_events" + FORMULAANDFUNCTIONEVENTSDATASOURCE_ERRORS FormulaAndFunctionEventsDataSource = "errors" ) var allowedFormulaAndFunctionEventsDataSourceEnumValues = []FormulaAndFunctionEventsDataSource{ @@ -44,6 +45,7 @@ var allowedFormulaAndFunctionEventsDataSourceEnumValues = []FormulaAndFunctionEv FORMULAANDFUNCTIONEVENTSDATASOURCE_INCIDENT_ANALYTICS, FORMULAANDFUNCTIONEVENTSDATASOURCE_PRODUCT_ANALYTICS, FORMULAANDFUNCTIONEVENTSDATASOURCE_ON_CALL_EVENTS, + FORMULAANDFUNCTIONEVENTSDATASOURCE_ERRORS, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV1/model_logs_exclude_attribute_processor.go b/api/datadogV1/model_logs_exclude_attribute_processor.go new file mode 100644 index 00000000000..83ee8d5d806 --- /dev/null +++ b/api/datadogV1/model_logs_exclude_attribute_processor.go @@ -0,0 +1,221 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LogsExcludeAttributeProcessor Use this processor to remove an attribute from a log during processing. +// The processor strips the specified attribute from the log event, which is useful +// when the attribute contains sensitive data or is no longer needed downstream. +type LogsExcludeAttributeProcessor struct { + // Name of the log attribute to remove from the log event. + AttributeToExclude string `json:"attribute_to_exclude"` + // Whether or not the processor is enabled. + IsEnabled *bool `json:"is_enabled,omitempty"` + // Name of the processor. + Name *string `json:"name,omitempty"` + // Type of logs exclude attribute processor. + Type LogsExcludeAttributeProcessorType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLogsExcludeAttributeProcessor instantiates a new LogsExcludeAttributeProcessor object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLogsExcludeAttributeProcessor(attributeToExclude string, typeVar LogsExcludeAttributeProcessorType) *LogsExcludeAttributeProcessor { + this := LogsExcludeAttributeProcessor{} + this.AttributeToExclude = attributeToExclude + var isEnabled bool = false + this.IsEnabled = &isEnabled + this.Type = typeVar + return &this +} + +// NewLogsExcludeAttributeProcessorWithDefaults instantiates a new LogsExcludeAttributeProcessor object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLogsExcludeAttributeProcessorWithDefaults() *LogsExcludeAttributeProcessor { + this := LogsExcludeAttributeProcessor{} + var isEnabled bool = false + this.IsEnabled = &isEnabled + var typeVar LogsExcludeAttributeProcessorType = LOGSEXCLUDEATTRIBUTEPROCESSORTYPE_EXCLUDE_ATTRIBUTE + this.Type = typeVar + return &this +} + +// GetAttributeToExclude returns the AttributeToExclude field value. +func (o *LogsExcludeAttributeProcessor) GetAttributeToExclude() string { + if o == nil { + var ret string + return ret + } + return o.AttributeToExclude +} + +// GetAttributeToExcludeOk returns a tuple with the AttributeToExclude field value +// and a boolean to check if the value has been set. +func (o *LogsExcludeAttributeProcessor) GetAttributeToExcludeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AttributeToExclude, true +} + +// SetAttributeToExclude sets field value. +func (o *LogsExcludeAttributeProcessor) SetAttributeToExclude(v string) { + o.AttributeToExclude = v +} + +// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise. +func (o *LogsExcludeAttributeProcessor) GetIsEnabled() bool { + if o == nil || o.IsEnabled == nil { + var ret bool + return ret + } + return *o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogsExcludeAttributeProcessor) GetIsEnabledOk() (*bool, bool) { + if o == nil || o.IsEnabled == nil { + return nil, false + } + return o.IsEnabled, true +} + +// HasIsEnabled returns a boolean if a field has been set. +func (o *LogsExcludeAttributeProcessor) HasIsEnabled() bool { + return o != nil && o.IsEnabled != nil +} + +// SetIsEnabled gets a reference to the given bool and assigns it to the IsEnabled field. +func (o *LogsExcludeAttributeProcessor) SetIsEnabled(v bool) { + o.IsEnabled = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LogsExcludeAttributeProcessor) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogsExcludeAttributeProcessor) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LogsExcludeAttributeProcessor) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LogsExcludeAttributeProcessor) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value. +func (o *LogsExcludeAttributeProcessor) GetType() LogsExcludeAttributeProcessorType { + if o == nil { + var ret LogsExcludeAttributeProcessorType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LogsExcludeAttributeProcessor) GetTypeOk() (*LogsExcludeAttributeProcessorType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LogsExcludeAttributeProcessor) SetType(v LogsExcludeAttributeProcessorType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LogsExcludeAttributeProcessor) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attribute_to_exclude"] = o.AttributeToExclude + if o.IsEnabled != nil { + toSerialize["is_enabled"] = o.IsEnabled + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LogsExcludeAttributeProcessor) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AttributeToExclude *string `json:"attribute_to_exclude"` + IsEnabled *bool `json:"is_enabled,omitempty"` + Name *string `json:"name,omitempty"` + Type *LogsExcludeAttributeProcessorType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AttributeToExclude == nil { + return fmt.Errorf("required field attribute_to_exclude missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attribute_to_exclude", "is_enabled", "name", "type"}) + } else { + return err + } + + hasInvalidField := false + o.AttributeToExclude = *all.AttributeToExclude + o.IsEnabled = all.IsEnabled + o.Name = all.Name + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV1/model_logs_exclude_attribute_processor_type.go b/api/datadogV1/model_logs_exclude_attribute_processor_type.go new file mode 100644 index 00000000000..a2691ee8c34 --- /dev/null +++ b/api/datadogV1/model_logs_exclude_attribute_processor_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LogsExcludeAttributeProcessorType Type of logs exclude attribute processor. +type LogsExcludeAttributeProcessorType string + +// List of LogsExcludeAttributeProcessorType. +const ( + LOGSEXCLUDEATTRIBUTEPROCESSORTYPE_EXCLUDE_ATTRIBUTE LogsExcludeAttributeProcessorType = "exclude-attribute" +) + +var allowedLogsExcludeAttributeProcessorTypeEnumValues = []LogsExcludeAttributeProcessorType{ + LOGSEXCLUDEATTRIBUTEPROCESSORTYPE_EXCLUDE_ATTRIBUTE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LogsExcludeAttributeProcessorType) GetAllowedValues() []LogsExcludeAttributeProcessorType { + return allowedLogsExcludeAttributeProcessorTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LogsExcludeAttributeProcessorType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LogsExcludeAttributeProcessorType(value) + return nil +} + +// NewLogsExcludeAttributeProcessorTypeFromValue returns a pointer to a valid LogsExcludeAttributeProcessorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLogsExcludeAttributeProcessorTypeFromValue(v string) (*LogsExcludeAttributeProcessorType, error) { + ev := LogsExcludeAttributeProcessorType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LogsExcludeAttributeProcessorType: valid values are %v", v, allowedLogsExcludeAttributeProcessorTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LogsExcludeAttributeProcessorType) IsValid() bool { + for _, existing := range allowedLogsExcludeAttributeProcessorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LogsExcludeAttributeProcessorType value. +func (v LogsExcludeAttributeProcessorType) Ptr() *LogsExcludeAttributeProcessorType { + return &v +} diff --git a/api/datadogV1/model_logs_processor.go b/api/datadogV1/model_logs_processor.go index a9ae203005e..3345e46d850 100644 --- a/api/datadogV1/model_logs_processor.go +++ b/api/datadogV1/model_logs_processor.go @@ -30,6 +30,7 @@ type LogsProcessor struct { LogsArrayProcessor *LogsArrayProcessor LogsDecoderProcessor *LogsDecoderProcessor LogsSchemaProcessor *LogsSchemaProcessor + LogsExcludeAttributeProcessor *LogsExcludeAttributeProcessor // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -135,6 +136,11 @@ func LogsSchemaProcessorAsLogsProcessor(v *LogsSchemaProcessor) LogsProcessor { return LogsProcessor{LogsSchemaProcessor: v} } +// LogsExcludeAttributeProcessorAsLogsProcessor is a convenience function that returns LogsExcludeAttributeProcessor wrapped in LogsProcessor. +func LogsExcludeAttributeProcessorAsLogsProcessor(v *LogsExcludeAttributeProcessor) LogsProcessor { + return LogsProcessor{LogsExcludeAttributeProcessor: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *LogsProcessor) UnmarshalJSON(data []byte) error { var err error @@ -479,6 +485,23 @@ func (obj *LogsProcessor) UnmarshalJSON(data []byte) error { obj.LogsSchemaProcessor = nil } + // try to unmarshal data into LogsExcludeAttributeProcessor + err = datadog.Unmarshal(data, &obj.LogsExcludeAttributeProcessor) + if err == nil { + if obj.LogsExcludeAttributeProcessor != nil && obj.LogsExcludeAttributeProcessor.UnparsedObject == nil { + jsonLogsExcludeAttributeProcessor, _ := datadog.Marshal(obj.LogsExcludeAttributeProcessor) + if string(jsonLogsExcludeAttributeProcessor) == "{}" { // empty struct + obj.LogsExcludeAttributeProcessor = nil + } else { + match++ + } + } else { + obj.LogsExcludeAttributeProcessor = nil + } + } else { + obj.LogsExcludeAttributeProcessor = nil + } + if match != 1 { // more than 1 match // reset to nil obj.LogsGrokParser = nil @@ -501,6 +524,7 @@ func (obj *LogsProcessor) UnmarshalJSON(data []byte) error { obj.LogsArrayProcessor = nil obj.LogsDecoderProcessor = nil obj.LogsSchemaProcessor = nil + obj.LogsExcludeAttributeProcessor = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -588,6 +612,10 @@ func (obj LogsProcessor) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.LogsSchemaProcessor) } + if obj.LogsExcludeAttributeProcessor != nil { + return datadog.Marshal(&obj.LogsExcludeAttributeProcessor) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -676,6 +704,10 @@ func (obj *LogsProcessor) GetActualInstance() interface{} { return obj.LogsSchemaProcessor } + if obj.LogsExcludeAttributeProcessor != nil { + return obj.LogsExcludeAttributeProcessor + } + // all schemas are nil return nil } diff --git a/api/datadogV1/model_monitor_formula_and_function_data_jobs_query_definition.go b/api/datadogV1/model_monitor_formula_and_function_data_jobs_query_definition.go new file mode 100644 index 00000000000..3ccd77a5b95 --- /dev/null +++ b/api/datadogV1/model_monitor_formula_and_function_data_jobs_query_definition.go @@ -0,0 +1,200 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MonitorFormulaAndFunctionDataJobsQueryDefinition A formula and functions data jobs query. +type MonitorFormulaAndFunctionDataJobsQueryDefinition struct { + // The type of job being monitored. Valid values include: + // `databricks.job`, `spark.application`, `airflow.dag`, + // `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. + // Custom job types are supported with the `custom.ol.` prefix. + JobType string `json:"job_type"` + // Filter expression used to select the jobs to monitor. + JobsQuery string `json:"jobs_query"` + // Name of the query for use in formulas. Must be `run_query`. + Name string `json:"name"` + // Query dialect for data jobs queries. Currently only `metric` is supported. + QueryDialect string `json:"query_dialect"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMonitorFormulaAndFunctionDataJobsQueryDefinition instantiates a new MonitorFormulaAndFunctionDataJobsQueryDefinition object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMonitorFormulaAndFunctionDataJobsQueryDefinition(jobType string, jobsQuery string, name string, queryDialect string) *MonitorFormulaAndFunctionDataJobsQueryDefinition { + this := MonitorFormulaAndFunctionDataJobsQueryDefinition{} + this.JobType = jobType + this.JobsQuery = jobsQuery + this.Name = name + this.QueryDialect = queryDialect + return &this +} + +// NewMonitorFormulaAndFunctionDataJobsQueryDefinitionWithDefaults instantiates a new MonitorFormulaAndFunctionDataJobsQueryDefinition object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMonitorFormulaAndFunctionDataJobsQueryDefinitionWithDefaults() *MonitorFormulaAndFunctionDataJobsQueryDefinition { + this := MonitorFormulaAndFunctionDataJobsQueryDefinition{} + return &this +} + +// GetJobType returns the JobType field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetJobType() string { + if o == nil { + var ret string + return ret + } + return o.JobType +} + +// GetJobTypeOk returns a tuple with the JobType field value +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetJobTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JobType, true +} + +// SetJobType sets field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) SetJobType(v string) { + o.JobType = v +} + +// GetJobsQuery returns the JobsQuery field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetJobsQuery() string { + if o == nil { + var ret string + return ret + } + return o.JobsQuery +} + +// GetJobsQueryOk returns a tuple with the JobsQuery field value +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetJobsQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JobsQuery, true +} + +// SetJobsQuery sets field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) SetJobsQuery(v string) { + o.JobsQuery = v +} + +// GetName returns the Name field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) SetName(v string) { + o.Name = v +} + +// GetQueryDialect returns the QueryDialect field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetQueryDialect() string { + if o == nil { + var ret string + return ret + } + return o.QueryDialect +} + +// GetQueryDialectOk returns a tuple with the QueryDialect field value +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) GetQueryDialectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.QueryDialect, true +} + +// SetQueryDialect sets field value. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) SetQueryDialect(v string) { + o.QueryDialect = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MonitorFormulaAndFunctionDataJobsQueryDefinition) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["job_type"] = o.JobType + toSerialize["jobs_query"] = o.JobsQuery + toSerialize["name"] = o.Name + toSerialize["query_dialect"] = o.QueryDialect + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MonitorFormulaAndFunctionDataJobsQueryDefinition) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + JobType *string `json:"job_type"` + JobsQuery *string `json:"jobs_query"` + Name *string `json:"name"` + QueryDialect *string `json:"query_dialect"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.JobType == nil { + return fmt.Errorf("required field job_type missing") + } + if all.JobsQuery == nil { + return fmt.Errorf("required field jobs_query missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.QueryDialect == nil { + return fmt.Errorf("required field query_dialect missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"job_type", "jobs_query", "name", "query_dialect"}) + } else { + return err + } + o.JobType = *all.JobType + o.JobsQuery = *all.JobsQuery + o.Name = *all.Name + o.QueryDialect = *all.QueryDialect + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV1/model_monitor_formula_and_function_event_query_definition_compute.go b/api/datadogV1/model_monitor_formula_and_function_event_query_definition_compute.go index 087718cd366..6132d1b1359 100644 --- a/api/datadogV1/model_monitor_formula_and_function_event_query_definition_compute.go +++ b/api/datadogV1/model_monitor_formula_and_function_event_query_definition_compute.go @@ -20,6 +20,8 @@ type MonitorFormulaAndFunctionEventQueryDefinitionCompute struct { Metric *string `json:"metric,omitempty"` // The name assigned to this aggregation, when multiple aggregations are defined for a query. Name *string `json:"name,omitempty"` + // Source reference for composite query payloads. + Source *string `json:"source,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -150,6 +152,34 @@ func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) SetName(v string) o.Name = &v } +// GetSource returns the Source field value if set, zero value otherwise. +func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) GetSource() string { + if o == nil || o.Source == nil { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) GetSourceOk() (*string, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) HasSource() bool { + return o != nil && o.Source != nil +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) SetSource(v string) { + o.Source = &v +} + // MarshalJSON serializes the struct using spec logic. func (o MonitorFormulaAndFunctionEventQueryDefinitionCompute) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -166,6 +196,9 @@ func (o MonitorFormulaAndFunctionEventQueryDefinitionCompute) MarshalJSON() ([]b if o.Name != nil { toSerialize["name"] = o.Name } + if o.Source != nil { + toSerialize["source"] = o.Source + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -180,6 +213,7 @@ func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) UnmarshalJSON(byt Interval *int64 `json:"interval,omitempty"` Metric *string `json:"metric,omitempty"` Name *string `json:"name,omitempty"` + Source *string `json:"source,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -189,7 +223,7 @@ func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) UnmarshalJSON(byt } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"aggregation", "interval", "metric", "name"}) + datadog.DeleteKeys(additionalProperties, &[]string{"aggregation", "interval", "metric", "name", "source"}) } else { return err } @@ -203,6 +237,7 @@ func (o *MonitorFormulaAndFunctionEventQueryDefinitionCompute) UnmarshalJSON(byt o.Interval = all.Interval o.Metric = all.Metric o.Name = all.Name + o.Source = all.Source if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV1/model_monitor_formula_and_function_event_query_group_by.go b/api/datadogV1/model_monitor_formula_and_function_event_query_group_by.go index 0ca75873fcc..f93c080b3d1 100644 --- a/api/datadogV1/model_monitor_formula_and_function_event_query_group_by.go +++ b/api/datadogV1/model_monitor_formula_and_function_event_query_group_by.go @@ -18,6 +18,8 @@ type MonitorFormulaAndFunctionEventQueryGroupBy struct { Limit *int64 `json:"limit,omitempty"` // Options for sorting group by results. Sort *MonitorFormulaAndFunctionEventQueryGroupBySort `json:"sort,omitempty"` + // Source reference for composite query payloads. + Source *string `json:"source,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -120,6 +122,34 @@ func (o *MonitorFormulaAndFunctionEventQueryGroupBy) SetSort(v MonitorFormulaAnd o.Sort = &v } +// GetSource returns the Source field value if set, zero value otherwise. +func (o *MonitorFormulaAndFunctionEventQueryGroupBy) GetSource() string { + if o == nil || o.Source == nil { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MonitorFormulaAndFunctionEventQueryGroupBy) GetSourceOk() (*string, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *MonitorFormulaAndFunctionEventQueryGroupBy) HasSource() bool { + return o != nil && o.Source != nil +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *MonitorFormulaAndFunctionEventQueryGroupBy) SetSource(v string) { + o.Source = &v +} + // MarshalJSON serializes the struct using spec logic. func (o MonitorFormulaAndFunctionEventQueryGroupBy) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -133,6 +163,9 @@ func (o MonitorFormulaAndFunctionEventQueryGroupBy) MarshalJSON() ([]byte, error if o.Sort != nil { toSerialize["sort"] = o.Sort } + if o.Source != nil { + toSerialize["source"] = o.Source + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -143,9 +176,10 @@ func (o MonitorFormulaAndFunctionEventQueryGroupBy) MarshalJSON() ([]byte, error // UnmarshalJSON deserializes the given payload. func (o *MonitorFormulaAndFunctionEventQueryGroupBy) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Facet *string `json:"facet"` - Limit *int64 `json:"limit,omitempty"` - Sort *MonitorFormulaAndFunctionEventQueryGroupBySort `json:"sort,omitempty"` + Facet *string `json:"facet"` + Limit *int64 `json:"limit,omitempty"` + Sort *MonitorFormulaAndFunctionEventQueryGroupBySort `json:"sort,omitempty"` + Source *string `json:"source,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -155,7 +189,7 @@ func (o *MonitorFormulaAndFunctionEventQueryGroupBy) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"facet", "limit", "sort"}) + datadog.DeleteKeys(additionalProperties, &[]string{"facet", "limit", "sort", "source"}) } else { return err } @@ -167,6 +201,7 @@ func (o *MonitorFormulaAndFunctionEventQueryGroupBy) UnmarshalJSON(bytes []byte) hasInvalidField = true } o.Sort = all.Sort + o.Source = all.Source if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV1/model_monitor_formula_and_function_query_definition.go b/api/datadogV1/model_monitor_formula_and_function_query_definition.go index 119b6a38d7e..0dc43acc3ea 100644 --- a/api/datadogV1/model_monitor_formula_and_function_query_definition.go +++ b/api/datadogV1/model_monitor_formula_and_function_query_definition.go @@ -13,6 +13,7 @@ type MonitorFormulaAndFunctionQueryDefinition struct { MonitorFormulaAndFunctionEventQueryDefinition *MonitorFormulaAndFunctionEventQueryDefinition MonitorFormulaAndFunctionCostQueryDefinition *MonitorFormulaAndFunctionCostQueryDefinition MonitorFormulaAndFunctionDataQualityQueryDefinition *MonitorFormulaAndFunctionDataQualityQueryDefinition + MonitorFormulaAndFunctionDataJobsQueryDefinition *MonitorFormulaAndFunctionDataJobsQueryDefinition MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition *MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition MonitorFormulaAndFunctionAggregateFilteredQueryDefinition *MonitorFormulaAndFunctionAggregateFilteredQueryDefinition @@ -35,6 +36,11 @@ func MonitorFormulaAndFunctionDataQualityQueryDefinitionAsMonitorFormulaAndFunct return MonitorFormulaAndFunctionQueryDefinition{MonitorFormulaAndFunctionDataQualityQueryDefinition: v} } +// MonitorFormulaAndFunctionDataJobsQueryDefinitionAsMonitorFormulaAndFunctionQueryDefinition is a convenience function that returns MonitorFormulaAndFunctionDataJobsQueryDefinition wrapped in MonitorFormulaAndFunctionQueryDefinition. +func MonitorFormulaAndFunctionDataJobsQueryDefinitionAsMonitorFormulaAndFunctionQueryDefinition(v *MonitorFormulaAndFunctionDataJobsQueryDefinition) MonitorFormulaAndFunctionQueryDefinition { + return MonitorFormulaAndFunctionQueryDefinition{MonitorFormulaAndFunctionDataJobsQueryDefinition: v} +} + // MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionAsMonitorFormulaAndFunctionQueryDefinition is a convenience function that returns MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition wrapped in MonitorFormulaAndFunctionQueryDefinition. func MonitorFormulaAndFunctionAggregateAugmentedQueryDefinitionAsMonitorFormulaAndFunctionQueryDefinition(v *MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition) MonitorFormulaAndFunctionQueryDefinition { return MonitorFormulaAndFunctionQueryDefinition{MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition: v} @@ -100,6 +106,23 @@ func (obj *MonitorFormulaAndFunctionQueryDefinition) UnmarshalJSON(data []byte) obj.MonitorFormulaAndFunctionDataQualityQueryDefinition = nil } + // try to unmarshal data into MonitorFormulaAndFunctionDataJobsQueryDefinition + err = datadog.Unmarshal(data, &obj.MonitorFormulaAndFunctionDataJobsQueryDefinition) + if err == nil { + if obj.MonitorFormulaAndFunctionDataJobsQueryDefinition != nil && obj.MonitorFormulaAndFunctionDataJobsQueryDefinition.UnparsedObject == nil { + jsonMonitorFormulaAndFunctionDataJobsQueryDefinition, _ := datadog.Marshal(obj.MonitorFormulaAndFunctionDataJobsQueryDefinition) + if string(jsonMonitorFormulaAndFunctionDataJobsQueryDefinition) == "{}" { // empty struct + obj.MonitorFormulaAndFunctionDataJobsQueryDefinition = nil + } else { + match++ + } + } else { + obj.MonitorFormulaAndFunctionDataJobsQueryDefinition = nil + } + } else { + obj.MonitorFormulaAndFunctionDataJobsQueryDefinition = nil + } + // try to unmarshal data into MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition err = datadog.Unmarshal(data, &obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition) if err == nil { @@ -139,6 +162,7 @@ func (obj *MonitorFormulaAndFunctionQueryDefinition) UnmarshalJSON(data []byte) obj.MonitorFormulaAndFunctionEventQueryDefinition = nil obj.MonitorFormulaAndFunctionCostQueryDefinition = nil obj.MonitorFormulaAndFunctionDataQualityQueryDefinition = nil + obj.MonitorFormulaAndFunctionDataJobsQueryDefinition = nil obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition = nil obj.MonitorFormulaAndFunctionAggregateFilteredQueryDefinition = nil return datadog.Unmarshal(data, &obj.UnparsedObject) @@ -160,6 +184,10 @@ func (obj MonitorFormulaAndFunctionQueryDefinition) MarshalJSON() ([]byte, error return datadog.Marshal(&obj.MonitorFormulaAndFunctionDataQualityQueryDefinition) } + if obj.MonitorFormulaAndFunctionDataJobsQueryDefinition != nil { + return datadog.Marshal(&obj.MonitorFormulaAndFunctionDataJobsQueryDefinition) + } + if obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition != nil { return datadog.Marshal(&obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition) } @@ -188,6 +216,10 @@ func (obj *MonitorFormulaAndFunctionQueryDefinition) GetActualInstance() interfa return obj.MonitorFormulaAndFunctionDataQualityQueryDefinition } + if obj.MonitorFormulaAndFunctionDataJobsQueryDefinition != nil { + return obj.MonitorFormulaAndFunctionDataJobsQueryDefinition + } + if obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition != nil { return obj.MonitorFormulaAndFunctionAggregateAugmentedQueryDefinition } diff --git a/api/datadogV1/model_monitor_type.go b/api/datadogV1/model_monitor_type.go index 69d3be42c34..9952e0e98ed 100644 --- a/api/datadogV1/model_monitor_type.go +++ b/api/datadogV1/model_monitor_type.go @@ -36,6 +36,7 @@ const ( MONITORTYPE_COST_ALERT MonitorType = "cost alert" MONITORTYPE_DATA_QUALITY_ALERT MonitorType = "data-quality alert" MONITORTYPE_NETWORK_PATH_ALERT MonitorType = "network-path alert" + MONITORTYPE_DATA_JOBS_ALERT MonitorType = "data-jobs alert" ) var allowedMonitorTypeEnumValues = []MonitorType{ @@ -60,6 +61,7 @@ var allowedMonitorTypeEnumValues = []MonitorType{ MONITORTYPE_COST_ALERT, MONITORTYPE_DATA_QUALITY_ALERT, MONITORTYPE_NETWORK_PATH_ALERT, + MONITORTYPE_DATA_JOBS_ALERT, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV1/model_synthetics_api_test_step_subtype.go b/api/datadogV1/model_synthetics_api_test_step_subtype.go index 3dda2cecc74..f97e06b86fa 100644 --- a/api/datadogV1/model_synthetics_api_test_step_subtype.go +++ b/api/datadogV1/model_synthetics_api_test_step_subtype.go @@ -23,6 +23,7 @@ const ( SYNTHETICSAPITESTSTEPSUBTYPE_UDP SyntheticsAPITestStepSubtype = "udp" SYNTHETICSAPITESTSTEPSUBTYPE_ICMP SyntheticsAPITestStepSubtype = "icmp" SYNTHETICSAPITESTSTEPSUBTYPE_WEBSOCKET SyntheticsAPITestStepSubtype = "websocket" + SYNTHETICSAPITESTSTEPSUBTYPE_MCP SyntheticsAPITestStepSubtype = "mcp" ) var allowedSyntheticsAPITestStepSubtypeEnumValues = []SyntheticsAPITestStepSubtype{ @@ -34,6 +35,7 @@ var allowedSyntheticsAPITestStepSubtypeEnumValues = []SyntheticsAPITestStepSubty SYNTHETICSAPITESTSTEPSUBTYPE_UDP, SYNTHETICSAPITESTSTEPSUBTYPE_ICMP, SYNTHETICSAPITESTSTEPSUBTYPE_WEBSOCKET, + SYNTHETICSAPITESTSTEPSUBTYPE_MCP, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV1/model_synthetics_assertion.go b/api/datadogV1/model_synthetics_assertion.go index 1ddfc01cc0b..667a9d18d78 100644 --- a/api/datadogV1/model_synthetics_assertion.go +++ b/api/datadogV1/model_synthetics_assertion.go @@ -11,12 +11,14 @@ import ( // SyntheticsAssertion - Object describing the assertions type, their associated operator, // which property they apply, and upon which target. type SyntheticsAssertion struct { - SyntheticsAssertionTarget *SyntheticsAssertionTarget - SyntheticsAssertionBodyHashTarget *SyntheticsAssertionBodyHashTarget - SyntheticsAssertionJSONPathTarget *SyntheticsAssertionJSONPathTarget - SyntheticsAssertionJSONSchemaTarget *SyntheticsAssertionJSONSchemaTarget - SyntheticsAssertionXPathTarget *SyntheticsAssertionXPathTarget - SyntheticsAssertionJavascript *SyntheticsAssertionJavascript + SyntheticsAssertionTarget *SyntheticsAssertionTarget + SyntheticsAssertionBodyHashTarget *SyntheticsAssertionBodyHashTarget + SyntheticsAssertionJSONPathTarget *SyntheticsAssertionJSONPathTarget + SyntheticsAssertionJSONSchemaTarget *SyntheticsAssertionJSONSchemaTarget + SyntheticsAssertionXPathTarget *SyntheticsAssertionXPathTarget + SyntheticsAssertionJavascript *SyntheticsAssertionJavascript + SyntheticsAssertionMCPServerCapabilitiesTarget *SyntheticsAssertionMCPServerCapabilitiesTarget + SyntheticsAssertionMCPRespectsSpecification *SyntheticsAssertionMCPRespectsSpecification // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -52,6 +54,16 @@ func SyntheticsAssertionJavascriptAsSyntheticsAssertion(v *SyntheticsAssertionJa return SyntheticsAssertion{SyntheticsAssertionJavascript: v} } +// SyntheticsAssertionMCPServerCapabilitiesTargetAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionMCPServerCapabilitiesTarget wrapped in SyntheticsAssertion. +func SyntheticsAssertionMCPServerCapabilitiesTargetAsSyntheticsAssertion(v *SyntheticsAssertionMCPServerCapabilitiesTarget) SyntheticsAssertion { + return SyntheticsAssertion{SyntheticsAssertionMCPServerCapabilitiesTarget: v} +} + +// SyntheticsAssertionMCPRespectsSpecificationAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionMCPRespectsSpecification wrapped in SyntheticsAssertion. +func SyntheticsAssertionMCPRespectsSpecificationAsSyntheticsAssertion(v *SyntheticsAssertionMCPRespectsSpecification) SyntheticsAssertion { + return SyntheticsAssertion{SyntheticsAssertionMCPRespectsSpecification: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error { var err error @@ -158,6 +170,40 @@ func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error { obj.SyntheticsAssertionJavascript = nil } + // try to unmarshal data into SyntheticsAssertionMCPServerCapabilitiesTarget + err = datadog.Unmarshal(data, &obj.SyntheticsAssertionMCPServerCapabilitiesTarget) + if err == nil { + if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil && obj.SyntheticsAssertionMCPServerCapabilitiesTarget.UnparsedObject == nil { + jsonSyntheticsAssertionMCPServerCapabilitiesTarget, _ := datadog.Marshal(obj.SyntheticsAssertionMCPServerCapabilitiesTarget) + if string(jsonSyntheticsAssertionMCPServerCapabilitiesTarget) == "{}" { // empty struct + obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil + } else { + match++ + } + } else { + obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil + } + } else { + obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil + } + + // try to unmarshal data into SyntheticsAssertionMCPRespectsSpecification + err = datadog.Unmarshal(data, &obj.SyntheticsAssertionMCPRespectsSpecification) + if err == nil { + if obj.SyntheticsAssertionMCPRespectsSpecification != nil && obj.SyntheticsAssertionMCPRespectsSpecification.UnparsedObject == nil { + jsonSyntheticsAssertionMCPRespectsSpecification, _ := datadog.Marshal(obj.SyntheticsAssertionMCPRespectsSpecification) + if string(jsonSyntheticsAssertionMCPRespectsSpecification) == "{}" { // empty struct + obj.SyntheticsAssertionMCPRespectsSpecification = nil + } else { + match++ + } + } else { + obj.SyntheticsAssertionMCPRespectsSpecification = nil + } + } else { + obj.SyntheticsAssertionMCPRespectsSpecification = nil + } + if match != 1 { // more than 1 match // reset to nil obj.SyntheticsAssertionTarget = nil @@ -166,6 +212,8 @@ func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error { obj.SyntheticsAssertionJSONSchemaTarget = nil obj.SyntheticsAssertionXPathTarget = nil obj.SyntheticsAssertionJavascript = nil + obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil + obj.SyntheticsAssertionMCPRespectsSpecification = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -197,6 +245,14 @@ func (obj SyntheticsAssertion) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.SyntheticsAssertionJavascript) } + if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil { + return datadog.Marshal(&obj.SyntheticsAssertionMCPServerCapabilitiesTarget) + } + + if obj.SyntheticsAssertionMCPRespectsSpecification != nil { + return datadog.Marshal(&obj.SyntheticsAssertionMCPRespectsSpecification) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -229,6 +285,14 @@ func (obj *SyntheticsAssertion) GetActualInstance() interface{} { return obj.SyntheticsAssertionJavascript } + if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil { + return obj.SyntheticsAssertionMCPServerCapabilitiesTarget + } + + if obj.SyntheticsAssertionMCPRespectsSpecification != nil { + return obj.SyntheticsAssertionMCPRespectsSpecification + } + // all schemas are nil return nil } diff --git a/api/datadogV1/model_synthetics_assertion_mcp_respects_specification.go b/api/datadogV1/model_synthetics_assertion_mcp_respects_specification.go new file mode 100644 index 00000000000..029e0ba4df1 --- /dev/null +++ b/api/datadogV1/model_synthetics_assertion_mcp_respects_specification.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsAssertionMCPRespectsSpecification An assertion that verifies the MCP server response respects the MCP specification. +type SyntheticsAssertionMCPRespectsSpecification struct { + // Type of the assertion. + Type SyntheticsAssertionMCPRespectsSpecificationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsAssertionMCPRespectsSpecification instantiates a new SyntheticsAssertionMCPRespectsSpecification object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsAssertionMCPRespectsSpecification(typeVar SyntheticsAssertionMCPRespectsSpecificationType) *SyntheticsAssertionMCPRespectsSpecification { + this := SyntheticsAssertionMCPRespectsSpecification{} + this.Type = typeVar + return &this +} + +// NewSyntheticsAssertionMCPRespectsSpecificationWithDefaults instantiates a new SyntheticsAssertionMCPRespectsSpecification object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsAssertionMCPRespectsSpecificationWithDefaults() *SyntheticsAssertionMCPRespectsSpecification { + this := SyntheticsAssertionMCPRespectsSpecification{} + return &this +} + +// GetType returns the Type field value. +func (o *SyntheticsAssertionMCPRespectsSpecification) GetType() SyntheticsAssertionMCPRespectsSpecificationType { + if o == nil { + var ret SyntheticsAssertionMCPRespectsSpecificationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionMCPRespectsSpecification) GetTypeOk() (*SyntheticsAssertionMCPRespectsSpecificationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SyntheticsAssertionMCPRespectsSpecification) SetType(v SyntheticsAssertionMCPRespectsSpecificationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsAssertionMCPRespectsSpecification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsAssertionMCPRespectsSpecification) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Type *SyntheticsAssertionMCPRespectsSpecificationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"type"}) + } else { + return err + } + + hasInvalidField := false + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV1/model_synthetics_assertion_mcp_respects_specification_type.go b/api/datadogV1/model_synthetics_assertion_mcp_respects_specification_type.go new file mode 100644 index 00000000000..1d24aab366b --- /dev/null +++ b/api/datadogV1/model_synthetics_assertion_mcp_respects_specification_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsAssertionMCPRespectsSpecificationType Type of the assertion. +type SyntheticsAssertionMCPRespectsSpecificationType string + +// List of SyntheticsAssertionMCPRespectsSpecificationType. +const ( + SYNTHETICSASSERTIONMCPRESPECTSSPECIFICATIONTYPE_MCP_RESPECTS_SPECIFICATION SyntheticsAssertionMCPRespectsSpecificationType = "mcpRespectsSpecification" +) + +var allowedSyntheticsAssertionMCPRespectsSpecificationTypeEnumValues = []SyntheticsAssertionMCPRespectsSpecificationType{ + SYNTHETICSASSERTIONMCPRESPECTSSPECIFICATIONTYPE_MCP_RESPECTS_SPECIFICATION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsAssertionMCPRespectsSpecificationType) GetAllowedValues() []SyntheticsAssertionMCPRespectsSpecificationType { + return allowedSyntheticsAssertionMCPRespectsSpecificationTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsAssertionMCPRespectsSpecificationType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsAssertionMCPRespectsSpecificationType(value) + return nil +} + +// NewSyntheticsAssertionMCPRespectsSpecificationTypeFromValue returns a pointer to a valid SyntheticsAssertionMCPRespectsSpecificationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsAssertionMCPRespectsSpecificationTypeFromValue(v string) (*SyntheticsAssertionMCPRespectsSpecificationType, error) { + ev := SyntheticsAssertionMCPRespectsSpecificationType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsAssertionMCPRespectsSpecificationType: valid values are %v", v, allowedSyntheticsAssertionMCPRespectsSpecificationTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsAssertionMCPRespectsSpecificationType) IsValid() bool { + for _, existing := range allowedSyntheticsAssertionMCPRespectsSpecificationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsAssertionMCPRespectsSpecificationType value. +func (v SyntheticsAssertionMCPRespectsSpecificationType) Ptr() *SyntheticsAssertionMCPRespectsSpecificationType { + return &v +} diff --git a/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_target.go b/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_target.go new file mode 100644 index 00000000000..1d6cceaf688 --- /dev/null +++ b/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_target.go @@ -0,0 +1,179 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsAssertionMCPServerCapabilitiesTarget An assertion that checks that an MCP server advertises the expected capabilities. +type SyntheticsAssertionMCPServerCapabilitiesTarget struct { + // Assertion operator to apply. + Operator SyntheticsAssertionOperator `json:"operator"` + // List of MCP server capabilities to assert against. + Target []SyntheticsMCPServerCapability `json:"target"` + // Type of the assertion. + Type SyntheticsAssertionMCPServerCapabilitiesType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsAssertionMCPServerCapabilitiesTarget instantiates a new SyntheticsAssertionMCPServerCapabilitiesTarget object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsAssertionMCPServerCapabilitiesTarget(operator SyntheticsAssertionOperator, target []SyntheticsMCPServerCapability, typeVar SyntheticsAssertionMCPServerCapabilitiesType) *SyntheticsAssertionMCPServerCapabilitiesTarget { + this := SyntheticsAssertionMCPServerCapabilitiesTarget{} + this.Operator = operator + this.Target = target + this.Type = typeVar + return &this +} + +// NewSyntheticsAssertionMCPServerCapabilitiesTargetWithDefaults instantiates a new SyntheticsAssertionMCPServerCapabilitiesTarget object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsAssertionMCPServerCapabilitiesTargetWithDefaults() *SyntheticsAssertionMCPServerCapabilitiesTarget { + this := SyntheticsAssertionMCPServerCapabilitiesTarget{} + return &this +} + +// GetOperator returns the Operator field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetOperator() SyntheticsAssertionOperator { + if o == nil { + var ret SyntheticsAssertionOperator + return ret + } + return o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetOperatorOk() (*SyntheticsAssertionOperator, bool) { + if o == nil { + return nil, false + } + return &o.Operator, true +} + +// SetOperator sets field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) SetOperator(v SyntheticsAssertionOperator) { + o.Operator = v +} + +// GetTarget returns the Target field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetTarget() []SyntheticsMCPServerCapability { + if o == nil { + var ret []SyntheticsMCPServerCapability + return ret + } + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetTargetOk() (*[]SyntheticsMCPServerCapability, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) SetTarget(v []SyntheticsMCPServerCapability) { + o.Target = v +} + +// GetType returns the Type field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetType() SyntheticsAssertionMCPServerCapabilitiesType { + if o == nil { + var ret SyntheticsAssertionMCPServerCapabilitiesType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) GetTypeOk() (*SyntheticsAssertionMCPServerCapabilitiesType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) SetType(v SyntheticsAssertionMCPServerCapabilitiesType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsAssertionMCPServerCapabilitiesTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["operator"] = o.Operator + toSerialize["target"] = o.Target + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsAssertionMCPServerCapabilitiesTarget) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Operator *SyntheticsAssertionOperator `json:"operator"` + Target *[]SyntheticsMCPServerCapability `json:"target"` + Type *SyntheticsAssertionMCPServerCapabilitiesType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Operator == nil { + return fmt.Errorf("required field operator missing") + } + if all.Target == nil { + return fmt.Errorf("required field target missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"operator", "target", "type"}) + } else { + return err + } + + hasInvalidField := false + if !all.Operator.IsValid() { + hasInvalidField = true + } else { + o.Operator = *all.Operator + } + o.Target = *all.Target + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_type.go b/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_type.go new file mode 100644 index 00000000000..4081d2c5bb0 --- /dev/null +++ b/api/datadogV1/model_synthetics_assertion_mcp_server_capabilities_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsAssertionMCPServerCapabilitiesType Type of the assertion. +type SyntheticsAssertionMCPServerCapabilitiesType string + +// List of SyntheticsAssertionMCPServerCapabilitiesType. +const ( + SYNTHETICSASSERTIONMCPSERVERCAPABILITIESTYPE_MCP_SERVER_CAPABILITIES SyntheticsAssertionMCPServerCapabilitiesType = "mcpServerCapabilities" +) + +var allowedSyntheticsAssertionMCPServerCapabilitiesTypeEnumValues = []SyntheticsAssertionMCPServerCapabilitiesType{ + SYNTHETICSASSERTIONMCPSERVERCAPABILITIESTYPE_MCP_SERVER_CAPABILITIES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsAssertionMCPServerCapabilitiesType) GetAllowedValues() []SyntheticsAssertionMCPServerCapabilitiesType { + return allowedSyntheticsAssertionMCPServerCapabilitiesTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsAssertionMCPServerCapabilitiesType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsAssertionMCPServerCapabilitiesType(value) + return nil +} + +// NewSyntheticsAssertionMCPServerCapabilitiesTypeFromValue returns a pointer to a valid SyntheticsAssertionMCPServerCapabilitiesType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsAssertionMCPServerCapabilitiesTypeFromValue(v string) (*SyntheticsAssertionMCPServerCapabilitiesType, error) { + ev := SyntheticsAssertionMCPServerCapabilitiesType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsAssertionMCPServerCapabilitiesType: valid values are %v", v, allowedSyntheticsAssertionMCPServerCapabilitiesTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsAssertionMCPServerCapabilitiesType) IsValid() bool { + for _, existing := range allowedSyntheticsAssertionMCPServerCapabilitiesTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsAssertionMCPServerCapabilitiesType value. +func (v SyntheticsAssertionMCPServerCapabilitiesType) Ptr() *SyntheticsAssertionMCPServerCapabilitiesType { + return &v +} diff --git a/api/datadogV1/model_synthetics_assertion_type.go b/api/datadogV1/model_synthetics_assertion_type.go index f653036d73d..bdb8ab616ce 100644 --- a/api/datadogV1/model_synthetics_assertion_type.go +++ b/api/datadogV1/model_synthetics_assertion_type.go @@ -36,6 +36,8 @@ const ( SYNTHETICSASSERTIONTYPE_CONNECTION SyntheticsAssertionType = "connection" SYNTHETICSASSERTIONTYPE_MULTI_NETWORK_HOP SyntheticsAssertionType = "multiNetworkHop" SYNTHETICSASSERTIONTYPE_JITTER SyntheticsAssertionType = "jitter" + SYNTHETICSASSERTIONTYPE_MCP_TOOL_NAME_LENGTH SyntheticsAssertionType = "mcpToolNameLength" + SYNTHETICSASSERTIONTYPE_MCP_TOOL_COUNT SyntheticsAssertionType = "mcpToolCount" ) var allowedSyntheticsAssertionTypeEnumValues = []SyntheticsAssertionType{ @@ -60,6 +62,8 @@ var allowedSyntheticsAssertionTypeEnumValues = []SyntheticsAssertionType{ SYNTHETICSASSERTIONTYPE_CONNECTION, SYNTHETICSASSERTIONTYPE_MULTI_NETWORK_HOP, SYNTHETICSASSERTIONTYPE_JITTER, + SYNTHETICSASSERTIONTYPE_MCP_TOOL_NAME_LENGTH, + SYNTHETICSASSERTIONTYPE_MCP_TOOL_COUNT, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV1/model_synthetics_mcp_protocol_version.go b/api/datadogV1/model_synthetics_mcp_protocol_version.go new file mode 100644 index 00000000000..8e0a1738588 --- /dev/null +++ b/api/datadogV1/model_synthetics_mcp_protocol_version.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsMCPProtocolVersion The MCP protocol version used by the step. See https://modelcontextprotocol.io/specification. +type SyntheticsMCPProtocolVersion string + +// List of SyntheticsMCPProtocolVersion. +const ( + SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18 SyntheticsMCPProtocolVersion = "2025-06-18" +) + +var allowedSyntheticsMCPProtocolVersionEnumValues = []SyntheticsMCPProtocolVersion{ + SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsMCPProtocolVersion) GetAllowedValues() []SyntheticsMCPProtocolVersion { + return allowedSyntheticsMCPProtocolVersionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsMCPProtocolVersion) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsMCPProtocolVersion(value) + return nil +} + +// NewSyntheticsMCPProtocolVersionFromValue returns a pointer to a valid SyntheticsMCPProtocolVersion +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsMCPProtocolVersionFromValue(v string) (*SyntheticsMCPProtocolVersion, error) { + ev := SyntheticsMCPProtocolVersion(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsMCPProtocolVersion: valid values are %v", v, allowedSyntheticsMCPProtocolVersionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsMCPProtocolVersion) IsValid() bool { + for _, existing := range allowedSyntheticsMCPProtocolVersionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsMCPProtocolVersion value. +func (v SyntheticsMCPProtocolVersion) Ptr() *SyntheticsMCPProtocolVersion { + return &v +} diff --git a/api/datadogV1/model_synthetics_mcp_server_capability.go b/api/datadogV1/model_synthetics_mcp_server_capability.go new file mode 100644 index 00000000000..f3ba1c98437 --- /dev/null +++ b/api/datadogV1/model_synthetics_mcp_server_capability.go @@ -0,0 +1,74 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsMCPServerCapability A capability advertised by an MCP server. +type SyntheticsMCPServerCapability string + +// List of SyntheticsMCPServerCapability. +const ( + SYNTHETICSMCPSERVERCAPABILITY_COMPLETIONS SyntheticsMCPServerCapability = "completions" + SYNTHETICSMCPSERVERCAPABILITY_EXPERIMENTAL SyntheticsMCPServerCapability = "experimental" + SYNTHETICSMCPSERVERCAPABILITY_LOGGING SyntheticsMCPServerCapability = "logging" + SYNTHETICSMCPSERVERCAPABILITY_PROMPTS SyntheticsMCPServerCapability = "prompts" + SYNTHETICSMCPSERVERCAPABILITY_RESOURCES SyntheticsMCPServerCapability = "resources" + SYNTHETICSMCPSERVERCAPABILITY_TOOLS SyntheticsMCPServerCapability = "tools" +) + +var allowedSyntheticsMCPServerCapabilityEnumValues = []SyntheticsMCPServerCapability{ + SYNTHETICSMCPSERVERCAPABILITY_COMPLETIONS, + SYNTHETICSMCPSERVERCAPABILITY_EXPERIMENTAL, + SYNTHETICSMCPSERVERCAPABILITY_LOGGING, + SYNTHETICSMCPSERVERCAPABILITY_PROMPTS, + SYNTHETICSMCPSERVERCAPABILITY_RESOURCES, + SYNTHETICSMCPSERVERCAPABILITY_TOOLS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsMCPServerCapability) GetAllowedValues() []SyntheticsMCPServerCapability { + return allowedSyntheticsMCPServerCapabilityEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsMCPServerCapability) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsMCPServerCapability(value) + return nil +} + +// NewSyntheticsMCPServerCapabilityFromValue returns a pointer to a valid SyntheticsMCPServerCapability +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsMCPServerCapabilityFromValue(v string) (*SyntheticsMCPServerCapability, error) { + ev := SyntheticsMCPServerCapability(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsMCPServerCapability: valid values are %v", v, allowedSyntheticsMCPServerCapabilityEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsMCPServerCapability) IsValid() bool { + for _, existing := range allowedSyntheticsMCPServerCapabilityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsMCPServerCapability value. +func (v SyntheticsMCPServerCapability) Ptr() *SyntheticsMCPServerCapability { + return &v +} diff --git a/api/datadogV1/model_synthetics_test_call_type.go b/api/datadogV1/model_synthetics_test_call_type.go index d6e9ef721ab..2748393cc99 100644 --- a/api/datadogV1/model_synthetics_test_call_type.go +++ b/api/datadogV1/model_synthetics_test_call_type.go @@ -10,18 +10,26 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SyntheticsTestCallType The type of gRPC call to perform. +// SyntheticsTestCallType The type of call to perform. Used by gRPC steps (`healthcheck`, `unary`) +// and MCP steps (`init`, `tool_list`, `tool_call`). Valid values depend on +// the parent step's `subtype`. type SyntheticsTestCallType string // List of SyntheticsTestCallType. const ( SYNTHETICSTESTCALLTYPE_HEALTHCHECK SyntheticsTestCallType = "healthcheck" SYNTHETICSTESTCALLTYPE_UNARY SyntheticsTestCallType = "unary" + SYNTHETICSTESTCALLTYPE_INIT SyntheticsTestCallType = "init" + SYNTHETICSTESTCALLTYPE_TOOL_LIST SyntheticsTestCallType = "tool_list" + SYNTHETICSTESTCALLTYPE_TOOL_CALL SyntheticsTestCallType = "tool_call" ) var allowedSyntheticsTestCallTypeEnumValues = []SyntheticsTestCallType{ SYNTHETICSTESTCALLTYPE_HEALTHCHECK, SYNTHETICSTESTCALLTYPE_UNARY, + SYNTHETICSTESTCALLTYPE_INIT, + SYNTHETICSTESTCALLTYPE_TOOL_LIST, + SYNTHETICSTESTCALLTYPE_TOOL_CALL, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV1/model_synthetics_test_request.go b/api/datadogV1/model_synthetics_test_request.go index edacd0eff5d..806835b8ff3 100644 --- a/api/datadogV1/model_synthetics_test_request.go +++ b/api/datadogV1/model_synthetics_test_request.go @@ -18,7 +18,9 @@ type SyntheticsTestRequest struct { Body *string `json:"body,omitempty"` // Type of the request body. BodyType *SyntheticsTestRequestBodyType `json:"bodyType,omitempty"` - // The type of gRPC call to perform. + // The type of call to perform. Used by gRPC steps (`healthcheck`, `unary`) + // and MCP steps (`init`, `tool_list`, `tool_call`). Valid values depend on + // the parent step's `subtype`. CallType *SyntheticsTestCallType `json:"callType,omitempty"` // Client certificate to use when performing the test request. Certificate *SyntheticsTestRequestCertificate `json:"certificate,omitempty"` @@ -50,6 +52,8 @@ type SyntheticsTestRequest struct { HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"` // Whether the message is base64 encoded. IsMessageBase64Encoded *bool `json:"isMessageBase64Encoded,omitempty"` + // The MCP protocol version used by the step. See https://modelcontextprotocol.io/specification. + McpProtocolVersion *SyntheticsMCPProtocolVersion `json:"mcpProtocolVersion,omitempty"` // Message to send for UDP or WebSocket tests. Message *string `json:"message,omitempty"` // Metadata to include when performing the gRPC test. @@ -78,6 +82,10 @@ type SyntheticsTestRequest struct { ShouldTrackHops *bool `json:"shouldTrackHops,omitempty"` // Timeout in seconds for the test. Timeout *float64 `json:"timeout,omitempty"` + // Arguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when `callType` is `tool_call`. + ToolArgs map[string]interface{} `json:"toolArgs,omitempty"` + // The name of the MCP tool to call. Required when `callType` is `tool_call`. + ToolName *string `json:"toolName,omitempty"` // URL to perform the test with. Url *string `json:"url,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -662,6 +670,34 @@ func (o *SyntheticsTestRequest) SetIsMessageBase64Encoded(v bool) { o.IsMessageBase64Encoded = &v } +// GetMcpProtocolVersion returns the McpProtocolVersion field value if set, zero value otherwise. +func (o *SyntheticsTestRequest) GetMcpProtocolVersion() SyntheticsMCPProtocolVersion { + if o == nil || o.McpProtocolVersion == nil { + var ret SyntheticsMCPProtocolVersion + return ret + } + return *o.McpProtocolVersion +} + +// GetMcpProtocolVersionOk returns a tuple with the McpProtocolVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestRequest) GetMcpProtocolVersionOk() (*SyntheticsMCPProtocolVersion, bool) { + if o == nil || o.McpProtocolVersion == nil { + return nil, false + } + return o.McpProtocolVersion, true +} + +// HasMcpProtocolVersion returns a boolean if a field has been set. +func (o *SyntheticsTestRequest) HasMcpProtocolVersion() bool { + return o != nil && o.McpProtocolVersion != nil +} + +// SetMcpProtocolVersion gets a reference to the given SyntheticsMCPProtocolVersion and assigns it to the McpProtocolVersion field. +func (o *SyntheticsTestRequest) SetMcpProtocolVersion(v SyntheticsMCPProtocolVersion) { + o.McpProtocolVersion = &v +} + // GetMessage returns the Message field value if set, zero value otherwise. func (o *SyntheticsTestRequest) GetMessage() string { if o == nil || o.Message == nil { @@ -1026,6 +1062,62 @@ func (o *SyntheticsTestRequest) SetTimeout(v float64) { o.Timeout = &v } +// GetToolArgs returns the ToolArgs field value if set, zero value otherwise. +func (o *SyntheticsTestRequest) GetToolArgs() map[string]interface{} { + if o == nil || o.ToolArgs == nil { + var ret map[string]interface{} + return ret + } + return o.ToolArgs +} + +// GetToolArgsOk returns a tuple with the ToolArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestRequest) GetToolArgsOk() (*map[string]interface{}, bool) { + if o == nil || o.ToolArgs == nil { + return nil, false + } + return &o.ToolArgs, true +} + +// HasToolArgs returns a boolean if a field has been set. +func (o *SyntheticsTestRequest) HasToolArgs() bool { + return o != nil && o.ToolArgs != nil +} + +// SetToolArgs gets a reference to the given map[string]interface{} and assigns it to the ToolArgs field. +func (o *SyntheticsTestRequest) SetToolArgs(v map[string]interface{}) { + o.ToolArgs = v +} + +// GetToolName returns the ToolName field value if set, zero value otherwise. +func (o *SyntheticsTestRequest) GetToolName() string { + if o == nil || o.ToolName == nil { + var ret string + return ret + } + return *o.ToolName +} + +// GetToolNameOk returns a tuple with the ToolName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestRequest) GetToolNameOk() (*string, bool) { + if o == nil || o.ToolName == nil { + return nil, false + } + return o.ToolName, true +} + +// HasToolName returns a boolean if a field has been set. +func (o *SyntheticsTestRequest) HasToolName() bool { + return o != nil && o.ToolName != nil +} + +// SetToolName gets a reference to the given string and assigns it to the ToolName field. +func (o *SyntheticsTestRequest) SetToolName(v string) { + o.ToolName = &v +} + // GetUrl returns the Url field value if set, zero value otherwise. func (o *SyntheticsTestRequest) GetUrl() string { if o == nil || o.Url == nil { @@ -1120,6 +1212,9 @@ func (o SyntheticsTestRequest) MarshalJSON() ([]byte, error) { if o.IsMessageBase64Encoded != nil { toSerialize["isMessageBase64Encoded"] = o.IsMessageBase64Encoded } + if o.McpProtocolVersion != nil { + toSerialize["mcpProtocolVersion"] = o.McpProtocolVersion + } if o.Message != nil { toSerialize["message"] = o.Message } @@ -1159,6 +1254,12 @@ func (o SyntheticsTestRequest) MarshalJSON() ([]byte, error) { if o.Timeout != nil { toSerialize["timeout"] = o.Timeout } + if o.ToolArgs != nil { + toSerialize["toolArgs"] = o.ToolArgs + } + if o.ToolName != nil { + toSerialize["toolName"] = o.ToolName + } if o.Url != nil { toSerialize["url"] = o.Url } @@ -1192,6 +1293,7 @@ func (o *SyntheticsTestRequest) UnmarshalJSON(bytes []byte) (err error) { Host *string `json:"host,omitempty"` HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"` IsMessageBase64Encoded *bool `json:"isMessageBase64Encoded,omitempty"` + McpProtocolVersion *SyntheticsMCPProtocolVersion `json:"mcpProtocolVersion,omitempty"` Message *string `json:"message,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` Method *string `json:"method,omitempty"` @@ -1205,6 +1307,8 @@ func (o *SyntheticsTestRequest) UnmarshalJSON(bytes []byte) (err error) { Service *string `json:"service,omitempty"` ShouldTrackHops *bool `json:"shouldTrackHops,omitempty"` Timeout *float64 `json:"timeout,omitempty"` + ToolArgs map[string]interface{} `json:"toolArgs,omitempty"` + ToolName *string `json:"toolName,omitempty"` Url *string `json:"url,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -1212,7 +1316,7 @@ func (o *SyntheticsTestRequest) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"allow_insecure", "basicAuth", "body", "bodyType", "callType", "certificate", "certificateDomains", "checkCertificateRevocation", "compressedJsonDescriptor", "compressedProtoFile", "disableAiaIntermediateFetching", "dnsServer", "dnsServerPort", "files", "follow_redirects", "form", "headers", "host", "httpVersion", "isMessageBase64Encoded", "message", "metadata", "method", "noSavingResponseBody", "numberOfPackets", "persistCookies", "port", "proxy", "query", "servername", "service", "shouldTrackHops", "timeout", "url"}) + datadog.DeleteKeys(additionalProperties, &[]string{"allow_insecure", "basicAuth", "body", "bodyType", "callType", "certificate", "certificateDomains", "checkCertificateRevocation", "compressedJsonDescriptor", "compressedProtoFile", "disableAiaIntermediateFetching", "dnsServer", "dnsServerPort", "files", "follow_redirects", "form", "headers", "host", "httpVersion", "isMessageBase64Encoded", "mcpProtocolVersion", "message", "metadata", "method", "noSavingResponseBody", "numberOfPackets", "persistCookies", "port", "proxy", "query", "servername", "service", "shouldTrackHops", "timeout", "toolArgs", "toolName", "url"}) } else { return err } @@ -1253,6 +1357,11 @@ func (o *SyntheticsTestRequest) UnmarshalJSON(bytes []byte) (err error) { o.HttpVersion = all.HttpVersion } o.IsMessageBase64Encoded = all.IsMessageBase64Encoded + if all.McpProtocolVersion != nil && !all.McpProtocolVersion.IsValid() { + hasInvalidField = true + } else { + o.McpProtocolVersion = all.McpProtocolVersion + } o.Message = all.Message o.Metadata = all.Metadata o.Method = all.Method @@ -1269,6 +1378,8 @@ func (o *SyntheticsTestRequest) UnmarshalJSON(bytes []byte) (err error) { o.Service = all.Service o.ShouldTrackHops = all.ShouldTrackHops o.Timeout = all.Timeout + o.ToolArgs = all.ToolArgs + o.ToolName = all.ToolName o.Url = all.Url if len(additionalProperties) > 0 { diff --git a/api/datadogV1/model_usage_summary_date.go b/api/datadogV1/model_usage_summary_date.go index 6e0d7ec3f8d..50de8540ea1 100644 --- a/api/datadogV1/model_usage_summary_date.go +++ b/api/datadogV1/model_usage_summary_date.go @@ -145,6 +145,10 @@ type UsageSummaryDate struct { CsmHostEnterpriseOciHostCountTop99p *int64 `json:"csm_host_enterprise_oci_host_count_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current date for the given org. CsmHostEnterpriseTotalHostCountTop99p *int64 `json:"csm_host_enterprise_total_host_count_top99p,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CsmHostProHostsAgentlessScannersSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CsmHostProHostsAgentlessScannersTop99p *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current date for the given org. CsmHostProOciHostCountTop99p *int64 `json:"csm_host_pro_oci_host_count_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro Azure app services hosts over all hours in the current date for all organizations. @@ -161,6 +165,10 @@ type UsageSummaryDate struct { CspmGcpHostTop99p *int64 `json:"cspm_gcp_host_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current date for all organizations. CspmHostTop99p *int64 `json:"cspm_host_top99p,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for all organizations. + CspmHostsAgentlessScannersSum *int64 `json:"cspm_hosts_agentless_scanners_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for all organizations. + CspmHostsAgentlessScannersTop99p *int64 `json:"cspm_hosts_agentless_scanners_top99p,omitempty"` // Shows the average number of distinct custom metrics over all hours in the current date for all organizations. CustomTsAvg *int64 `json:"custom_ts_avg,omitempty"` // Shows the average of all distinct Cloud Workload Security containers over all hours in the current date for all organizations. @@ -177,6 +185,8 @@ type UsageSummaryDate struct { DbmHostTop99p *int64 `json:"dbm_host_top99p,omitempty"` // Shows the average of all normalized Database Monitoring queries over all hours in the current date for all organizations. DbmQueriesCountAvg *int64 `json:"dbm_queries_count_avg,omitempty"` + // Shows the sum of all orchestrator job hours over all hours in the current date for all organizations. + DoJobsMonitoringOrchestratorsJobHoursSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_sum,omitempty"` // Shows the sum of all ephemeral infrastructure hosts with the Datadog Agent over all hours in the current date for the given org. EphInfraHostAgentSum *int64 `json:"eph_infra_host_agent_sum,omitempty"` // Shows the sum of all ephemeral infrastructure hosts on Alibaba over all hours in the current date for the given org. @@ -2361,6 +2371,62 @@ func (o *UsageSummaryDate) SetCsmHostEnterpriseTotalHostCountTop99p(v int64) { o.CsmHostEnterpriseTotalHostCountTop99p = &v } +// GetCsmHostProHostsAgentlessScannersSum returns the CsmHostProHostsAgentlessScannersSum field value if set, zero value otherwise. +func (o *UsageSummaryDate) GetCsmHostProHostsAgentlessScannersSum() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersSum == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersSum +} + +// GetCsmHostProHostsAgentlessScannersSumOk returns a tuple with the CsmHostProHostsAgentlessScannersSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDate) GetCsmHostProHostsAgentlessScannersSumOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersSum == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersSum, true +} + +// HasCsmHostProHostsAgentlessScannersSum returns a boolean if a field has been set. +func (o *UsageSummaryDate) HasCsmHostProHostsAgentlessScannersSum() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersSum != nil +} + +// SetCsmHostProHostsAgentlessScannersSum gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersSum field. +func (o *UsageSummaryDate) SetCsmHostProHostsAgentlessScannersSum(v int64) { + o.CsmHostProHostsAgentlessScannersSum = &v +} + +// GetCsmHostProHostsAgentlessScannersTop99p returns the CsmHostProHostsAgentlessScannersTop99p field value if set, zero value otherwise. +func (o *UsageSummaryDate) GetCsmHostProHostsAgentlessScannersTop99p() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99p == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersTop99p +} + +// GetCsmHostProHostsAgentlessScannersTop99pOk returns a tuple with the CsmHostProHostsAgentlessScannersTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDate) GetCsmHostProHostsAgentlessScannersTop99pOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99p == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersTop99p, true +} + +// HasCsmHostProHostsAgentlessScannersTop99p returns a boolean if a field has been set. +func (o *UsageSummaryDate) HasCsmHostProHostsAgentlessScannersTop99p() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersTop99p != nil +} + +// SetCsmHostProHostsAgentlessScannersTop99p gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersTop99p field. +func (o *UsageSummaryDate) SetCsmHostProHostsAgentlessScannersTop99p(v int64) { + o.CsmHostProHostsAgentlessScannersTop99p = &v +} + // GetCsmHostProOciHostCountTop99p returns the CsmHostProOciHostCountTop99p field value if set, zero value otherwise. func (o *UsageSummaryDate) GetCsmHostProOciHostCountTop99p() int64 { if o == nil || o.CsmHostProOciHostCountTop99p == nil { @@ -2585,6 +2651,62 @@ func (o *UsageSummaryDate) SetCspmHostTop99p(v int64) { o.CspmHostTop99p = &v } +// GetCspmHostsAgentlessScannersSum returns the CspmHostsAgentlessScannersSum field value if set, zero value otherwise. +func (o *UsageSummaryDate) GetCspmHostsAgentlessScannersSum() int64 { + if o == nil || o.CspmHostsAgentlessScannersSum == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersSum +} + +// GetCspmHostsAgentlessScannersSumOk returns a tuple with the CspmHostsAgentlessScannersSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDate) GetCspmHostsAgentlessScannersSumOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersSum == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersSum, true +} + +// HasCspmHostsAgentlessScannersSum returns a boolean if a field has been set. +func (o *UsageSummaryDate) HasCspmHostsAgentlessScannersSum() bool { + return o != nil && o.CspmHostsAgentlessScannersSum != nil +} + +// SetCspmHostsAgentlessScannersSum gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersSum field. +func (o *UsageSummaryDate) SetCspmHostsAgentlessScannersSum(v int64) { + o.CspmHostsAgentlessScannersSum = &v +} + +// GetCspmHostsAgentlessScannersTop99p returns the CspmHostsAgentlessScannersTop99p field value if set, zero value otherwise. +func (o *UsageSummaryDate) GetCspmHostsAgentlessScannersTop99p() int64 { + if o == nil || o.CspmHostsAgentlessScannersTop99p == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersTop99p +} + +// GetCspmHostsAgentlessScannersTop99pOk returns a tuple with the CspmHostsAgentlessScannersTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDate) GetCspmHostsAgentlessScannersTop99pOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersTop99p == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersTop99p, true +} + +// HasCspmHostsAgentlessScannersTop99p returns a boolean if a field has been set. +func (o *UsageSummaryDate) HasCspmHostsAgentlessScannersTop99p() bool { + return o != nil && o.CspmHostsAgentlessScannersTop99p != nil +} + +// SetCspmHostsAgentlessScannersTop99p gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersTop99p field. +func (o *UsageSummaryDate) SetCspmHostsAgentlessScannersTop99p(v int64) { + o.CspmHostsAgentlessScannersTop99p = &v +} + // GetCustomTsAvg returns the CustomTsAvg field value if set, zero value otherwise. func (o *UsageSummaryDate) GetCustomTsAvg() int64 { if o == nil || o.CustomTsAvg == nil { @@ -2809,6 +2931,34 @@ func (o *UsageSummaryDate) SetDbmQueriesCountAvg(v int64) { o.DbmQueriesCountAvg = &v } +// GetDoJobsMonitoringOrchestratorsJobHoursSum returns the DoJobsMonitoringOrchestratorsJobHoursSum field value if set, zero value otherwise. +func (o *UsageSummaryDate) GetDoJobsMonitoringOrchestratorsJobHoursSum() int64 { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursSum == nil { + var ret int64 + return ret + } + return *o.DoJobsMonitoringOrchestratorsJobHoursSum +} + +// GetDoJobsMonitoringOrchestratorsJobHoursSumOk returns a tuple with the DoJobsMonitoringOrchestratorsJobHoursSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDate) GetDoJobsMonitoringOrchestratorsJobHoursSumOk() (*int64, bool) { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursSum == nil { + return nil, false + } + return o.DoJobsMonitoringOrchestratorsJobHoursSum, true +} + +// HasDoJobsMonitoringOrchestratorsJobHoursSum returns a boolean if a field has been set. +func (o *UsageSummaryDate) HasDoJobsMonitoringOrchestratorsJobHoursSum() bool { + return o != nil && o.DoJobsMonitoringOrchestratorsJobHoursSum != nil +} + +// SetDoJobsMonitoringOrchestratorsJobHoursSum gets a reference to the given int64 and assigns it to the DoJobsMonitoringOrchestratorsJobHoursSum field. +func (o *UsageSummaryDate) SetDoJobsMonitoringOrchestratorsJobHoursSum(v int64) { + o.DoJobsMonitoringOrchestratorsJobHoursSum = &v +} + // GetEphInfraHostAgentSum returns the EphInfraHostAgentSum field value if set, zero value otherwise. func (o *UsageSummaryDate) GetEphInfraHostAgentSum() int64 { if o == nil || o.EphInfraHostAgentSum == nil { @@ -7551,6 +7701,12 @@ func (o UsageSummaryDate) MarshalJSON() ([]byte, error) { if o.CsmHostEnterpriseTotalHostCountTop99p != nil { toSerialize["csm_host_enterprise_total_host_count_top99p"] = o.CsmHostEnterpriseTotalHostCountTop99p } + if o.CsmHostProHostsAgentlessScannersSum != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_sum"] = o.CsmHostProHostsAgentlessScannersSum + } + if o.CsmHostProHostsAgentlessScannersTop99p != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_top99p"] = o.CsmHostProHostsAgentlessScannersTop99p + } if o.CsmHostProOciHostCountTop99p != nil { toSerialize["csm_host_pro_oci_host_count_top99p"] = o.CsmHostProOciHostCountTop99p } @@ -7575,6 +7731,12 @@ func (o UsageSummaryDate) MarshalJSON() ([]byte, error) { if o.CspmHostTop99p != nil { toSerialize["cspm_host_top99p"] = o.CspmHostTop99p } + if o.CspmHostsAgentlessScannersSum != nil { + toSerialize["cspm_hosts_agentless_scanners_sum"] = o.CspmHostsAgentlessScannersSum + } + if o.CspmHostsAgentlessScannersTop99p != nil { + toSerialize["cspm_hosts_agentless_scanners_top99p"] = o.CspmHostsAgentlessScannersTop99p + } if o.CustomTsAvg != nil { toSerialize["custom_ts_avg"] = o.CustomTsAvg } @@ -7603,6 +7765,9 @@ func (o UsageSummaryDate) MarshalJSON() ([]byte, error) { if o.DbmQueriesCountAvg != nil { toSerialize["dbm_queries_count_avg"] = o.DbmQueriesCountAvg } + if o.DoJobsMonitoringOrchestratorsJobHoursSum != nil { + toSerialize["do_jobs_monitoring_orchestrators_job_hours_sum"] = o.DoJobsMonitoringOrchestratorsJobHoursSum + } if o.EphInfraHostAgentSum != nil { toSerialize["eph_infra_host_agent_sum"] = o.EphInfraHostAgentSum } @@ -8161,6 +8326,8 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { CsmHostEnterpriseGcpHostCountTop99p *int64 `json:"csm_host_enterprise_gcp_host_count_top99p,omitempty"` CsmHostEnterpriseOciHostCountTop99p *int64 `json:"csm_host_enterprise_oci_host_count_top99p,omitempty"` CsmHostEnterpriseTotalHostCountTop99p *int64 `json:"csm_host_enterprise_total_host_count_top99p,omitempty"` + CsmHostProHostsAgentlessScannersSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_sum,omitempty"` + CsmHostProHostsAgentlessScannersTop99p *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p,omitempty"` CsmHostProOciHostCountTop99p *int64 `json:"csm_host_pro_oci_host_count_top99p,omitempty"` CspmAasHostTop99p *int64 `json:"cspm_aas_host_top99p,omitempty"` CspmAwsHostTop99p *int64 `json:"cspm_aws_host_top99p,omitempty"` @@ -8169,6 +8336,8 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { CspmContainerHwm *int64 `json:"cspm_container_hwm,omitempty"` CspmGcpHostTop99p *int64 `json:"cspm_gcp_host_top99p,omitempty"` CspmHostTop99p *int64 `json:"cspm_host_top99p,omitempty"` + CspmHostsAgentlessScannersSum *int64 `json:"cspm_hosts_agentless_scanners_sum,omitempty"` + CspmHostsAgentlessScannersTop99p *int64 `json:"cspm_hosts_agentless_scanners_top99p,omitempty"` CustomTsAvg *int64 `json:"custom_ts_avg,omitempty"` CwsContainerCountAvg *int64 `json:"cws_container_count_avg,omitempty"` CwsFargateTaskAvg *int64 `json:"cws_fargate_task_avg,omitempty"` @@ -8177,6 +8346,7 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { Date *time.Time `json:"date,omitempty"` DbmHostTop99p *int64 `json:"dbm_host_top99p,omitempty"` DbmQueriesCountAvg *int64 `json:"dbm_queries_count_avg,omitempty"` + DoJobsMonitoringOrchestratorsJobHoursSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_sum,omitempty"` EphInfraHostAgentSum *int64 `json:"eph_infra_host_agent_sum,omitempty"` EphInfraHostAlibabaSum *int64 `json:"eph_infra_host_alibaba_sum,omitempty"` EphInfraHostAwsSum *int64 `json:"eph_infra_host_aws_sum,omitempty"` @@ -8344,7 +8514,7 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"agent_host_top99p", "apm_azure_app_service_host_top99p", "apm_devsecops_host_top99p", "apm_enterprise_standalone_hosts_top99p", "apm_fargate_count_avg", "apm_host_top99p", "apm_pro_standalone_hosts_top99p", "appsec_fargate_count_avg", "asm_serverless_sum", "audit_logs_lines_indexed_sum", "audit_trail_enabled_hwm", "avg_profiled_fargate_tasks", "aws_host_top99p", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p", "billable_ingested_bytes_sum", "bits_ai_investigations_sum", "browser_rum_lite_session_count_sum", "browser_rum_replay_session_count_sum", "browser_rum_units_sum", "ccm_anthropic_spend_last", "ccm_aws_spend_last", "ccm_azure_spend_last", "ccm_confluent_spend_last", "ccm_databricks_spend_last", "ccm_elastic_spend_last", "ccm_fastly_spend_last", "ccm_gcp_spend_last", "ccm_github_spend_last", "ccm_mongodb_spend_last", "ccm_oci_spend_last", "ccm_openai_spend_last", "ccm_snowflake_spend_last", "ccm_spend_monitored_ent_last", "ccm_spend_monitored_pro_last", "ccm_twilio_spend_last", "ci_pipeline_indexed_spans_sum", "ci_test_indexed_spans_sum", "ci_visibility_itr_committers_hwm", "ci_visibility_pipeline_committers_hwm", "ci_visibility_test_committers_hwm", "cloud_cost_management_aws_host_count_avg", "cloud_cost_management_azure_host_count_avg", "cloud_cost_management_gcp_host_count_avg", "cloud_cost_management_host_count_avg", "cloud_cost_management_oci_host_count_avg", "cloud_siem_events_sum", "code_analysis_sa_committers_hwm", "code_analysis_sca_committers_hwm", "code_security_host_top99p", "container_avg", "container_excl_agent_avg", "container_hwm", "csm_container_enterprise_compliance_count_sum", "csm_container_enterprise_cws_count_sum", "csm_container_enterprise_total_count_sum", "csm_host_enterprise_aas_host_count_top99p", "csm_host_enterprise_aws_host_count_top99p", "csm_host_enterprise_azure_host_count_top99p", "csm_host_enterprise_compliance_host_count_top99p", "csm_host_enterprise_cws_host_count_top99p", "csm_host_enterprise_gcp_host_count_top99p", "csm_host_enterprise_oci_host_count_top99p", "csm_host_enterprise_total_host_count_top99p", "csm_host_pro_oci_host_count_top99p", "cspm_aas_host_top99p", "cspm_aws_host_top99p", "cspm_azure_host_top99p", "cspm_container_avg", "cspm_container_hwm", "cspm_gcp_host_top99p", "cspm_host_top99p", "custom_ts_avg", "cws_container_count_avg", "cws_fargate_task_avg", "cws_host_top99p", "data_jobs_monitoring_host_hr_sum", "date", "dbm_host_top99p", "dbm_queries_count_avg", "eph_infra_host_agent_sum", "eph_infra_host_alibaba_sum", "eph_infra_host_aws_sum", "eph_infra_host_azure_sum", "eph_infra_host_basic_infra_basic_agent_sum", "eph_infra_host_basic_infra_basic_vsphere_sum", "eph_infra_host_basic_sum", "eph_infra_host_ent_sum", "eph_infra_host_gcp_sum", "eph_infra_host_heroku_sum", "eph_infra_host_only_aas_sum", "eph_infra_host_only_vsphere_sum", "eph_infra_host_opentelemetry_apm_sum", "eph_infra_host_opentelemetry_sum", "eph_infra_host_pro_sum", "eph_infra_host_proplus_sum", "eph_infra_host_proxmox_sum", "error_tracking_apm_error_events_sum", "error_tracking_error_events_sum", "error_tracking_events_sum", "error_tracking_rum_error_events_sum", "event_management_correlation_correlated_events_sum", "event_management_correlation_correlated_related_events_sum", "event_management_correlation_sum", "fargate_container_profiler_profiling_fargate_avg", "fargate_container_profiler_profiling_fargate_eks_avg", "fargate_tasks_count_avg", "fargate_tasks_count_hwm", "feature_flags_config_requests_sum", "flex_logs_compute_large_avg", "flex_logs_compute_medium_avg", "flex_logs_compute_small_avg", "flex_logs_compute_xlarge_avg", "flex_logs_compute_xsmall_avg", "flex_logs_starter_avg", "flex_logs_starter_storage_index_avg", "flex_logs_starter_storage_retention_adjustment_avg", "flex_stored_logs_avg", "forwarding_events_bytes_sum", "gcp_host_top99p", "heroku_host_top99p", "incident_management_monthly_active_users_hwm", "incident_management_seats_hwm", "indexed_events_count_sum", "infra_edge_monitoring_devices_top99p", "infra_host_basic_infra_basic_agent_top99p", "infra_host_basic_infra_basic_vsphere_top99p", "infra_host_basic_top99p", "infra_host_top99p", "infra_storage_mgmt_objects_count_avg", "ingested_events_bytes_sum", "iot_device_sum", "iot_device_top99p", "llm_observability_min_spend_sum", "llm_observability_sum", "mobile_rum_lite_session_count_sum", "mobile_rum_session_count_android_sum", "mobile_rum_session_count_flutter_sum", "mobile_rum_session_count_ios_sum", "mobile_rum_session_count_reactnative_sum", "mobile_rum_session_count_roku_sum", "mobile_rum_session_count_sum", "mobile_rum_units_sum", "ndm_netflow_events_sum", "netflow_indexed_events_count_sum", "network_device_wireless_top99p", "network_path_sum", "npm_host_top99p", "observability_pipelines_bytes_processed_sum", "oci_host_sum", "oci_host_top99p", "on_call_seat_hwm", "online_archive_events_count_sum", "opentelemetry_apm_host_top99p", "opentelemetry_host_top99p", "orgs", "product_analytics_sum", "profiling_aas_count_top99p", "profiling_host_top99p", "proxmox_host_sum", "proxmox_host_top99p", "published_app_hwm", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_sum", "rum_browser_lite_session_count_sum", "rum_browser_replay_session_count_sum", "rum_indexed_sessions_sum", "rum_ingested_sessions_sum", "rum_lite_session_count_sum", "rum_mobile_legacy_session_count_android_sum", "rum_mobile_legacy_session_count_flutter_sum", "rum_mobile_legacy_session_count_ios_sum", "rum_mobile_legacy_session_count_reactnative_sum", "rum_mobile_legacy_session_count_roku_sum", "rum_mobile_lite_session_count_android_sum", "rum_mobile_lite_session_count_flutter_sum", "rum_mobile_lite_session_count_ios_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_sum", "rum_mobile_lite_session_count_reactnative_sum", "rum_mobile_lite_session_count_roku_sum", "rum_mobile_lite_session_count_unity_sum", "rum_mobile_replay_session_count_android_sum", "rum_mobile_replay_session_count_ios_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_sum", "rum_mobile_replay_session_count_reactnative_sum", "rum_replay_session_count_sum", "rum_session_count_sum", "rum_session_replay_add_on_sum", "rum_total_session_count_sum", "rum_units_sum", "sca_fargate_count_avg", "sca_fargate_count_hwm", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg", "serverless_apps_apm_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_apm_azure_containerapp_instances_avg", "serverless_apps_apm_apm_fargate_ecs_tasks_avg", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_avg", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_excl_fargate_avg", "serverless_apps_azure_container_app_instances_avg", "serverless_apps_azure_count_avg", "serverless_apps_azure_function_app_instances_avg", "serverless_apps_azure_web_app_instances_avg", "serverless_apps_ecs_avg", "serverless_apps_eks_avg", "serverless_apps_excl_fargate_avg", "serverless_apps_excl_fargate_azure_container_app_instances_avg", "serverless_apps_excl_fargate_azure_function_app_instances_avg", "serverless_apps_excl_fargate_azure_web_app_instances_avg", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg", "serverless_apps_excl_fargate_google_cloud_run_instances_avg", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_google_cloud_functions_instances_avg", "serverless_apps_google_cloud_run_instances_avg", "serverless_apps_google_count_avg", "serverless_apps_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_total_count_avg", "siem_analyzed_logs_add_on_count_sum", "synthetics_browser_check_calls_count_sum", "synthetics_check_calls_count_sum", "synthetics_mobile_test_runs_sum", "synthetics_parallel_testing_max_slots_hwm", "trace_search_indexed_events_count_sum", "twol_ingested_events_bytes_sum", "universal_service_monitoring_host_top99p", "vsphere_host_top99p", "vuln_management_host_count_top99p", "workflow_executions_usage_sum"}) + datadog.DeleteKeys(additionalProperties, &[]string{"agent_host_top99p", "apm_azure_app_service_host_top99p", "apm_devsecops_host_top99p", "apm_enterprise_standalone_hosts_top99p", "apm_fargate_count_avg", "apm_host_top99p", "apm_pro_standalone_hosts_top99p", "appsec_fargate_count_avg", "asm_serverless_sum", "audit_logs_lines_indexed_sum", "audit_trail_enabled_hwm", "avg_profiled_fargate_tasks", "aws_host_top99p", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p", "billable_ingested_bytes_sum", "bits_ai_investigations_sum", "browser_rum_lite_session_count_sum", "browser_rum_replay_session_count_sum", "browser_rum_units_sum", "ccm_anthropic_spend_last", "ccm_aws_spend_last", "ccm_azure_spend_last", "ccm_confluent_spend_last", "ccm_databricks_spend_last", "ccm_elastic_spend_last", "ccm_fastly_spend_last", "ccm_gcp_spend_last", "ccm_github_spend_last", "ccm_mongodb_spend_last", "ccm_oci_spend_last", "ccm_openai_spend_last", "ccm_snowflake_spend_last", "ccm_spend_monitored_ent_last", "ccm_spend_monitored_pro_last", "ccm_twilio_spend_last", "ci_pipeline_indexed_spans_sum", "ci_test_indexed_spans_sum", "ci_visibility_itr_committers_hwm", "ci_visibility_pipeline_committers_hwm", "ci_visibility_test_committers_hwm", "cloud_cost_management_aws_host_count_avg", "cloud_cost_management_azure_host_count_avg", "cloud_cost_management_gcp_host_count_avg", "cloud_cost_management_host_count_avg", "cloud_cost_management_oci_host_count_avg", "cloud_siem_events_sum", "code_analysis_sa_committers_hwm", "code_analysis_sca_committers_hwm", "code_security_host_top99p", "container_avg", "container_excl_agent_avg", "container_hwm", "csm_container_enterprise_compliance_count_sum", "csm_container_enterprise_cws_count_sum", "csm_container_enterprise_total_count_sum", "csm_host_enterprise_aas_host_count_top99p", "csm_host_enterprise_aws_host_count_top99p", "csm_host_enterprise_azure_host_count_top99p", "csm_host_enterprise_compliance_host_count_top99p", "csm_host_enterprise_cws_host_count_top99p", "csm_host_enterprise_gcp_host_count_top99p", "csm_host_enterprise_oci_host_count_top99p", "csm_host_enterprise_total_host_count_top99p", "csm_host_pro_hosts_agentless_scanners_sum", "csm_host_pro_hosts_agentless_scanners_top99p", "csm_host_pro_oci_host_count_top99p", "cspm_aas_host_top99p", "cspm_aws_host_top99p", "cspm_azure_host_top99p", "cspm_container_avg", "cspm_container_hwm", "cspm_gcp_host_top99p", "cspm_host_top99p", "cspm_hosts_agentless_scanners_sum", "cspm_hosts_agentless_scanners_top99p", "custom_ts_avg", "cws_container_count_avg", "cws_fargate_task_avg", "cws_host_top99p", "data_jobs_monitoring_host_hr_sum", "date", "dbm_host_top99p", "dbm_queries_count_avg", "do_jobs_monitoring_orchestrators_job_hours_sum", "eph_infra_host_agent_sum", "eph_infra_host_alibaba_sum", "eph_infra_host_aws_sum", "eph_infra_host_azure_sum", "eph_infra_host_basic_infra_basic_agent_sum", "eph_infra_host_basic_infra_basic_vsphere_sum", "eph_infra_host_basic_sum", "eph_infra_host_ent_sum", "eph_infra_host_gcp_sum", "eph_infra_host_heroku_sum", "eph_infra_host_only_aas_sum", "eph_infra_host_only_vsphere_sum", "eph_infra_host_opentelemetry_apm_sum", "eph_infra_host_opentelemetry_sum", "eph_infra_host_pro_sum", "eph_infra_host_proplus_sum", "eph_infra_host_proxmox_sum", "error_tracking_apm_error_events_sum", "error_tracking_error_events_sum", "error_tracking_events_sum", "error_tracking_rum_error_events_sum", "event_management_correlation_correlated_events_sum", "event_management_correlation_correlated_related_events_sum", "event_management_correlation_sum", "fargate_container_profiler_profiling_fargate_avg", "fargate_container_profiler_profiling_fargate_eks_avg", "fargate_tasks_count_avg", "fargate_tasks_count_hwm", "feature_flags_config_requests_sum", "flex_logs_compute_large_avg", "flex_logs_compute_medium_avg", "flex_logs_compute_small_avg", "flex_logs_compute_xlarge_avg", "flex_logs_compute_xsmall_avg", "flex_logs_starter_avg", "flex_logs_starter_storage_index_avg", "flex_logs_starter_storage_retention_adjustment_avg", "flex_stored_logs_avg", "forwarding_events_bytes_sum", "gcp_host_top99p", "heroku_host_top99p", "incident_management_monthly_active_users_hwm", "incident_management_seats_hwm", "indexed_events_count_sum", "infra_edge_monitoring_devices_top99p", "infra_host_basic_infra_basic_agent_top99p", "infra_host_basic_infra_basic_vsphere_top99p", "infra_host_basic_top99p", "infra_host_top99p", "infra_storage_mgmt_objects_count_avg", "ingested_events_bytes_sum", "iot_device_sum", "iot_device_top99p", "llm_observability_min_spend_sum", "llm_observability_sum", "mobile_rum_lite_session_count_sum", "mobile_rum_session_count_android_sum", "mobile_rum_session_count_flutter_sum", "mobile_rum_session_count_ios_sum", "mobile_rum_session_count_reactnative_sum", "mobile_rum_session_count_roku_sum", "mobile_rum_session_count_sum", "mobile_rum_units_sum", "ndm_netflow_events_sum", "netflow_indexed_events_count_sum", "network_device_wireless_top99p", "network_path_sum", "npm_host_top99p", "observability_pipelines_bytes_processed_sum", "oci_host_sum", "oci_host_top99p", "on_call_seat_hwm", "online_archive_events_count_sum", "opentelemetry_apm_host_top99p", "opentelemetry_host_top99p", "orgs", "product_analytics_sum", "profiling_aas_count_top99p", "profiling_host_top99p", "proxmox_host_sum", "proxmox_host_top99p", "published_app_hwm", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_sum", "rum_browser_lite_session_count_sum", "rum_browser_replay_session_count_sum", "rum_indexed_sessions_sum", "rum_ingested_sessions_sum", "rum_lite_session_count_sum", "rum_mobile_legacy_session_count_android_sum", "rum_mobile_legacy_session_count_flutter_sum", "rum_mobile_legacy_session_count_ios_sum", "rum_mobile_legacy_session_count_reactnative_sum", "rum_mobile_legacy_session_count_roku_sum", "rum_mobile_lite_session_count_android_sum", "rum_mobile_lite_session_count_flutter_sum", "rum_mobile_lite_session_count_ios_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_sum", "rum_mobile_lite_session_count_reactnative_sum", "rum_mobile_lite_session_count_roku_sum", "rum_mobile_lite_session_count_unity_sum", "rum_mobile_replay_session_count_android_sum", "rum_mobile_replay_session_count_ios_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_sum", "rum_mobile_replay_session_count_reactnative_sum", "rum_replay_session_count_sum", "rum_session_count_sum", "rum_session_replay_add_on_sum", "rum_total_session_count_sum", "rum_units_sum", "sca_fargate_count_avg", "sca_fargate_count_hwm", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg", "serverless_apps_apm_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_apm_azure_containerapp_instances_avg", "serverless_apps_apm_apm_fargate_ecs_tasks_avg", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_avg", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_excl_fargate_avg", "serverless_apps_azure_container_app_instances_avg", "serverless_apps_azure_count_avg", "serverless_apps_azure_function_app_instances_avg", "serverless_apps_azure_web_app_instances_avg", "serverless_apps_ecs_avg", "serverless_apps_eks_avg", "serverless_apps_excl_fargate_avg", "serverless_apps_excl_fargate_azure_container_app_instances_avg", "serverless_apps_excl_fargate_azure_function_app_instances_avg", "serverless_apps_excl_fargate_azure_web_app_instances_avg", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg", "serverless_apps_excl_fargate_google_cloud_run_instances_avg", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_google_cloud_functions_instances_avg", "serverless_apps_google_cloud_run_instances_avg", "serverless_apps_google_count_avg", "serverless_apps_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_total_count_avg", "siem_analyzed_logs_add_on_count_sum", "synthetics_browser_check_calls_count_sum", "synthetics_check_calls_count_sum", "synthetics_mobile_test_runs_sum", "synthetics_parallel_testing_max_slots_hwm", "trace_search_indexed_events_count_sum", "twol_ingested_events_bytes_sum", "universal_service_monitoring_host_top99p", "vsphere_host_top99p", "vuln_management_host_count_top99p", "workflow_executions_usage_sum"}) } else { return err } @@ -8413,6 +8583,8 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { o.CsmHostEnterpriseGcpHostCountTop99p = all.CsmHostEnterpriseGcpHostCountTop99p o.CsmHostEnterpriseOciHostCountTop99p = all.CsmHostEnterpriseOciHostCountTop99p o.CsmHostEnterpriseTotalHostCountTop99p = all.CsmHostEnterpriseTotalHostCountTop99p + o.CsmHostProHostsAgentlessScannersSum = all.CsmHostProHostsAgentlessScannersSum + o.CsmHostProHostsAgentlessScannersTop99p = all.CsmHostProHostsAgentlessScannersTop99p o.CsmHostProOciHostCountTop99p = all.CsmHostProOciHostCountTop99p o.CspmAasHostTop99p = all.CspmAasHostTop99p o.CspmAwsHostTop99p = all.CspmAwsHostTop99p @@ -8421,6 +8593,8 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { o.CspmContainerHwm = all.CspmContainerHwm o.CspmGcpHostTop99p = all.CspmGcpHostTop99p o.CspmHostTop99p = all.CspmHostTop99p + o.CspmHostsAgentlessScannersSum = all.CspmHostsAgentlessScannersSum + o.CspmHostsAgentlessScannersTop99p = all.CspmHostsAgentlessScannersTop99p o.CustomTsAvg = all.CustomTsAvg o.CwsContainerCountAvg = all.CwsContainerCountAvg o.CwsFargateTaskAvg = all.CwsFargateTaskAvg @@ -8429,6 +8603,7 @@ func (o *UsageSummaryDate) UnmarshalJSON(bytes []byte) (err error) { o.Date = all.Date o.DbmHostTop99p = all.DbmHostTop99p o.DbmQueriesCountAvg = all.DbmQueriesCountAvg + o.DoJobsMonitoringOrchestratorsJobHoursSum = all.DoJobsMonitoringOrchestratorsJobHoursSum o.EphInfraHostAgentSum = all.EphInfraHostAgentSum o.EphInfraHostAlibabaSum = all.EphInfraHostAlibabaSum o.EphInfraHostAwsSum = all.EphInfraHostAwsSum diff --git a/api/datadogV1/model_usage_summary_date_org.go b/api/datadogV1/model_usage_summary_date_org.go index b0b70b1e7db..160f0ea5f3c 100644 --- a/api/datadogV1/model_usage_summary_date_org.go +++ b/api/datadogV1/model_usage_summary_date_org.go @@ -147,6 +147,10 @@ type UsageSummaryDateOrg struct { CsmHostEnterpriseOciHostCountTop99p *int64 `json:"csm_host_enterprise_oci_host_count_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current date for the given org. CsmHostEnterpriseTotalHostCountTop99p *int64 `json:"csm_host_enterprise_total_host_count_top99p,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CsmHostProHostsAgentlessScannersSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CsmHostProHostsAgentlessScannersTop99p *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current date for the given org. CsmHostProOciHostCountTop99p *int64 `json:"csm_host_pro_oci_host_count_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro Azure app services hosts over all hours in the current date for the given org. @@ -163,6 +167,10 @@ type UsageSummaryDateOrg struct { CspmGcpHostTop99p *int64 `json:"cspm_gcp_host_top99p,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current date for the given org. CspmHostTop99p *int64 `json:"cspm_host_top99p,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CspmHostsAgentlessScannersSum *int64 `json:"cspm_hosts_agentless_scanners_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current date for the given org. + CspmHostsAgentlessScannersTop99p *int64 `json:"cspm_hosts_agentless_scanners_top99p,omitempty"` // Shows the average number of distinct historical custom metrics over all hours in the current date for the given org. CustomHistoricalTsAvg *int64 `json:"custom_historical_ts_avg,omitempty"` // Shows the average number of distinct live custom metrics over all hours in the current date for the given org. @@ -181,6 +189,8 @@ type UsageSummaryDateOrg struct { DbmHostTop99pSum *int64 `json:"dbm_host_top99p_sum,omitempty"` // Shows the average of all distinct Database Monitoring normalized queries over all hours in the current month for the given org. DbmQueriesAvgSum *int64 `json:"dbm_queries_avg_sum,omitempty"` + // Shows the sum of all orchestrator job hours over all hours in the current date for the given org. + DoJobsMonitoringOrchestratorsJobHoursSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_sum,omitempty"` // Shows the sum of all ephemeral infrastructure hosts with the Datadog Agent over all hours in the current date for the given org. EphInfraHostAgentSum *int64 `json:"eph_infra_host_agent_sum,omitempty"` // Shows the sum of all ephemeral infrastructure hosts on Alibaba over all hours in the current date for the given org. @@ -2428,6 +2438,62 @@ func (o *UsageSummaryDateOrg) SetCsmHostEnterpriseTotalHostCountTop99p(v int64) o.CsmHostEnterpriseTotalHostCountTop99p = &v } +// GetCsmHostProHostsAgentlessScannersSum returns the CsmHostProHostsAgentlessScannersSum field value if set, zero value otherwise. +func (o *UsageSummaryDateOrg) GetCsmHostProHostsAgentlessScannersSum() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersSum == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersSum +} + +// GetCsmHostProHostsAgentlessScannersSumOk returns a tuple with the CsmHostProHostsAgentlessScannersSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDateOrg) GetCsmHostProHostsAgentlessScannersSumOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersSum == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersSum, true +} + +// HasCsmHostProHostsAgentlessScannersSum returns a boolean if a field has been set. +func (o *UsageSummaryDateOrg) HasCsmHostProHostsAgentlessScannersSum() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersSum != nil +} + +// SetCsmHostProHostsAgentlessScannersSum gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersSum field. +func (o *UsageSummaryDateOrg) SetCsmHostProHostsAgentlessScannersSum(v int64) { + o.CsmHostProHostsAgentlessScannersSum = &v +} + +// GetCsmHostProHostsAgentlessScannersTop99p returns the CsmHostProHostsAgentlessScannersTop99p field value if set, zero value otherwise. +func (o *UsageSummaryDateOrg) GetCsmHostProHostsAgentlessScannersTop99p() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99p == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersTop99p +} + +// GetCsmHostProHostsAgentlessScannersTop99pOk returns a tuple with the CsmHostProHostsAgentlessScannersTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDateOrg) GetCsmHostProHostsAgentlessScannersTop99pOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99p == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersTop99p, true +} + +// HasCsmHostProHostsAgentlessScannersTop99p returns a boolean if a field has been set. +func (o *UsageSummaryDateOrg) HasCsmHostProHostsAgentlessScannersTop99p() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersTop99p != nil +} + +// SetCsmHostProHostsAgentlessScannersTop99p gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersTop99p field. +func (o *UsageSummaryDateOrg) SetCsmHostProHostsAgentlessScannersTop99p(v int64) { + o.CsmHostProHostsAgentlessScannersTop99p = &v +} + // GetCsmHostProOciHostCountTop99p returns the CsmHostProOciHostCountTop99p field value if set, zero value otherwise. func (o *UsageSummaryDateOrg) GetCsmHostProOciHostCountTop99p() int64 { if o == nil || o.CsmHostProOciHostCountTop99p == nil { @@ -2652,6 +2718,62 @@ func (o *UsageSummaryDateOrg) SetCspmHostTop99p(v int64) { o.CspmHostTop99p = &v } +// GetCspmHostsAgentlessScannersSum returns the CspmHostsAgentlessScannersSum field value if set, zero value otherwise. +func (o *UsageSummaryDateOrg) GetCspmHostsAgentlessScannersSum() int64 { + if o == nil || o.CspmHostsAgentlessScannersSum == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersSum +} + +// GetCspmHostsAgentlessScannersSumOk returns a tuple with the CspmHostsAgentlessScannersSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDateOrg) GetCspmHostsAgentlessScannersSumOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersSum == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersSum, true +} + +// HasCspmHostsAgentlessScannersSum returns a boolean if a field has been set. +func (o *UsageSummaryDateOrg) HasCspmHostsAgentlessScannersSum() bool { + return o != nil && o.CspmHostsAgentlessScannersSum != nil +} + +// SetCspmHostsAgentlessScannersSum gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersSum field. +func (o *UsageSummaryDateOrg) SetCspmHostsAgentlessScannersSum(v int64) { + o.CspmHostsAgentlessScannersSum = &v +} + +// GetCspmHostsAgentlessScannersTop99p returns the CspmHostsAgentlessScannersTop99p field value if set, zero value otherwise. +func (o *UsageSummaryDateOrg) GetCspmHostsAgentlessScannersTop99p() int64 { + if o == nil || o.CspmHostsAgentlessScannersTop99p == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersTop99p +} + +// GetCspmHostsAgentlessScannersTop99pOk returns a tuple with the CspmHostsAgentlessScannersTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDateOrg) GetCspmHostsAgentlessScannersTop99pOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersTop99p == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersTop99p, true +} + +// HasCspmHostsAgentlessScannersTop99p returns a boolean if a field has been set. +func (o *UsageSummaryDateOrg) HasCspmHostsAgentlessScannersTop99p() bool { + return o != nil && o.CspmHostsAgentlessScannersTop99p != nil +} + +// SetCspmHostsAgentlessScannersTop99p gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersTop99p field. +func (o *UsageSummaryDateOrg) SetCspmHostsAgentlessScannersTop99p(v int64) { + o.CspmHostsAgentlessScannersTop99p = &v +} + // GetCustomHistoricalTsAvg returns the CustomHistoricalTsAvg field value if set, zero value otherwise. func (o *UsageSummaryDateOrg) GetCustomHistoricalTsAvg() int64 { if o == nil || o.CustomHistoricalTsAvg == nil { @@ -2904,6 +3026,34 @@ func (o *UsageSummaryDateOrg) SetDbmQueriesAvgSum(v int64) { o.DbmQueriesAvgSum = &v } +// GetDoJobsMonitoringOrchestratorsJobHoursSum returns the DoJobsMonitoringOrchestratorsJobHoursSum field value if set, zero value otherwise. +func (o *UsageSummaryDateOrg) GetDoJobsMonitoringOrchestratorsJobHoursSum() int64 { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursSum == nil { + var ret int64 + return ret + } + return *o.DoJobsMonitoringOrchestratorsJobHoursSum +} + +// GetDoJobsMonitoringOrchestratorsJobHoursSumOk returns a tuple with the DoJobsMonitoringOrchestratorsJobHoursSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryDateOrg) GetDoJobsMonitoringOrchestratorsJobHoursSumOk() (*int64, bool) { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursSum == nil { + return nil, false + } + return o.DoJobsMonitoringOrchestratorsJobHoursSum, true +} + +// HasDoJobsMonitoringOrchestratorsJobHoursSum returns a boolean if a field has been set. +func (o *UsageSummaryDateOrg) HasDoJobsMonitoringOrchestratorsJobHoursSum() bool { + return o != nil && o.DoJobsMonitoringOrchestratorsJobHoursSum != nil +} + +// SetDoJobsMonitoringOrchestratorsJobHoursSum gets a reference to the given int64 and assigns it to the DoJobsMonitoringOrchestratorsJobHoursSum field. +func (o *UsageSummaryDateOrg) SetDoJobsMonitoringOrchestratorsJobHoursSum(v int64) { + o.DoJobsMonitoringOrchestratorsJobHoursSum = &v +} + // GetEphInfraHostAgentSum returns the EphInfraHostAgentSum field value if set, zero value otherwise. func (o *UsageSummaryDateOrg) GetEphInfraHostAgentSum() int64 { if o == nil || o.EphInfraHostAgentSum == nil { @@ -7739,6 +7889,12 @@ func (o UsageSummaryDateOrg) MarshalJSON() ([]byte, error) { if o.CsmHostEnterpriseTotalHostCountTop99p != nil { toSerialize["csm_host_enterprise_total_host_count_top99p"] = o.CsmHostEnterpriseTotalHostCountTop99p } + if o.CsmHostProHostsAgentlessScannersSum != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_sum"] = o.CsmHostProHostsAgentlessScannersSum + } + if o.CsmHostProHostsAgentlessScannersTop99p != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_top99p"] = o.CsmHostProHostsAgentlessScannersTop99p + } if o.CsmHostProOciHostCountTop99p != nil { toSerialize["csm_host_pro_oci_host_count_top99p"] = o.CsmHostProOciHostCountTop99p } @@ -7763,6 +7919,12 @@ func (o UsageSummaryDateOrg) MarshalJSON() ([]byte, error) { if o.CspmHostTop99p != nil { toSerialize["cspm_host_top99p"] = o.CspmHostTop99p } + if o.CspmHostsAgentlessScannersSum != nil { + toSerialize["cspm_hosts_agentless_scanners_sum"] = o.CspmHostsAgentlessScannersSum + } + if o.CspmHostsAgentlessScannersTop99p != nil { + toSerialize["cspm_hosts_agentless_scanners_top99p"] = o.CspmHostsAgentlessScannersTop99p + } if o.CustomHistoricalTsAvg != nil { toSerialize["custom_historical_ts_avg"] = o.CustomHistoricalTsAvg } @@ -7790,6 +7952,9 @@ func (o UsageSummaryDateOrg) MarshalJSON() ([]byte, error) { if o.DbmQueriesAvgSum != nil { toSerialize["dbm_queries_avg_sum"] = o.DbmQueriesAvgSum } + if o.DoJobsMonitoringOrchestratorsJobHoursSum != nil { + toSerialize["do_jobs_monitoring_orchestrators_job_hours_sum"] = o.DoJobsMonitoringOrchestratorsJobHoursSum + } if o.EphInfraHostAgentSum != nil { toSerialize["eph_infra_host_agent_sum"] = o.EphInfraHostAgentSum } @@ -8359,6 +8524,8 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { CsmHostEnterpriseGcpHostCountTop99p *int64 `json:"csm_host_enterprise_gcp_host_count_top99p,omitempty"` CsmHostEnterpriseOciHostCountTop99p *int64 `json:"csm_host_enterprise_oci_host_count_top99p,omitempty"` CsmHostEnterpriseTotalHostCountTop99p *int64 `json:"csm_host_enterprise_total_host_count_top99p,omitempty"` + CsmHostProHostsAgentlessScannersSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_sum,omitempty"` + CsmHostProHostsAgentlessScannersTop99p *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p,omitempty"` CsmHostProOciHostCountTop99p *int64 `json:"csm_host_pro_oci_host_count_top99p,omitempty"` CspmAasHostTop99p *int64 `json:"cspm_aas_host_top99p,omitempty"` CspmAwsHostTop99p *int64 `json:"cspm_aws_host_top99p,omitempty"` @@ -8367,6 +8534,8 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { CspmContainerHwm *int64 `json:"cspm_container_hwm,omitempty"` CspmGcpHostTop99p *int64 `json:"cspm_gcp_host_top99p,omitempty"` CspmHostTop99p *int64 `json:"cspm_host_top99p,omitempty"` + CspmHostsAgentlessScannersSum *int64 `json:"cspm_hosts_agentless_scanners_sum,omitempty"` + CspmHostsAgentlessScannersTop99p *int64 `json:"cspm_hosts_agentless_scanners_top99p,omitempty"` CustomHistoricalTsAvg *int64 `json:"custom_historical_ts_avg,omitempty"` CustomLiveTsAvg *int64 `json:"custom_live_ts_avg,omitempty"` CustomTsAvg *int64 `json:"custom_ts_avg,omitempty"` @@ -8376,6 +8545,7 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { DataJobsMonitoringHostHrSum *int64 `json:"data_jobs_monitoring_host_hr_sum,omitempty"` DbmHostTop99pSum *int64 `json:"dbm_host_top99p_sum,omitempty"` DbmQueriesAvgSum *int64 `json:"dbm_queries_avg_sum,omitempty"` + DoJobsMonitoringOrchestratorsJobHoursSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_sum,omitempty"` EphInfraHostAgentSum *int64 `json:"eph_infra_host_agent_sum,omitempty"` EphInfraHostAlibabaSum *int64 `json:"eph_infra_host_alibaba_sum,omitempty"` EphInfraHostAwsSum *int64 `json:"eph_infra_host_aws_sum,omitempty"` @@ -8546,7 +8716,7 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"account_name", "account_public_id", "agent_host_top99p", "apm_azure_app_service_host_top99p", "apm_devsecops_host_top99p", "apm_enterprise_standalone_hosts_top99p", "apm_fargate_count_avg", "apm_host_top99p", "apm_pro_standalone_hosts_top99p", "appsec_fargate_count_avg", "asm_serverless_sum", "audit_logs_lines_indexed_sum", "audit_trail_enabled_hwm", "avg_profiled_fargate_tasks", "aws_host_top99p", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p", "billable_ingested_bytes_sum", "bits_ai_investigations_sum", "browser_rum_lite_session_count_sum", "browser_rum_replay_session_count_sum", "browser_rum_units_sum", "ccm_anthropic_spend_last", "ccm_aws_spend_last", "ccm_azure_spend_last", "ccm_confluent_spend_last", "ccm_databricks_spend_last", "ccm_elastic_spend_last", "ccm_fastly_spend_last", "ccm_gcp_spend_last", "ccm_github_spend_last", "ccm_mongodb_spend_last", "ccm_oci_spend_last", "ccm_openai_spend_last", "ccm_snowflake_spend_last", "ccm_spend_monitored_ent_last", "ccm_spend_monitored_pro_last", "ccm_twilio_spend_last", "ci_pipeline_indexed_spans_sum", "ci_test_indexed_spans_sum", "ci_visibility_itr_committers_hwm", "ci_visibility_pipeline_committers_hwm", "ci_visibility_test_committers_hwm", "cloud_cost_management_aws_host_count_avg", "cloud_cost_management_azure_host_count_avg", "cloud_cost_management_gcp_host_count_avg", "cloud_cost_management_host_count_avg", "cloud_cost_management_oci_host_count_avg", "cloud_siem_events_sum", "code_analysis_sa_committers_hwm", "code_analysis_sca_committers_hwm", "code_security_host_top99p", "container_avg", "container_excl_agent_avg", "container_hwm", "csm_container_enterprise_compliance_count_sum", "csm_container_enterprise_cws_count_sum", "csm_container_enterprise_total_count_sum", "csm_host_enterprise_aas_host_count_top99p", "csm_host_enterprise_aws_host_count_top99p", "csm_host_enterprise_azure_host_count_top99p", "csm_host_enterprise_compliance_host_count_top99p", "csm_host_enterprise_cws_host_count_top99p", "csm_host_enterprise_gcp_host_count_top99p", "csm_host_enterprise_oci_host_count_top99p", "csm_host_enterprise_total_host_count_top99p", "csm_host_pro_oci_host_count_top99p", "cspm_aas_host_top99p", "cspm_aws_host_top99p", "cspm_azure_host_top99p", "cspm_container_avg", "cspm_container_hwm", "cspm_gcp_host_top99p", "cspm_host_top99p", "custom_historical_ts_avg", "custom_live_ts_avg", "custom_ts_avg", "cws_container_count_avg", "cws_fargate_task_avg", "cws_host_top99p", "data_jobs_monitoring_host_hr_sum", "dbm_host_top99p_sum", "dbm_queries_avg_sum", "eph_infra_host_agent_sum", "eph_infra_host_alibaba_sum", "eph_infra_host_aws_sum", "eph_infra_host_azure_sum", "eph_infra_host_basic_infra_basic_agent_sum", "eph_infra_host_basic_infra_basic_vsphere_sum", "eph_infra_host_basic_sum", "eph_infra_host_ent_sum", "eph_infra_host_gcp_sum", "eph_infra_host_heroku_sum", "eph_infra_host_only_aas_sum", "eph_infra_host_only_vsphere_sum", "eph_infra_host_opentelemetry_apm_sum", "eph_infra_host_opentelemetry_sum", "eph_infra_host_pro_sum", "eph_infra_host_proplus_sum", "eph_infra_host_proxmox_sum", "error_tracking_apm_error_events_sum", "error_tracking_error_events_sum", "error_tracking_events_sum", "error_tracking_rum_error_events_sum", "event_management_correlation_correlated_events_sum", "event_management_correlation_correlated_related_events_sum", "event_management_correlation_sum", "fargate_container_profiler_profiling_fargate_avg", "fargate_container_profiler_profiling_fargate_eks_avg", "fargate_tasks_count_avg", "fargate_tasks_count_hwm", "feature_flags_config_requests_sum", "flex_logs_compute_large_avg", "flex_logs_compute_medium_avg", "flex_logs_compute_small_avg", "flex_logs_compute_xlarge_avg", "flex_logs_compute_xsmall_avg", "flex_logs_starter_avg", "flex_logs_starter_storage_index_avg", "flex_logs_starter_storage_retention_adjustment_avg", "flex_stored_logs_avg", "forwarding_events_bytes_sum", "gcp_host_top99p", "heroku_host_top99p", "id", "incident_management_monthly_active_users_hwm", "incident_management_seats_hwm", "indexed_events_count_sum", "infra_edge_monitoring_devices_top99p", "infra_host_basic_infra_basic_agent_top99p", "infra_host_basic_infra_basic_vsphere_top99p", "infra_host_basic_top99p", "infra_host_top99p", "infra_storage_mgmt_objects_count_avg", "ingested_events_bytes_sum", "iot_device_agg_sum", "iot_device_top99p_sum", "llm_observability_min_spend_sum", "llm_observability_sum", "mobile_rum_lite_session_count_sum", "mobile_rum_session_count_android_sum", "mobile_rum_session_count_flutter_sum", "mobile_rum_session_count_ios_sum", "mobile_rum_session_count_reactnative_sum", "mobile_rum_session_count_roku_sum", "mobile_rum_session_count_sum", "mobile_rum_units_sum", "name", "ndm_netflow_events_sum", "netflow_indexed_events_count_sum", "network_device_wireless_top99p", "network_path_sum", "npm_host_top99p", "observability_pipelines_bytes_processed_sum", "oci_host_sum", "oci_host_top99p", "on_call_seat_hwm", "online_archive_events_count_sum", "opentelemetry_apm_host_top99p", "opentelemetry_host_top99p", "product_analytics_sum", "profiling_aas_count_top99p", "profiling_host_top99p", "proxmox_host_sum", "proxmox_host_top99p", "public_id", "published_app_hwm", "region", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_sum", "rum_browser_lite_session_count_sum", "rum_browser_replay_session_count_sum", "rum_indexed_sessions_sum", "rum_ingested_sessions_sum", "rum_lite_session_count_sum", "rum_mobile_legacy_session_count_android_sum", "rum_mobile_legacy_session_count_flutter_sum", "rum_mobile_legacy_session_count_ios_sum", "rum_mobile_legacy_session_count_reactnative_sum", "rum_mobile_legacy_session_count_roku_sum", "rum_mobile_lite_session_count_android_sum", "rum_mobile_lite_session_count_flutter_sum", "rum_mobile_lite_session_count_ios_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_sum", "rum_mobile_lite_session_count_reactnative_sum", "rum_mobile_lite_session_count_roku_sum", "rum_mobile_lite_session_count_unity_sum", "rum_mobile_replay_session_count_android_sum", "rum_mobile_replay_session_count_ios_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_sum", "rum_mobile_replay_session_count_reactnative_sum", "rum_replay_session_count_sum", "rum_session_count_sum", "rum_session_replay_add_on_sum", "rum_total_session_count_sum", "rum_units_sum", "sca_fargate_count_avg", "sca_fargate_count_hwm", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg", "serverless_apps_apm_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_apm_azure_containerapp_instances_avg", "serverless_apps_apm_apm_fargate_ecs_tasks_avg", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_avg", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_excl_fargate_avg", "serverless_apps_azure_container_app_instances_avg", "serverless_apps_azure_count_avg", "serverless_apps_azure_function_app_instances_avg", "serverless_apps_azure_web_app_instances_avg", "serverless_apps_ecs_avg", "serverless_apps_eks_avg", "serverless_apps_excl_fargate_avg", "serverless_apps_excl_fargate_azure_container_app_instances_avg", "serverless_apps_excl_fargate_azure_function_app_instances_avg", "serverless_apps_excl_fargate_azure_web_app_instances_avg", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg", "serverless_apps_excl_fargate_google_cloud_run_instances_avg", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_google_cloud_functions_instances_avg", "serverless_apps_google_cloud_run_instances_avg", "serverless_apps_google_count_avg", "serverless_apps_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_total_count_avg", "siem_analyzed_logs_add_on_count_sum", "synthetics_browser_check_calls_count_sum", "synthetics_check_calls_count_sum", "synthetics_mobile_test_runs_sum", "synthetics_parallel_testing_max_slots_hwm", "trace_search_indexed_events_count_sum", "twol_ingested_events_bytes_sum", "universal_service_monitoring_host_top99p", "vsphere_host_top99p", "vuln_management_host_count_top99p", "workflow_executions_usage_sum"}) + datadog.DeleteKeys(additionalProperties, &[]string{"account_name", "account_public_id", "agent_host_top99p", "apm_azure_app_service_host_top99p", "apm_devsecops_host_top99p", "apm_enterprise_standalone_hosts_top99p", "apm_fargate_count_avg", "apm_host_top99p", "apm_pro_standalone_hosts_top99p", "appsec_fargate_count_avg", "asm_serverless_sum", "audit_logs_lines_indexed_sum", "audit_trail_enabled_hwm", "avg_profiled_fargate_tasks", "aws_host_top99p", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p", "billable_ingested_bytes_sum", "bits_ai_investigations_sum", "browser_rum_lite_session_count_sum", "browser_rum_replay_session_count_sum", "browser_rum_units_sum", "ccm_anthropic_spend_last", "ccm_aws_spend_last", "ccm_azure_spend_last", "ccm_confluent_spend_last", "ccm_databricks_spend_last", "ccm_elastic_spend_last", "ccm_fastly_spend_last", "ccm_gcp_spend_last", "ccm_github_spend_last", "ccm_mongodb_spend_last", "ccm_oci_spend_last", "ccm_openai_spend_last", "ccm_snowflake_spend_last", "ccm_spend_monitored_ent_last", "ccm_spend_monitored_pro_last", "ccm_twilio_spend_last", "ci_pipeline_indexed_spans_sum", "ci_test_indexed_spans_sum", "ci_visibility_itr_committers_hwm", "ci_visibility_pipeline_committers_hwm", "ci_visibility_test_committers_hwm", "cloud_cost_management_aws_host_count_avg", "cloud_cost_management_azure_host_count_avg", "cloud_cost_management_gcp_host_count_avg", "cloud_cost_management_host_count_avg", "cloud_cost_management_oci_host_count_avg", "cloud_siem_events_sum", "code_analysis_sa_committers_hwm", "code_analysis_sca_committers_hwm", "code_security_host_top99p", "container_avg", "container_excl_agent_avg", "container_hwm", "csm_container_enterprise_compliance_count_sum", "csm_container_enterprise_cws_count_sum", "csm_container_enterprise_total_count_sum", "csm_host_enterprise_aas_host_count_top99p", "csm_host_enterprise_aws_host_count_top99p", "csm_host_enterprise_azure_host_count_top99p", "csm_host_enterprise_compliance_host_count_top99p", "csm_host_enterprise_cws_host_count_top99p", "csm_host_enterprise_gcp_host_count_top99p", "csm_host_enterprise_oci_host_count_top99p", "csm_host_enterprise_total_host_count_top99p", "csm_host_pro_hosts_agentless_scanners_sum", "csm_host_pro_hosts_agentless_scanners_top99p", "csm_host_pro_oci_host_count_top99p", "cspm_aas_host_top99p", "cspm_aws_host_top99p", "cspm_azure_host_top99p", "cspm_container_avg", "cspm_container_hwm", "cspm_gcp_host_top99p", "cspm_host_top99p", "cspm_hosts_agentless_scanners_sum", "cspm_hosts_agentless_scanners_top99p", "custom_historical_ts_avg", "custom_live_ts_avg", "custom_ts_avg", "cws_container_count_avg", "cws_fargate_task_avg", "cws_host_top99p", "data_jobs_monitoring_host_hr_sum", "dbm_host_top99p_sum", "dbm_queries_avg_sum", "do_jobs_monitoring_orchestrators_job_hours_sum", "eph_infra_host_agent_sum", "eph_infra_host_alibaba_sum", "eph_infra_host_aws_sum", "eph_infra_host_azure_sum", "eph_infra_host_basic_infra_basic_agent_sum", "eph_infra_host_basic_infra_basic_vsphere_sum", "eph_infra_host_basic_sum", "eph_infra_host_ent_sum", "eph_infra_host_gcp_sum", "eph_infra_host_heroku_sum", "eph_infra_host_only_aas_sum", "eph_infra_host_only_vsphere_sum", "eph_infra_host_opentelemetry_apm_sum", "eph_infra_host_opentelemetry_sum", "eph_infra_host_pro_sum", "eph_infra_host_proplus_sum", "eph_infra_host_proxmox_sum", "error_tracking_apm_error_events_sum", "error_tracking_error_events_sum", "error_tracking_events_sum", "error_tracking_rum_error_events_sum", "event_management_correlation_correlated_events_sum", "event_management_correlation_correlated_related_events_sum", "event_management_correlation_sum", "fargate_container_profiler_profiling_fargate_avg", "fargate_container_profiler_profiling_fargate_eks_avg", "fargate_tasks_count_avg", "fargate_tasks_count_hwm", "feature_flags_config_requests_sum", "flex_logs_compute_large_avg", "flex_logs_compute_medium_avg", "flex_logs_compute_small_avg", "flex_logs_compute_xlarge_avg", "flex_logs_compute_xsmall_avg", "flex_logs_starter_avg", "flex_logs_starter_storage_index_avg", "flex_logs_starter_storage_retention_adjustment_avg", "flex_stored_logs_avg", "forwarding_events_bytes_sum", "gcp_host_top99p", "heroku_host_top99p", "id", "incident_management_monthly_active_users_hwm", "incident_management_seats_hwm", "indexed_events_count_sum", "infra_edge_monitoring_devices_top99p", "infra_host_basic_infra_basic_agent_top99p", "infra_host_basic_infra_basic_vsphere_top99p", "infra_host_basic_top99p", "infra_host_top99p", "infra_storage_mgmt_objects_count_avg", "ingested_events_bytes_sum", "iot_device_agg_sum", "iot_device_top99p_sum", "llm_observability_min_spend_sum", "llm_observability_sum", "mobile_rum_lite_session_count_sum", "mobile_rum_session_count_android_sum", "mobile_rum_session_count_flutter_sum", "mobile_rum_session_count_ios_sum", "mobile_rum_session_count_reactnative_sum", "mobile_rum_session_count_roku_sum", "mobile_rum_session_count_sum", "mobile_rum_units_sum", "name", "ndm_netflow_events_sum", "netflow_indexed_events_count_sum", "network_device_wireless_top99p", "network_path_sum", "npm_host_top99p", "observability_pipelines_bytes_processed_sum", "oci_host_sum", "oci_host_top99p", "on_call_seat_hwm", "online_archive_events_count_sum", "opentelemetry_apm_host_top99p", "opentelemetry_host_top99p", "product_analytics_sum", "profiling_aas_count_top99p", "profiling_host_top99p", "proxmox_host_sum", "proxmox_host_top99p", "public_id", "published_app_hwm", "region", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_sum", "rum_browser_lite_session_count_sum", "rum_browser_replay_session_count_sum", "rum_indexed_sessions_sum", "rum_ingested_sessions_sum", "rum_lite_session_count_sum", "rum_mobile_legacy_session_count_android_sum", "rum_mobile_legacy_session_count_flutter_sum", "rum_mobile_legacy_session_count_ios_sum", "rum_mobile_legacy_session_count_reactnative_sum", "rum_mobile_legacy_session_count_roku_sum", "rum_mobile_lite_session_count_android_sum", "rum_mobile_lite_session_count_flutter_sum", "rum_mobile_lite_session_count_ios_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_sum", "rum_mobile_lite_session_count_reactnative_sum", "rum_mobile_lite_session_count_roku_sum", "rum_mobile_lite_session_count_unity_sum", "rum_mobile_replay_session_count_android_sum", "rum_mobile_replay_session_count_ios_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_sum", "rum_mobile_replay_session_count_reactnative_sum", "rum_replay_session_count_sum", "rum_session_count_sum", "rum_session_replay_add_on_sum", "rum_total_session_count_sum", "rum_units_sum", "sca_fargate_count_avg", "sca_fargate_count_hwm", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg", "serverless_apps_apm_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_apm_azure_containerapp_instances_avg", "serverless_apps_apm_apm_fargate_ecs_tasks_avg", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_avg", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg", "serverless_apps_apm_excl_fargate_avg", "serverless_apps_azure_container_app_instances_avg", "serverless_apps_azure_count_avg", "serverless_apps_azure_function_app_instances_avg", "serverless_apps_azure_web_app_instances_avg", "serverless_apps_ecs_avg", "serverless_apps_eks_avg", "serverless_apps_excl_fargate_avg", "serverless_apps_excl_fargate_azure_container_app_instances_avg", "serverless_apps_excl_fargate_azure_function_app_instances_avg", "serverless_apps_excl_fargate_azure_web_app_instances_avg", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg", "serverless_apps_excl_fargate_google_cloud_run_instances_avg", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_google_cloud_functions_instances_avg", "serverless_apps_google_cloud_run_instances_avg", "serverless_apps_google_count_avg", "serverless_apps_infra_gcp_gke_autopilot_pods_avg", "serverless_apps_total_count_avg", "siem_analyzed_logs_add_on_count_sum", "synthetics_browser_check_calls_count_sum", "synthetics_check_calls_count_sum", "synthetics_mobile_test_runs_sum", "synthetics_parallel_testing_max_slots_hwm", "trace_search_indexed_events_count_sum", "twol_ingested_events_bytes_sum", "universal_service_monitoring_host_top99p", "vsphere_host_top99p", "vuln_management_host_count_top99p", "workflow_executions_usage_sum"}) } else { return err } @@ -8617,6 +8787,8 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { o.CsmHostEnterpriseGcpHostCountTop99p = all.CsmHostEnterpriseGcpHostCountTop99p o.CsmHostEnterpriseOciHostCountTop99p = all.CsmHostEnterpriseOciHostCountTop99p o.CsmHostEnterpriseTotalHostCountTop99p = all.CsmHostEnterpriseTotalHostCountTop99p + o.CsmHostProHostsAgentlessScannersSum = all.CsmHostProHostsAgentlessScannersSum + o.CsmHostProHostsAgentlessScannersTop99p = all.CsmHostProHostsAgentlessScannersTop99p o.CsmHostProOciHostCountTop99p = all.CsmHostProOciHostCountTop99p o.CspmAasHostTop99p = all.CspmAasHostTop99p o.CspmAwsHostTop99p = all.CspmAwsHostTop99p @@ -8625,6 +8797,8 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { o.CspmContainerHwm = all.CspmContainerHwm o.CspmGcpHostTop99p = all.CspmGcpHostTop99p o.CspmHostTop99p = all.CspmHostTop99p + o.CspmHostsAgentlessScannersSum = all.CspmHostsAgentlessScannersSum + o.CspmHostsAgentlessScannersTop99p = all.CspmHostsAgentlessScannersTop99p o.CustomHistoricalTsAvg = all.CustomHistoricalTsAvg o.CustomLiveTsAvg = all.CustomLiveTsAvg o.CustomTsAvg = all.CustomTsAvg @@ -8634,6 +8808,7 @@ func (o *UsageSummaryDateOrg) UnmarshalJSON(bytes []byte) (err error) { o.DataJobsMonitoringHostHrSum = all.DataJobsMonitoringHostHrSum o.DbmHostTop99pSum = all.DbmHostTop99pSum o.DbmQueriesAvgSum = all.DbmQueriesAvgSum + o.DoJobsMonitoringOrchestratorsJobHoursSum = all.DoJobsMonitoringOrchestratorsJobHoursSum o.EphInfraHostAgentSum = all.EphInfraHostAgentSum o.EphInfraHostAlibabaSum = all.EphInfraHostAlibabaSum o.EphInfraHostAwsSum = all.EphInfraHostAwsSum diff --git a/api/datadogV1/model_usage_summary_response.go b/api/datadogV1/model_usage_summary_response.go index e497a517f45..854599b6e4d 100644 --- a/api/datadogV1/model_usage_summary_response.go +++ b/api/datadogV1/model_usage_summary_response.go @@ -147,6 +147,10 @@ type UsageSummaryResponse struct { CsmHostEnterpriseOciHostCountTop99pSum *int64 `json:"csm_host_enterprise_oci_host_count_top99p_sum,omitempty"` // Shows the 99th percentile of all Cloud Security Management Enterprise hosts over all hours in the current month for all organizations. CsmHostEnterpriseTotalHostCountTop99pSum *int64 `json:"csm_host_enterprise_total_host_count_top99p_sum,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + CsmHostProHostsAgentlessScannersAggSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_agg_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + CsmHostProHostsAgentlessScannersTop99pSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p_sum,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro OCI hosts over all hours in the current month for all organizations. CsmHostProOciHostCountTop99pSum *int64 `json:"csm_host_pro_oci_host_count_top99p_sum,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro Azure app services hosts over all hours in the current month for all organizations. @@ -163,6 +167,10 @@ type UsageSummaryResponse struct { CspmGcpHostTop99pSum *int64 `json:"cspm_gcp_host_top99p_sum,omitempty"` // Shows the 99th percentile of all Cloud Security Management Pro hosts over all hours in the current month for all organizations. CspmHostTop99pSum *int64 `json:"cspm_host_top99p_sum,omitempty"` + // Shows the sum of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + CspmHostsAgentlessScannersAggSum *int64 `json:"cspm_hosts_agentless_scanners_agg_sum,omitempty"` + // Shows the 99th percentile of all Cloud Security Management Pro Agentless scanner hosts over all hours in the current month for all organizations. + CspmHostsAgentlessScannersTop99pSum *int64 `json:"cspm_hosts_agentless_scanners_top99p_sum,omitempty"` // Shows the average number of distinct historical custom metrics over all hours in the current month for all organizations. CustomHistoricalTsSum *int64 `json:"custom_historical_ts_sum,omitempty"` // Shows the average number of distinct live custom metrics over all hours in the current month for all organizations. @@ -181,6 +189,8 @@ type UsageSummaryResponse struct { DbmHostTop99pSum *int64 `json:"dbm_host_top99p_sum,omitempty"` // Shows the average of all distinct Database Monitoring Normalized Queries over all hours in the current month for all organizations. DbmQueriesAvgSum *int64 `json:"dbm_queries_avg_sum,omitempty"` + // Shows the sum of all orchestrator job hours over all hours in the current month for all organizations. + DoJobsMonitoringOrchestratorsJobHoursAggSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_agg_sum,omitempty"` // Shows the last date of usage in the current month for all organizations. EndDate *time.Time `json:"end_date,omitempty"` // Shows the sum of all ephemeral infrastructure hosts with the Datadog Agent over all hours in the current month for all organizations. @@ -2414,6 +2424,62 @@ func (o *UsageSummaryResponse) SetCsmHostEnterpriseTotalHostCountTop99pSum(v int o.CsmHostEnterpriseTotalHostCountTop99pSum = &v } +// GetCsmHostProHostsAgentlessScannersAggSum returns the CsmHostProHostsAgentlessScannersAggSum field value if set, zero value otherwise. +func (o *UsageSummaryResponse) GetCsmHostProHostsAgentlessScannersAggSum() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersAggSum == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersAggSum +} + +// GetCsmHostProHostsAgentlessScannersAggSumOk returns a tuple with the CsmHostProHostsAgentlessScannersAggSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryResponse) GetCsmHostProHostsAgentlessScannersAggSumOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersAggSum == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersAggSum, true +} + +// HasCsmHostProHostsAgentlessScannersAggSum returns a boolean if a field has been set. +func (o *UsageSummaryResponse) HasCsmHostProHostsAgentlessScannersAggSum() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersAggSum != nil +} + +// SetCsmHostProHostsAgentlessScannersAggSum gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersAggSum field. +func (o *UsageSummaryResponse) SetCsmHostProHostsAgentlessScannersAggSum(v int64) { + o.CsmHostProHostsAgentlessScannersAggSum = &v +} + +// GetCsmHostProHostsAgentlessScannersTop99pSum returns the CsmHostProHostsAgentlessScannersTop99pSum field value if set, zero value otherwise. +func (o *UsageSummaryResponse) GetCsmHostProHostsAgentlessScannersTop99pSum() int64 { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99pSum == nil { + var ret int64 + return ret + } + return *o.CsmHostProHostsAgentlessScannersTop99pSum +} + +// GetCsmHostProHostsAgentlessScannersTop99pSumOk returns a tuple with the CsmHostProHostsAgentlessScannersTop99pSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryResponse) GetCsmHostProHostsAgentlessScannersTop99pSumOk() (*int64, bool) { + if o == nil || o.CsmHostProHostsAgentlessScannersTop99pSum == nil { + return nil, false + } + return o.CsmHostProHostsAgentlessScannersTop99pSum, true +} + +// HasCsmHostProHostsAgentlessScannersTop99pSum returns a boolean if a field has been set. +func (o *UsageSummaryResponse) HasCsmHostProHostsAgentlessScannersTop99pSum() bool { + return o != nil && o.CsmHostProHostsAgentlessScannersTop99pSum != nil +} + +// SetCsmHostProHostsAgentlessScannersTop99pSum gets a reference to the given int64 and assigns it to the CsmHostProHostsAgentlessScannersTop99pSum field. +func (o *UsageSummaryResponse) SetCsmHostProHostsAgentlessScannersTop99pSum(v int64) { + o.CsmHostProHostsAgentlessScannersTop99pSum = &v +} + // GetCsmHostProOciHostCountTop99pSum returns the CsmHostProOciHostCountTop99pSum field value if set, zero value otherwise. func (o *UsageSummaryResponse) GetCsmHostProOciHostCountTop99pSum() int64 { if o == nil || o.CsmHostProOciHostCountTop99pSum == nil { @@ -2638,6 +2704,62 @@ func (o *UsageSummaryResponse) SetCspmHostTop99pSum(v int64) { o.CspmHostTop99pSum = &v } +// GetCspmHostsAgentlessScannersAggSum returns the CspmHostsAgentlessScannersAggSum field value if set, zero value otherwise. +func (o *UsageSummaryResponse) GetCspmHostsAgentlessScannersAggSum() int64 { + if o == nil || o.CspmHostsAgentlessScannersAggSum == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersAggSum +} + +// GetCspmHostsAgentlessScannersAggSumOk returns a tuple with the CspmHostsAgentlessScannersAggSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryResponse) GetCspmHostsAgentlessScannersAggSumOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersAggSum == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersAggSum, true +} + +// HasCspmHostsAgentlessScannersAggSum returns a boolean if a field has been set. +func (o *UsageSummaryResponse) HasCspmHostsAgentlessScannersAggSum() bool { + return o != nil && o.CspmHostsAgentlessScannersAggSum != nil +} + +// SetCspmHostsAgentlessScannersAggSum gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersAggSum field. +func (o *UsageSummaryResponse) SetCspmHostsAgentlessScannersAggSum(v int64) { + o.CspmHostsAgentlessScannersAggSum = &v +} + +// GetCspmHostsAgentlessScannersTop99pSum returns the CspmHostsAgentlessScannersTop99pSum field value if set, zero value otherwise. +func (o *UsageSummaryResponse) GetCspmHostsAgentlessScannersTop99pSum() int64 { + if o == nil || o.CspmHostsAgentlessScannersTop99pSum == nil { + var ret int64 + return ret + } + return *o.CspmHostsAgentlessScannersTop99pSum +} + +// GetCspmHostsAgentlessScannersTop99pSumOk returns a tuple with the CspmHostsAgentlessScannersTop99pSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryResponse) GetCspmHostsAgentlessScannersTop99pSumOk() (*int64, bool) { + if o == nil || o.CspmHostsAgentlessScannersTop99pSum == nil { + return nil, false + } + return o.CspmHostsAgentlessScannersTop99pSum, true +} + +// HasCspmHostsAgentlessScannersTop99pSum returns a boolean if a field has been set. +func (o *UsageSummaryResponse) HasCspmHostsAgentlessScannersTop99pSum() bool { + return o != nil && o.CspmHostsAgentlessScannersTop99pSum != nil +} + +// SetCspmHostsAgentlessScannersTop99pSum gets a reference to the given int64 and assigns it to the CspmHostsAgentlessScannersTop99pSum field. +func (o *UsageSummaryResponse) SetCspmHostsAgentlessScannersTop99pSum(v int64) { + o.CspmHostsAgentlessScannersTop99pSum = &v +} + // GetCustomHistoricalTsSum returns the CustomHistoricalTsSum field value if set, zero value otherwise. func (o *UsageSummaryResponse) GetCustomHistoricalTsSum() int64 { if o == nil || o.CustomHistoricalTsSum == nil { @@ -2890,6 +3012,34 @@ func (o *UsageSummaryResponse) SetDbmQueriesAvgSum(v int64) { o.DbmQueriesAvgSum = &v } +// GetDoJobsMonitoringOrchestratorsJobHoursAggSum returns the DoJobsMonitoringOrchestratorsJobHoursAggSum field value if set, zero value otherwise. +func (o *UsageSummaryResponse) GetDoJobsMonitoringOrchestratorsJobHoursAggSum() int64 { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursAggSum == nil { + var ret int64 + return ret + } + return *o.DoJobsMonitoringOrchestratorsJobHoursAggSum +} + +// GetDoJobsMonitoringOrchestratorsJobHoursAggSumOk returns a tuple with the DoJobsMonitoringOrchestratorsJobHoursAggSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageSummaryResponse) GetDoJobsMonitoringOrchestratorsJobHoursAggSumOk() (*int64, bool) { + if o == nil || o.DoJobsMonitoringOrchestratorsJobHoursAggSum == nil { + return nil, false + } + return o.DoJobsMonitoringOrchestratorsJobHoursAggSum, true +} + +// HasDoJobsMonitoringOrchestratorsJobHoursAggSum returns a boolean if a field has been set. +func (o *UsageSummaryResponse) HasDoJobsMonitoringOrchestratorsJobHoursAggSum() bool { + return o != nil && o.DoJobsMonitoringOrchestratorsJobHoursAggSum != nil +} + +// SetDoJobsMonitoringOrchestratorsJobHoursAggSum gets a reference to the given int64 and assigns it to the DoJobsMonitoringOrchestratorsJobHoursAggSum field. +func (o *UsageSummaryResponse) SetDoJobsMonitoringOrchestratorsJobHoursAggSum(v int64) { + o.DoJobsMonitoringOrchestratorsJobHoursAggSum = &v +} + // GetEndDate returns the EndDate field value if set, zero value otherwise. func (o *UsageSummaryResponse) GetEndDate() time.Time { if o == nil || o.EndDate == nil { @@ -7896,6 +8046,12 @@ func (o UsageSummaryResponse) MarshalJSON() ([]byte, error) { if o.CsmHostEnterpriseTotalHostCountTop99pSum != nil { toSerialize["csm_host_enterprise_total_host_count_top99p_sum"] = o.CsmHostEnterpriseTotalHostCountTop99pSum } + if o.CsmHostProHostsAgentlessScannersAggSum != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_agg_sum"] = o.CsmHostProHostsAgentlessScannersAggSum + } + if o.CsmHostProHostsAgentlessScannersTop99pSum != nil { + toSerialize["csm_host_pro_hosts_agentless_scanners_top99p_sum"] = o.CsmHostProHostsAgentlessScannersTop99pSum + } if o.CsmHostProOciHostCountTop99pSum != nil { toSerialize["csm_host_pro_oci_host_count_top99p_sum"] = o.CsmHostProOciHostCountTop99pSum } @@ -7920,6 +8076,12 @@ func (o UsageSummaryResponse) MarshalJSON() ([]byte, error) { if o.CspmHostTop99pSum != nil { toSerialize["cspm_host_top99p_sum"] = o.CspmHostTop99pSum } + if o.CspmHostsAgentlessScannersAggSum != nil { + toSerialize["cspm_hosts_agentless_scanners_agg_sum"] = o.CspmHostsAgentlessScannersAggSum + } + if o.CspmHostsAgentlessScannersTop99pSum != nil { + toSerialize["cspm_hosts_agentless_scanners_top99p_sum"] = o.CspmHostsAgentlessScannersTop99pSum + } if o.CustomHistoricalTsSum != nil { toSerialize["custom_historical_ts_sum"] = o.CustomHistoricalTsSum } @@ -7947,6 +8109,9 @@ func (o UsageSummaryResponse) MarshalJSON() ([]byte, error) { if o.DbmQueriesAvgSum != nil { toSerialize["dbm_queries_avg_sum"] = o.DbmQueriesAvgSum } + if o.DoJobsMonitoringOrchestratorsJobHoursAggSum != nil { + toSerialize["do_jobs_monitoring_orchestrators_job_hours_agg_sum"] = o.DoJobsMonitoringOrchestratorsJobHoursAggSum + } if o.EndDate != nil { if o.EndDate.Nanosecond() == 0 { toSerialize["end_date"] = o.EndDate.Format("2006-01-02T15:04:05Z07:00") @@ -8545,6 +8710,8 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { CsmHostEnterpriseGcpHostCountTop99pSum *int64 `json:"csm_host_enterprise_gcp_host_count_top99p_sum,omitempty"` CsmHostEnterpriseOciHostCountTop99pSum *int64 `json:"csm_host_enterprise_oci_host_count_top99p_sum,omitempty"` CsmHostEnterpriseTotalHostCountTop99pSum *int64 `json:"csm_host_enterprise_total_host_count_top99p_sum,omitempty"` + CsmHostProHostsAgentlessScannersAggSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_agg_sum,omitempty"` + CsmHostProHostsAgentlessScannersTop99pSum *int64 `json:"csm_host_pro_hosts_agentless_scanners_top99p_sum,omitempty"` CsmHostProOciHostCountTop99pSum *int64 `json:"csm_host_pro_oci_host_count_top99p_sum,omitempty"` CspmAasHostTop99pSum *int64 `json:"cspm_aas_host_top99p_sum,omitempty"` CspmAwsHostTop99pSum *int64 `json:"cspm_aws_host_top99p_sum,omitempty"` @@ -8553,6 +8720,8 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { CspmContainerHwmSum *int64 `json:"cspm_container_hwm_sum,omitempty"` CspmGcpHostTop99pSum *int64 `json:"cspm_gcp_host_top99p_sum,omitempty"` CspmHostTop99pSum *int64 `json:"cspm_host_top99p_sum,omitempty"` + CspmHostsAgentlessScannersAggSum *int64 `json:"cspm_hosts_agentless_scanners_agg_sum,omitempty"` + CspmHostsAgentlessScannersTop99pSum *int64 `json:"cspm_hosts_agentless_scanners_top99p_sum,omitempty"` CustomHistoricalTsSum *int64 `json:"custom_historical_ts_sum,omitempty"` CustomLiveTsSum *int64 `json:"custom_live_ts_sum,omitempty"` CustomTsSum *int64 `json:"custom_ts_sum,omitempty"` @@ -8562,6 +8731,7 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { DataJobsMonitoringHostHrAggSum *int64 `json:"data_jobs_monitoring_host_hr_agg_sum,omitempty"` DbmHostTop99pSum *int64 `json:"dbm_host_top99p_sum,omitempty"` DbmQueriesAvgSum *int64 `json:"dbm_queries_avg_sum,omitempty"` + DoJobsMonitoringOrchestratorsJobHoursAggSum *int64 `json:"do_jobs_monitoring_orchestrators_job_hours_agg_sum,omitempty"` EndDate *time.Time `json:"end_date,omitempty"` EphInfraHostAgentAggSum *int64 `json:"eph_infra_host_agent_agg_sum,omitempty"` EphInfraHostAlibabaAggSum *int64 `json:"eph_infra_host_alibaba_agg_sum,omitempty"` @@ -8738,7 +8908,7 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"agent_host_top99p_sum", "apm_azure_app_service_host_top99p_sum", "apm_devsecops_host_top99p_sum", "apm_enterprise_standalone_hosts_top99p_sum", "apm_fargate_count_avg_sum", "apm_host_top99p_sum", "apm_pro_standalone_hosts_top99p_sum", "appsec_fargate_count_avg_sum", "asm_serverless_agg_sum", "audit_logs_lines_indexed_agg_sum", "audit_trail_enabled_hwm_sum", "avg_profiled_fargate_tasks_sum", "aws_host_top99p_sum", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p_sum", "azure_host_top99p_sum", "billable_ingested_bytes_agg_sum", "bits_ai_investigations_agg_sum", "browser_rum_lite_session_count_agg_sum", "browser_rum_replay_session_count_agg_sum", "browser_rum_units_agg_sum", "ccm_anthropic_spend_last_sum", "ccm_aws_spend_last_sum", "ccm_azure_spend_last_sum", "ccm_confluent_spend_last_sum", "ccm_databricks_spend_last_sum", "ccm_elastic_spend_last_sum", "ccm_fastly_spend_last_sum", "ccm_gcp_spend_last_sum", "ccm_github_spend_last_sum", "ccm_mongodb_spend_last_sum", "ccm_oci_spend_last_sum", "ccm_openai_spend_last_sum", "ccm_snowflake_spend_last_sum", "ccm_spend_monitored_ent_last_sum", "ccm_spend_monitored_pro_last_sum", "ccm_twilio_spend_last_sum", "ci_pipeline_indexed_spans_agg_sum", "ci_test_indexed_spans_agg_sum", "ci_visibility_itr_committers_hwm_sum", "ci_visibility_pipeline_committers_hwm_sum", "ci_visibility_test_committers_hwm_sum", "cloud_cost_management_aws_host_count_avg_sum", "cloud_cost_management_azure_host_count_avg_sum", "cloud_cost_management_gcp_host_count_avg_sum", "cloud_cost_management_host_count_avg_sum", "cloud_cost_management_oci_host_count_avg_sum", "cloud_siem_events_agg_sum", "code_analysis_sa_committers_hwm_sum", "code_analysis_sca_committers_hwm_sum", "code_security_host_top99p_sum", "container_avg_sum", "container_excl_agent_avg_sum", "container_hwm_sum", "csm_container_enterprise_compliance_count_agg_sum", "csm_container_enterprise_cws_count_agg_sum", "csm_container_enterprise_total_count_agg_sum", "csm_host_enterprise_aas_host_count_top99p_sum", "csm_host_enterprise_aws_host_count_top99p_sum", "csm_host_enterprise_azure_host_count_top99p_sum", "csm_host_enterprise_compliance_host_count_top99p_sum", "csm_host_enterprise_cws_host_count_top99p_sum", "csm_host_enterprise_gcp_host_count_top99p_sum", "csm_host_enterprise_oci_host_count_top99p_sum", "csm_host_enterprise_total_host_count_top99p_sum", "csm_host_pro_oci_host_count_top99p_sum", "cspm_aas_host_top99p_sum", "cspm_aws_host_top99p_sum", "cspm_azure_host_top99p_sum", "cspm_container_avg_sum", "cspm_container_hwm_sum", "cspm_gcp_host_top99p_sum", "cspm_host_top99p_sum", "custom_historical_ts_sum", "custom_live_ts_sum", "custom_ts_sum", "cws_container_avg_sum", "cws_fargate_task_avg_sum", "cws_host_top99p_sum", "data_jobs_monitoring_host_hr_agg_sum", "dbm_host_top99p_sum", "dbm_queries_avg_sum", "end_date", "eph_infra_host_agent_agg_sum", "eph_infra_host_alibaba_agg_sum", "eph_infra_host_aws_agg_sum", "eph_infra_host_azure_agg_sum", "eph_infra_host_basic_agg_sum", "eph_infra_host_basic_infra_basic_agent_agg_sum", "eph_infra_host_basic_infra_basic_vsphere_agg_sum", "eph_infra_host_ent_agg_sum", "eph_infra_host_gcp_agg_sum", "eph_infra_host_heroku_agg_sum", "eph_infra_host_only_aas_agg_sum", "eph_infra_host_only_vsphere_agg_sum", "eph_infra_host_opentelemetry_agg_sum", "eph_infra_host_opentelemetry_apm_agg_sum", "eph_infra_host_pro_agg_sum", "eph_infra_host_proplus_agg_sum", "eph_infra_host_proxmox_agg_sum", "error_tracking_apm_error_events_agg_sum", "error_tracking_error_events_agg_sum", "error_tracking_events_agg_sum", "error_tracking_rum_error_events_agg_sum", "event_management_correlation_agg_sum", "event_management_correlation_correlated_events_agg_sum", "event_management_correlation_correlated_related_events_agg_sum", "fargate_container_profiler_profiling_fargate_avg_sum", "fargate_container_profiler_profiling_fargate_eks_avg_sum", "fargate_tasks_count_avg_sum", "fargate_tasks_count_hwm_sum", "feature_flags_config_requests_agg_sum", "flex_logs_compute_large_avg_sum", "flex_logs_compute_medium_avg_sum", "flex_logs_compute_small_avg_sum", "flex_logs_compute_xlarge_avg_sum", "flex_logs_compute_xsmall_avg_sum", "flex_logs_starter_avg_sum", "flex_logs_starter_storage_index_avg_sum", "flex_logs_starter_storage_retention_adjustment_avg_sum", "flex_stored_logs_avg_sum", "forwarding_events_bytes_agg_sum", "gcp_host_top99p_sum", "heroku_host_top99p_sum", "incident_management_monthly_active_users_hwm_sum", "incident_management_seats_hwm_sum", "indexed_events_count_agg_sum", "infra_edge_monitoring_devices_top99p_sum", "infra_host_basic_infra_basic_agent_top99p_sum", "infra_host_basic_infra_basic_vsphere_top99p_sum", "infra_host_basic_top99p_sum", "infra_host_top99p_sum", "infra_storage_mgmt_objects_count_avg_sum", "ingested_events_bytes_agg_sum", "iot_device_agg_sum", "iot_device_top99p_sum", "last_updated", "live_indexed_events_agg_sum", "live_ingested_bytes_agg_sum", "llm_observability_agg_sum", "llm_observability_min_spend_agg_sum", "logs_by_retention", "mobile_rum_lite_session_count_agg_sum", "mobile_rum_session_count_agg_sum", "mobile_rum_session_count_android_agg_sum", "mobile_rum_session_count_flutter_agg_sum", "mobile_rum_session_count_ios_agg_sum", "mobile_rum_session_count_reactnative_agg_sum", "mobile_rum_session_count_roku_agg_sum", "mobile_rum_units_agg_sum", "ndm_netflow_events_agg_sum", "netflow_indexed_events_count_agg_sum", "network_device_wireless_top99p_sum", "network_path_agg_sum", "npm_host_top99p_sum", "observability_pipelines_bytes_processed_agg_sum", "oci_host_agg_sum", "oci_host_top99p_sum", "on_call_seat_hwm_sum", "online_archive_events_count_agg_sum", "opentelemetry_apm_host_top99p_sum", "opentelemetry_host_top99p_sum", "product_analytics_agg_sum", "profiling_aas_count_top99p_sum", "profiling_container_agent_count_avg", "profiling_host_count_top99p_sum", "proxmox_host_agg_sum", "proxmox_host_top99p_sum", "published_app_hwm_sum", "rehydrated_indexed_events_agg_sum", "rehydrated_ingested_bytes_agg_sum", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_agg_sum", "rum_browser_lite_session_count_agg_sum", "rum_browser_replay_session_count_agg_sum", "rum_indexed_sessions_agg_sum", "rum_ingested_sessions_agg_sum", "rum_lite_session_count_agg_sum", "rum_mobile_legacy_session_count_android_agg_sum", "rum_mobile_legacy_session_count_flutter_agg_sum", "rum_mobile_legacy_session_count_ios_agg_sum", "rum_mobile_legacy_session_count_reactnative_agg_sum", "rum_mobile_legacy_session_count_roku_agg_sum", "rum_mobile_lite_session_count_android_agg_sum", "rum_mobile_lite_session_count_flutter_agg_sum", "rum_mobile_lite_session_count_ios_agg_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_agg_sum", "rum_mobile_lite_session_count_reactnative_agg_sum", "rum_mobile_lite_session_count_roku_agg_sum", "rum_mobile_lite_session_count_unity_agg_sum", "rum_mobile_replay_session_count_android_agg_sum", "rum_mobile_replay_session_count_ios_agg_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_agg_sum", "rum_mobile_replay_session_count_reactnative_agg_sum", "rum_replay_session_count_agg_sum", "rum_session_count_agg_sum", "rum_session_replay_add_on_agg_sum", "rum_total_session_count_agg_sum", "rum_units_agg_sum", "sca_fargate_count_avg_sum", "sca_fargate_count_hwm_sum", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg_sum", "serverless_apps_apm_apm_azure_azurefunction_instances_avg_sum", "serverless_apps_apm_apm_azure_containerapp_instances_avg_sum", "serverless_apps_apm_apm_fargate_ecs_tasks_avg_sum", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg_sum", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg_sum", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_apm_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_apm_excl_fargate_avg_sum", "serverless_apps_azure_container_app_instances_avg_sum", "serverless_apps_azure_count_avg_sum", "serverless_apps_azure_function_app_instances_avg_sum", "serverless_apps_azure_web_app_instances_avg_sum", "serverless_apps_ecs_avg_sum", "serverless_apps_eks_avg_sum", "serverless_apps_excl_fargate_avg_sum", "serverless_apps_excl_fargate_azure_container_app_instances_avg_sum", "serverless_apps_excl_fargate_azure_function_app_instances_avg_sum", "serverless_apps_excl_fargate_azure_web_app_instances_avg_sum", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg_sum", "serverless_apps_excl_fargate_google_cloud_run_instances_avg_sum", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_google_cloud_functions_instances_avg_sum", "serverless_apps_google_cloud_run_instances_avg_sum", "serverless_apps_google_count_avg_sum", "serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_total_count_avg_sum", "siem_analyzed_logs_add_on_count_agg_sum", "start_date", "synthetics_browser_check_calls_count_agg_sum", "synthetics_check_calls_count_agg_sum", "synthetics_mobile_test_runs_agg_sum", "synthetics_parallel_testing_max_slots_hwm_sum", "trace_search_indexed_events_count_agg_sum", "twol_ingested_events_bytes_agg_sum", "universal_service_monitoring_host_top99p_sum", "usage", "vsphere_host_top99p_sum", "vuln_management_host_count_top99p_sum", "workflow_executions_usage_agg_sum"}) + datadog.DeleteKeys(additionalProperties, &[]string{"agent_host_top99p_sum", "apm_azure_app_service_host_top99p_sum", "apm_devsecops_host_top99p_sum", "apm_enterprise_standalone_hosts_top99p_sum", "apm_fargate_count_avg_sum", "apm_host_top99p_sum", "apm_pro_standalone_hosts_top99p_sum", "appsec_fargate_count_avg_sum", "asm_serverless_agg_sum", "audit_logs_lines_indexed_agg_sum", "audit_trail_enabled_hwm_sum", "avg_profiled_fargate_tasks_sum", "aws_host_top99p_sum", "aws_lambda_func_count", "aws_lambda_invocations_sum", "azure_app_service_top99p_sum", "azure_host_top99p_sum", "billable_ingested_bytes_agg_sum", "bits_ai_investigations_agg_sum", "browser_rum_lite_session_count_agg_sum", "browser_rum_replay_session_count_agg_sum", "browser_rum_units_agg_sum", "ccm_anthropic_spend_last_sum", "ccm_aws_spend_last_sum", "ccm_azure_spend_last_sum", "ccm_confluent_spend_last_sum", "ccm_databricks_spend_last_sum", "ccm_elastic_spend_last_sum", "ccm_fastly_spend_last_sum", "ccm_gcp_spend_last_sum", "ccm_github_spend_last_sum", "ccm_mongodb_spend_last_sum", "ccm_oci_spend_last_sum", "ccm_openai_spend_last_sum", "ccm_snowflake_spend_last_sum", "ccm_spend_monitored_ent_last_sum", "ccm_spend_monitored_pro_last_sum", "ccm_twilio_spend_last_sum", "ci_pipeline_indexed_spans_agg_sum", "ci_test_indexed_spans_agg_sum", "ci_visibility_itr_committers_hwm_sum", "ci_visibility_pipeline_committers_hwm_sum", "ci_visibility_test_committers_hwm_sum", "cloud_cost_management_aws_host_count_avg_sum", "cloud_cost_management_azure_host_count_avg_sum", "cloud_cost_management_gcp_host_count_avg_sum", "cloud_cost_management_host_count_avg_sum", "cloud_cost_management_oci_host_count_avg_sum", "cloud_siem_events_agg_sum", "code_analysis_sa_committers_hwm_sum", "code_analysis_sca_committers_hwm_sum", "code_security_host_top99p_sum", "container_avg_sum", "container_excl_agent_avg_sum", "container_hwm_sum", "csm_container_enterprise_compliance_count_agg_sum", "csm_container_enterprise_cws_count_agg_sum", "csm_container_enterprise_total_count_agg_sum", "csm_host_enterprise_aas_host_count_top99p_sum", "csm_host_enterprise_aws_host_count_top99p_sum", "csm_host_enterprise_azure_host_count_top99p_sum", "csm_host_enterprise_compliance_host_count_top99p_sum", "csm_host_enterprise_cws_host_count_top99p_sum", "csm_host_enterprise_gcp_host_count_top99p_sum", "csm_host_enterprise_oci_host_count_top99p_sum", "csm_host_enterprise_total_host_count_top99p_sum", "csm_host_pro_hosts_agentless_scanners_agg_sum", "csm_host_pro_hosts_agentless_scanners_top99p_sum", "csm_host_pro_oci_host_count_top99p_sum", "cspm_aas_host_top99p_sum", "cspm_aws_host_top99p_sum", "cspm_azure_host_top99p_sum", "cspm_container_avg_sum", "cspm_container_hwm_sum", "cspm_gcp_host_top99p_sum", "cspm_host_top99p_sum", "cspm_hosts_agentless_scanners_agg_sum", "cspm_hosts_agentless_scanners_top99p_sum", "custom_historical_ts_sum", "custom_live_ts_sum", "custom_ts_sum", "cws_container_avg_sum", "cws_fargate_task_avg_sum", "cws_host_top99p_sum", "data_jobs_monitoring_host_hr_agg_sum", "dbm_host_top99p_sum", "dbm_queries_avg_sum", "do_jobs_monitoring_orchestrators_job_hours_agg_sum", "end_date", "eph_infra_host_agent_agg_sum", "eph_infra_host_alibaba_agg_sum", "eph_infra_host_aws_agg_sum", "eph_infra_host_azure_agg_sum", "eph_infra_host_basic_agg_sum", "eph_infra_host_basic_infra_basic_agent_agg_sum", "eph_infra_host_basic_infra_basic_vsphere_agg_sum", "eph_infra_host_ent_agg_sum", "eph_infra_host_gcp_agg_sum", "eph_infra_host_heroku_agg_sum", "eph_infra_host_only_aas_agg_sum", "eph_infra_host_only_vsphere_agg_sum", "eph_infra_host_opentelemetry_agg_sum", "eph_infra_host_opentelemetry_apm_agg_sum", "eph_infra_host_pro_agg_sum", "eph_infra_host_proplus_agg_sum", "eph_infra_host_proxmox_agg_sum", "error_tracking_apm_error_events_agg_sum", "error_tracking_error_events_agg_sum", "error_tracking_events_agg_sum", "error_tracking_rum_error_events_agg_sum", "event_management_correlation_agg_sum", "event_management_correlation_correlated_events_agg_sum", "event_management_correlation_correlated_related_events_agg_sum", "fargate_container_profiler_profiling_fargate_avg_sum", "fargate_container_profiler_profiling_fargate_eks_avg_sum", "fargate_tasks_count_avg_sum", "fargate_tasks_count_hwm_sum", "feature_flags_config_requests_agg_sum", "flex_logs_compute_large_avg_sum", "flex_logs_compute_medium_avg_sum", "flex_logs_compute_small_avg_sum", "flex_logs_compute_xlarge_avg_sum", "flex_logs_compute_xsmall_avg_sum", "flex_logs_starter_avg_sum", "flex_logs_starter_storage_index_avg_sum", "flex_logs_starter_storage_retention_adjustment_avg_sum", "flex_stored_logs_avg_sum", "forwarding_events_bytes_agg_sum", "gcp_host_top99p_sum", "heroku_host_top99p_sum", "incident_management_monthly_active_users_hwm_sum", "incident_management_seats_hwm_sum", "indexed_events_count_agg_sum", "infra_edge_monitoring_devices_top99p_sum", "infra_host_basic_infra_basic_agent_top99p_sum", "infra_host_basic_infra_basic_vsphere_top99p_sum", "infra_host_basic_top99p_sum", "infra_host_top99p_sum", "infra_storage_mgmt_objects_count_avg_sum", "ingested_events_bytes_agg_sum", "iot_device_agg_sum", "iot_device_top99p_sum", "last_updated", "live_indexed_events_agg_sum", "live_ingested_bytes_agg_sum", "llm_observability_agg_sum", "llm_observability_min_spend_agg_sum", "logs_by_retention", "mobile_rum_lite_session_count_agg_sum", "mobile_rum_session_count_agg_sum", "mobile_rum_session_count_android_agg_sum", "mobile_rum_session_count_flutter_agg_sum", "mobile_rum_session_count_ios_agg_sum", "mobile_rum_session_count_reactnative_agg_sum", "mobile_rum_session_count_roku_agg_sum", "mobile_rum_units_agg_sum", "ndm_netflow_events_agg_sum", "netflow_indexed_events_count_agg_sum", "network_device_wireless_top99p_sum", "network_path_agg_sum", "npm_host_top99p_sum", "observability_pipelines_bytes_processed_agg_sum", "oci_host_agg_sum", "oci_host_top99p_sum", "on_call_seat_hwm_sum", "online_archive_events_count_agg_sum", "opentelemetry_apm_host_top99p_sum", "opentelemetry_host_top99p_sum", "product_analytics_agg_sum", "profiling_aas_count_top99p_sum", "profiling_container_agent_count_avg", "profiling_host_count_top99p_sum", "proxmox_host_agg_sum", "proxmox_host_top99p_sum", "published_app_hwm_sum", "rehydrated_indexed_events_agg_sum", "rehydrated_ingested_bytes_agg_sum", "rum_browser_and_mobile_session_count", "rum_browser_legacy_session_count_agg_sum", "rum_browser_lite_session_count_agg_sum", "rum_browser_replay_session_count_agg_sum", "rum_indexed_sessions_agg_sum", "rum_ingested_sessions_agg_sum", "rum_lite_session_count_agg_sum", "rum_mobile_legacy_session_count_android_agg_sum", "rum_mobile_legacy_session_count_flutter_agg_sum", "rum_mobile_legacy_session_count_ios_agg_sum", "rum_mobile_legacy_session_count_reactnative_agg_sum", "rum_mobile_legacy_session_count_roku_agg_sum", "rum_mobile_lite_session_count_android_agg_sum", "rum_mobile_lite_session_count_flutter_agg_sum", "rum_mobile_lite_session_count_ios_agg_sum", "rum_mobile_lite_session_count_kotlinmultiplatform_agg_sum", "rum_mobile_lite_session_count_reactnative_agg_sum", "rum_mobile_lite_session_count_roku_agg_sum", "rum_mobile_lite_session_count_unity_agg_sum", "rum_mobile_replay_session_count_android_agg_sum", "rum_mobile_replay_session_count_ios_agg_sum", "rum_mobile_replay_session_count_kotlinmultiplatform_agg_sum", "rum_mobile_replay_session_count_reactnative_agg_sum", "rum_replay_session_count_agg_sum", "rum_session_count_agg_sum", "rum_session_replay_add_on_agg_sum", "rum_total_session_count_agg_sum", "rum_units_agg_sum", "sca_fargate_count_avg_sum", "sca_fargate_count_hwm_sum", "sds_apm_scanned_bytes_sum", "sds_events_scanned_bytes_sum", "sds_logs_scanned_bytes_sum", "sds_rum_scanned_bytes_sum", "sds_total_scanned_bytes_sum", "serverless_apps_apm_apm_azure_appservice_instances_avg_sum", "serverless_apps_apm_apm_azure_azurefunction_instances_avg_sum", "serverless_apps_apm_apm_azure_containerapp_instances_avg_sum", "serverless_apps_apm_apm_fargate_ecs_tasks_avg_sum", "serverless_apps_apm_apm_gcp_cloudfunction_instances_avg_sum", "serverless_apps_apm_apm_gcp_cloudrun_instances_avg_sum", "serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_apm_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg_sum", "serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_apm_excl_fargate_avg_sum", "serverless_apps_azure_container_app_instances_avg_sum", "serverless_apps_azure_count_avg_sum", "serverless_apps_azure_function_app_instances_avg_sum", "serverless_apps_azure_web_app_instances_avg_sum", "serverless_apps_ecs_avg_sum", "serverless_apps_eks_avg_sum", "serverless_apps_excl_fargate_avg_sum", "serverless_apps_excl_fargate_azure_container_app_instances_avg_sum", "serverless_apps_excl_fargate_azure_function_app_instances_avg_sum", "serverless_apps_excl_fargate_azure_web_app_instances_avg_sum", "serverless_apps_excl_fargate_google_cloud_functions_instances_avg_sum", "serverless_apps_excl_fargate_google_cloud_run_instances_avg_sum", "serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_google_cloud_functions_instances_avg_sum", "serverless_apps_google_cloud_run_instances_avg_sum", "serverless_apps_google_count_avg_sum", "serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum", "serverless_apps_total_count_avg_sum", "siem_analyzed_logs_add_on_count_agg_sum", "start_date", "synthetics_browser_check_calls_count_agg_sum", "synthetics_check_calls_count_agg_sum", "synthetics_mobile_test_runs_agg_sum", "synthetics_parallel_testing_max_slots_hwm_sum", "trace_search_indexed_events_count_agg_sum", "twol_ingested_events_bytes_agg_sum", "universal_service_monitoring_host_top99p_sum", "usage", "vsphere_host_top99p_sum", "vuln_management_host_count_top99p_sum", "workflow_executions_usage_agg_sum"}) } else { return err } @@ -8810,6 +8980,8 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { o.CsmHostEnterpriseGcpHostCountTop99pSum = all.CsmHostEnterpriseGcpHostCountTop99pSum o.CsmHostEnterpriseOciHostCountTop99pSum = all.CsmHostEnterpriseOciHostCountTop99pSum o.CsmHostEnterpriseTotalHostCountTop99pSum = all.CsmHostEnterpriseTotalHostCountTop99pSum + o.CsmHostProHostsAgentlessScannersAggSum = all.CsmHostProHostsAgentlessScannersAggSum + o.CsmHostProHostsAgentlessScannersTop99pSum = all.CsmHostProHostsAgentlessScannersTop99pSum o.CsmHostProOciHostCountTop99pSum = all.CsmHostProOciHostCountTop99pSum o.CspmAasHostTop99pSum = all.CspmAasHostTop99pSum o.CspmAwsHostTop99pSum = all.CspmAwsHostTop99pSum @@ -8818,6 +8990,8 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { o.CspmContainerHwmSum = all.CspmContainerHwmSum o.CspmGcpHostTop99pSum = all.CspmGcpHostTop99pSum o.CspmHostTop99pSum = all.CspmHostTop99pSum + o.CspmHostsAgentlessScannersAggSum = all.CspmHostsAgentlessScannersAggSum + o.CspmHostsAgentlessScannersTop99pSum = all.CspmHostsAgentlessScannersTop99pSum o.CustomHistoricalTsSum = all.CustomHistoricalTsSum o.CustomLiveTsSum = all.CustomLiveTsSum o.CustomTsSum = all.CustomTsSum @@ -8827,6 +9001,7 @@ func (o *UsageSummaryResponse) UnmarshalJSON(bytes []byte) (err error) { o.DataJobsMonitoringHostHrAggSum = all.DataJobsMonitoringHostHrAggSum o.DbmHostTop99pSum = all.DbmHostTop99pSum o.DbmQueriesAvgSum = all.DbmQueriesAvgSum + o.DoJobsMonitoringOrchestratorsJobHoursAggSum = all.DoJobsMonitoringOrchestratorsJobHoursAggSum o.EndDate = all.EndDate o.EphInfraHostAgentAggSum = all.EphInfraHostAgentAggSum o.EphInfraHostAlibabaAggSum = all.EphInfraHostAlibabaAggSum diff --git a/api/datadogV2/api_app_builder.go b/api/datadogV2/api_app_builder.go index 3dfe084276e..5219c9c02a3 100644 --- a/api/datadogV2/api_app_builder.go +++ b/api/datadogV2/api_app_builder.go @@ -105,28 +105,31 @@ func (a *AppBuilderApi) CreateApp(ctx _context.Context, body CreateAppRequest) ( return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteApp Delete App. -// Delete a single app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (DeleteAppResponse, *_nethttp.Response, error) { +// CreatePublishRequest Create Publish Request. +// Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. +func (a *AppBuilderApi) CreatePublishRequest(ctx _context.Context, appId uuid.UUID, body CreatePublishRequestRequest) (PublishAppResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue DeleteAppResponse + localVarReturnValue PublishAppResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.CreatePublishRequest") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/publish-request" localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -160,7 +163,7 @@ func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (Delete ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -192,30 +195,28 @@ func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (Delete return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteApps Delete Multiple Apps. -// Delete multiple apps in a single request from a list of app IDs. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { +// DeleteApp Delete App. +// Delete a single app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (DeleteAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarReturnValue DeleteAppsResponse + localVarReturnValue DeleteAppResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApps") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps" + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -249,7 +250,7 @@ func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -281,56 +282,30 @@ func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) return localVarReturnValue, localVarHTTPResponse, nil } -// GetAppOptionalParameters holds optional parameters for GetApp. -type GetAppOptionalParameters struct { - Version *string -} - -// NewGetAppOptionalParameters creates an empty struct for parameters. -func NewGetAppOptionalParameters() *GetAppOptionalParameters { - this := GetAppOptionalParameters{} - return &this -} - -// WithVersion sets the corresponding parameter name and returns the struct. -func (r *GetAppOptionalParameters) WithVersion(version string) *GetAppOptionalParameters { - r.Version = &version - return r -} - -// GetApp Get App. -// Get the full definition of an app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { +// DeleteApps Delete Multiple Apps. +// Delete multiple apps in a single request from a list of app IDs. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarReturnValue GetAppResponse - optionalParams GetAppOptionalParameters + localVarReturnValue DeleteAppsResponse ) - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetAppOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApps") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + localVarPath := localBasePath + "/api/v2/app-builder/apps" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.Version != nil { - localVarQueryParams.Add("version", datadog.ParameterToString(*optionalParams.Version, "")) - } + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -364,7 +339,7 @@ func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAp ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -396,152 +371,53 @@ func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAp return localVarReturnValue, localVarHTTPResponse, nil } -// ListAppsOptionalParameters holds optional parameters for ListApps. -type ListAppsOptionalParameters struct { - Limit *int64 - Page *int64 - FilterUserName *string - FilterUserUuid *uuid.UUID - FilterName *string - FilterQuery *string - FilterDeployed *bool - FilterTags *string - FilterFavorite *bool - FilterSelfService *bool - Sort *[]AppsSortField +// GetAppOptionalParameters holds optional parameters for GetApp. +type GetAppOptionalParameters struct { + Version *string } -// NewListAppsOptionalParameters creates an empty struct for parameters. -func NewListAppsOptionalParameters() *ListAppsOptionalParameters { - this := ListAppsOptionalParameters{} +// NewGetAppOptionalParameters creates an empty struct for parameters. +func NewGetAppOptionalParameters() *GetAppOptionalParameters { + this := GetAppOptionalParameters{} return &this } -// WithLimit sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithLimit(limit int64) *ListAppsOptionalParameters { - r.Limit = &limit - return r -} - -// WithPage sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithPage(page int64) *ListAppsOptionalParameters { - r.Page = &page - return r -} - -// WithFilterUserName sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterUserName(filterUserName string) *ListAppsOptionalParameters { - r.FilterUserName = &filterUserName - return r -} - -// WithFilterUserUuid sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterUserUuid(filterUserUuid uuid.UUID) *ListAppsOptionalParameters { - r.FilterUserUuid = &filterUserUuid - return r -} - -// WithFilterName sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterName(filterName string) *ListAppsOptionalParameters { - r.FilterName = &filterName - return r -} - -// WithFilterQuery sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterQuery(filterQuery string) *ListAppsOptionalParameters { - r.FilterQuery = &filterQuery - return r -} - -// WithFilterDeployed sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterDeployed(filterDeployed bool) *ListAppsOptionalParameters { - r.FilterDeployed = &filterDeployed - return r -} - -// WithFilterTags sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterTags(filterTags string) *ListAppsOptionalParameters { - r.FilterTags = &filterTags - return r -} - -// WithFilterFavorite sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterFavorite(filterFavorite bool) *ListAppsOptionalParameters { - r.FilterFavorite = &filterFavorite - return r -} - -// WithFilterSelfService sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithFilterSelfService(filterSelfService bool) *ListAppsOptionalParameters { - r.FilterSelfService = &filterSelfService - return r -} - -// WithSort sets the corresponding parameter name and returns the struct. -func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOptionalParameters { - r.Sort = &sort +// WithVersion sets the corresponding parameter name and returns the struct. +func (r *GetAppOptionalParameters) WithVersion(version string) *GetAppOptionalParameters { + r.Version = &version return r } -// ListApps List Apps. -// List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { +// GetApp Get App. +// Get the full definition of an app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue ListAppsResponse - optionalParams ListAppsOptionalParameters + localVarReturnValue GetAppResponse + optionalParams GetAppOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListAppsOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetAppOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListApps") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps" + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.Limit != nil { - localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) - } - if optionalParams.Page != nil { - localVarQueryParams.Add("page", datadog.ParameterToString(*optionalParams.Page, "")) - } - if optionalParams.FilterUserName != nil { - localVarQueryParams.Add("filter[user_name]", datadog.ParameterToString(*optionalParams.FilterUserName, "")) - } - if optionalParams.FilterUserUuid != nil { - localVarQueryParams.Add("filter[user_uuid]", datadog.ParameterToString(*optionalParams.FilterUserUuid, "")) - } - if optionalParams.FilterName != nil { - localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, "")) - } - if optionalParams.FilterQuery != nil { - localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) - } - if optionalParams.FilterDeployed != nil { - localVarQueryParams.Add("filter[deployed]", datadog.ParameterToString(*optionalParams.FilterDeployed, "")) - } - if optionalParams.FilterTags != nil { - localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, "")) - } - if optionalParams.FilterFavorite != nil { - localVarQueryParams.Add("filter[favorite]", datadog.ParameterToString(*optionalParams.FilterFavorite, "")) - } - if optionalParams.FilterSelfService != nil { - localVarQueryParams.Add("filter[self_service]", datadog.ParameterToString(*optionalParams.FilterSelfService, "")) - } - if optionalParams.Sort != nil { - localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "csv")) + if optionalParams.Version != nil { + localVarQueryParams.Add("version", datadog.ParameterToString(*optionalParams.Version, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -578,7 +454,7 @@ func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalPara ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -610,22 +486,22 @@ func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalPara return localVarReturnValue, localVarHTTPResponse, nil } -// PublishApp Publish App. -// Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) on the app if a policy does not yet exist. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (PublishAppResponse, *_nethttp.Response, error) { +// GetBlueprint Get Blueprint. +// Retrieve an app blueprint by its ID. +func (a *AppBuilderApi) GetBlueprint(ctx _context.Context, blueprintId uuid.UUID) (GetBlueprintResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue PublishAppResponse + localVarReturnValue GetBlueprintResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.PublishApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetBlueprint") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + localVarPath := localBasePath + "/api/v2/app-builder/blueprint/{blueprint_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{blueprint_id}", _neturl.PathEscape(datadog.ParameterToString(blueprintId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -665,7 +541,7 @@ func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (Publi ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -697,22 +573,22 @@ func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (Publi return localVarReturnValue, localVarHTTPResponse, nil } -// UnpublishApp Unpublish App. -// Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (UnpublishAppResponse, *_nethttp.Response, error) { +// GetBlueprintsByIntegrationId Get Blueprints by Integration ID. +// List app blueprints associated with a specific integration ID. +func (a *AppBuilderApi) GetBlueprintsByIntegrationId(ctx _context.Context, integrationId string) (GetBlueprintsResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue UnpublishAppResponse + localVarReturnValue GetBlueprintsResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UnpublishApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetBlueprintsByIntegrationId") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + localVarPath := localBasePath + "/api/v2/app-builder/blueprints/integration-id/{integration_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_id}", _neturl.PathEscape(datadog.ParameterToString(integrationId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -752,7 +628,7 @@ func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (Unp ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 403 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -784,31 +660,28 @@ func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (Unp return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateApp Update App. -// Update an existing app. This creates a new version of the app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). -func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { +// GetBlueprintsBySlugs Get Blueprints by Slugs. +// Retrieve app blueprints by their slugs. +func (a *AppBuilderApi) GetBlueprintsBySlugs(ctx _context.Context, slugs string) (GetBlueprintsResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue UpdateAppResponse + localVarReturnValue GetBlueprintsResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetBlueprintsBySlugs") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + localVarPath := localBasePath + "/api/v2/app-builder/blueprints/slugs/{slugs}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{slugs}", _neturl.PathEscape(datadog.ParameterToString(slugs, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -842,7 +715,1319 @@ func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body Up ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListAppVersionsOptionalParameters holds optional parameters for ListAppVersions. +type ListAppVersionsOptionalParameters struct { + Limit *int64 + Page *int64 +} + +// NewListAppVersionsOptionalParameters creates an empty struct for parameters. +func NewListAppVersionsOptionalParameters() *ListAppVersionsOptionalParameters { + this := ListAppVersionsOptionalParameters{} + return &this +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *ListAppVersionsOptionalParameters) WithLimit(limit int64) *ListAppVersionsOptionalParameters { + r.Limit = &limit + return r +} + +// WithPage sets the corresponding parameter name and returns the struct. +func (r *ListAppVersionsOptionalParameters) WithPage(page int64) *ListAppVersionsOptionalParameters { + r.Page = &page + return r +} + +// ListAppVersions List App Versions. +// List the versions of an app. This endpoint is paginated. +func (a *AppBuilderApi) ListAppVersions(ctx _context.Context, appId uuid.UUID, o ...ListAppVersionsOptionalParameters) (ListAppVersionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListAppVersionsResponse + optionalParams ListAppVersionsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListAppVersionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListAppVersions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/versions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.Page != nil { + localVarQueryParams.Add("page", datadog.ParameterToString(*optionalParams.Page, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListAppsOptionalParameters holds optional parameters for ListApps. +type ListAppsOptionalParameters struct { + Limit *int64 + Page *int64 + FilterUserName *string + FilterUserUuid *uuid.UUID + FilterName *string + FilterQuery *string + FilterDeployed *bool + FilterTags *string + FilterFavorite *bool + FilterSelfService *bool + Sort *[]AppsSortField +} + +// NewListAppsOptionalParameters creates an empty struct for parameters. +func NewListAppsOptionalParameters() *ListAppsOptionalParameters { + this := ListAppsOptionalParameters{} + return &this +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithLimit(limit int64) *ListAppsOptionalParameters { + r.Limit = &limit + return r +} + +// WithPage sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithPage(page int64) *ListAppsOptionalParameters { + r.Page = &page + return r +} + +// WithFilterUserName sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterUserName(filterUserName string) *ListAppsOptionalParameters { + r.FilterUserName = &filterUserName + return r +} + +// WithFilterUserUuid sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterUserUuid(filterUserUuid uuid.UUID) *ListAppsOptionalParameters { + r.FilterUserUuid = &filterUserUuid + return r +} + +// WithFilterName sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterName(filterName string) *ListAppsOptionalParameters { + r.FilterName = &filterName + return r +} + +// WithFilterQuery sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterQuery(filterQuery string) *ListAppsOptionalParameters { + r.FilterQuery = &filterQuery + return r +} + +// WithFilterDeployed sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterDeployed(filterDeployed bool) *ListAppsOptionalParameters { + r.FilterDeployed = &filterDeployed + return r +} + +// WithFilterTags sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterTags(filterTags string) *ListAppsOptionalParameters { + r.FilterTags = &filterTags + return r +} + +// WithFilterFavorite sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterFavorite(filterFavorite bool) *ListAppsOptionalParameters { + r.FilterFavorite = &filterFavorite + return r +} + +// WithFilterSelfService sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterSelfService(filterSelfService bool) *ListAppsOptionalParameters { + r.FilterSelfService = &filterSelfService + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOptionalParameters { + r.Sort = &sort + return r +} + +// ListApps List Apps. +// List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListAppsResponse + optionalParams ListAppsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListAppsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListApps") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.Page != nil { + localVarQueryParams.Add("page", datadog.ParameterToString(*optionalParams.Page, "")) + } + if optionalParams.FilterUserName != nil { + localVarQueryParams.Add("filter[user_name]", datadog.ParameterToString(*optionalParams.FilterUserName, "")) + } + if optionalParams.FilterUserUuid != nil { + localVarQueryParams.Add("filter[user_uuid]", datadog.ParameterToString(*optionalParams.FilterUserUuid, "")) + } + if optionalParams.FilterName != nil { + localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, "")) + } + if optionalParams.FilterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) + } + if optionalParams.FilterDeployed != nil { + localVarQueryParams.Add("filter[deployed]", datadog.ParameterToString(*optionalParams.FilterDeployed, "")) + } + if optionalParams.FilterTags != nil { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, "")) + } + if optionalParams.FilterFavorite != nil { + localVarQueryParams.Add("filter[favorite]", datadog.ParameterToString(*optionalParams.FilterFavorite, "")) + } + if optionalParams.FilterSelfService != nil { + localVarQueryParams.Add("filter[self_service]", datadog.ParameterToString(*optionalParams.FilterSelfService, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "csv")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListBlueprintsOptionalParameters holds optional parameters for ListBlueprints. +type ListBlueprintsOptionalParameters struct { + Limit *int64 + Page *int64 +} + +// NewListBlueprintsOptionalParameters creates an empty struct for parameters. +func NewListBlueprintsOptionalParameters() *ListBlueprintsOptionalParameters { + this := ListBlueprintsOptionalParameters{} + return &this +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *ListBlueprintsOptionalParameters) WithLimit(limit int64) *ListBlueprintsOptionalParameters { + r.Limit = &limit + return r +} + +// WithPage sets the corresponding parameter name and returns the struct. +func (r *ListBlueprintsOptionalParameters) WithPage(page int64) *ListBlueprintsOptionalParameters { + r.Page = &page + return r +} + +// ListBlueprints List Blueprints. +// List available app blueprints. +func (a *AppBuilderApi) ListBlueprints(ctx _context.Context, o ...ListBlueprintsOptionalParameters) (ListBlueprintsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListBlueprintsResponse + optionalParams ListBlueprintsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListBlueprintsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListBlueprints") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/blueprints" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.Page != nil { + localVarQueryParams.Add("page", datadog.ParameterToString(*optionalParams.Page, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListTags List Tags. +// List all tags associated with the authenticated user's apps. +func (a *AppBuilderApi) ListTags(ctx _context.Context) (AppBuilderListTagsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AppBuilderListTagsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListTags") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/tags" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// PublishApp Publish App. +// Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) on the app if a policy does not yet exist. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (PublishAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue PublishAppResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.PublishApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// RevertApp Revert App. +// Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. +func (a *AppBuilderApi) RevertApp(ctx _context.Context, appId uuid.UUID, version string) (UpdateAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue UpdateAppResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.RevertApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/revert" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("version", datadog.ParameterToString(version, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UnpublishApp Unpublish App. +// Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (UnpublishAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue UnpublishAppResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UnpublishApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateApp Update App. +// Update an existing app. This creates a new version of the app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). +func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue UpdateAppResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateAppFavorite Update App Favorite Status. +// Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. +func (a *AppBuilderApi) UpdateAppFavorite(ctx _context.Context, appId uuid.UUID, body UpdateAppFavoriteRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateAppFavorite") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/favorite" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateAppSelfService Update App Self-Service Status. +// Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. +func (a *AppBuilderApi) UpdateAppSelfService(ctx _context.Context, appId uuid.UUID, body UpdateAppSelfServiceRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateAppSelfService") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/self-service" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateAppTags Update App Tags. +// Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. +func (a *AppBuilderApi) UpdateAppTags(ctx _context.Context, appId uuid.UUID, body UpdateAppTagsRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateAppTags") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/tags" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateAppVersionName Name App Version. +// Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. +func (a *AppBuilderApi) UpdateAppVersionName(ctx _context.Context, appId uuid.UUID, version string, body UpdateAppVersionNameRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateAppVersionName") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/version-name" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("version", datadog.ParameterToString(version, "")) + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateProtectionLevel Update App Protection Level. +// Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. +func (a *AppBuilderApi) UpdateProtectionLevel(ctx _context.Context, appId uuid.UUID, body UpdateAppProtectionLevelRequest) (UpdateAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue UpdateAppResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateProtectionLevel") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/protection-level" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { diff --git a/api/datadogV2/api_case_management.go b/api/datadogV2/api_case_management.go index 82f86504291..3288bc93656 100644 --- a/api/datadogV2/api_case_management.go +++ b/api/datadogV2/api_case_management.go @@ -17,21 +17,30 @@ import ( // CaseManagementApi service type type CaseManagementApi datadog.Service -// ArchiveCase Archive case. -// Archive case -func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +// AddCaseInsights Add insights to a case. +// Adds one or more insights to a case. Insights are references to related Datadog resources (such as monitors, security signals, incidents, or error tracking issues) that provide investigative context. Up to 100 insights can be added per request. Each insight requires a type (see `CaseInsightType` for allowed values), a ref (URL path to the resource), and a resource_id. +func (a *CaseManagementApi) AddCaseInsights(ctx _context.Context, caseId string, body CaseInsightsRequest) (CaseResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ArchiveCase") + operationId := "v2.AddCaseInsights" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.AddCaseInsights") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/archive" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/insights" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) @@ -75,7 +84,16 @@ func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, bod ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -98,22 +116,30 @@ func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, bod return localVarReturnValue, localVarHTTPResponse, nil } -// AssignCase Assign case. -// Assign case to a user -func (a *CaseManagementApi) AssignCase(ctx _context.Context, caseId string, body CaseAssignRequest) (CaseResponse, *_nethttp.Response, error) { +// AggregateCases Aggregate cases. +// Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics. +func (a *CaseManagementApi) AggregateCases(ctx _context.Context, body CaseAggregateRequest) (CaseAggregateResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarReturnValue CaseAggregateResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.AssignCase") + operationId := "v2.AggregateCases" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.AggregateCases") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/assign" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/aggregate" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -179,21 +205,21 @@ func (a *CaseManagementApi) AssignCase(ctx _context.Context, caseId string, body return localVarReturnValue, localVarHTTPResponse, nil } -// CommentCase Comment case. -// Comment case -func (a *CaseManagementApi) CommentCase(ctx _context.Context, caseId string, body CaseCommentRequest) (TimelineResponse, *_nethttp.Response, error) { +// ArchiveCase Archive case. +// Archive case +func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue TimelineResponse + localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CommentCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ArchiveCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/comment" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/archive" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) @@ -260,21 +286,22 @@ func (a *CaseManagementApi) CommentCase(ctx _context.Context, caseId string, bod return localVarReturnValue, localVarHTTPResponse, nil } -// CreateCase Create a case. -// Create a Case -func (a *CaseManagementApi) CreateCase(ctx _context.Context, body CaseCreateRequest) (CaseResponse, *_nethttp.Response, error) { +// AssignCase Assign case. +// Assign case to a user +func (a *CaseManagementApi) AssignCase(ctx _context.Context, caseId string, body CaseAssignRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.AssignCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/assign" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -340,15 +367,15 @@ func (a *CaseManagementApi) CreateCase(ctx _context.Context, body CaseCreateRequ return localVarReturnValue, localVarHTTPResponse, nil } -// CreateCaseJiraIssue Create Jira issue for case. -// Create a new Jira issue and link it to a case -func (a *CaseManagementApi) CreateCaseJiraIssue(ctx _context.Context, caseId string, body JiraIssueCreateRequest) (*_nethttp.Response, error) { +// BulkUpdateCases Bulk update cases. +// Applies a single action (such as changing priority, status, assignment, or archiving) to multiple cases at once. The list of case IDs and the action type with its payload are specified in the request body. +func (a *CaseManagementApi) BulkUpdateCases(ctx _context.Context, body CaseBulkUpdateRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - operationId := "v2.CreateCaseJiraIssue" + operationId := "v2.BulkUpdateCases" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -357,13 +384,12 @@ func (a *CaseManagementApi) CreateCaseJiraIssue(ctx _context.Context, caseId str _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseJiraIssue") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.BulkUpdateCases") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/jira_issues" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/bulk" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -406,16 +432,7 @@ func (a *CaseManagementApi) CreateCaseJiraIssue(ctx _context.Context, caseId str ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -429,43 +446,35 @@ func (a *CaseManagementApi) CreateCaseJiraIssue(ctx _context.Context, caseId str return localVarHTTPResponse, nil } -// CreateCaseNotebook Create investigation notebook for case. -// Create a new investigation notebook and link it to a case -func (a *CaseManagementApi) CreateCaseNotebook(ctx _context.Context, caseId string, body NotebookCreateRequest) (*_nethttp.Response, error) { +// CommentCase Comment case. +// Comment case +func (a *CaseManagementApi) CommentCase(ctx _context.Context, caseId string, body CaseCommentRequest) (TimelineResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue TimelineResponse ) - operationId := "v2.CreateCaseNotebook" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseNotebook") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CommentCase") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/notebook" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/comment" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "application/json" // body params localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -477,17 +486,17 @@ func (a *CaseManagementApi) CreateCaseNotebook(ctx _context.Context, caseId stri } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -495,66 +504,111 @@ func (a *CaseManagementApi) CreateCaseNotebook(ctx _context.Context, caseId stri ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -// CreateCaseServiceNowTicket Create ServiceNow ticket for case. -// Create a new ServiceNow incident ticket and link it to a case -func (a *CaseManagementApi) CreateCaseServiceNowTicket(ctx _context.Context, caseId string, body ServiceNowTicketCreateRequest) (*_nethttp.Response, error) { +// CountCasesOptionalParameters holds optional parameters for CountCases. +type CountCasesOptionalParameters struct { + QueryFilter *string + GroupBys *string + Limit *int32 +} + +// NewCountCasesOptionalParameters creates an empty struct for parameters. +func NewCountCasesOptionalParameters() *CountCasesOptionalParameters { + this := CountCasesOptionalParameters{} + return &this +} + +// WithQueryFilter sets the corresponding parameter name and returns the struct. +func (r *CountCasesOptionalParameters) WithQueryFilter(queryFilter string) *CountCasesOptionalParameters { + r.QueryFilter = &queryFilter + return r +} + +// WithGroupBys sets the corresponding parameter name and returns the struct. +func (r *CountCasesOptionalParameters) WithGroupBys(groupBys string) *CountCasesOptionalParameters { + r.GroupBys = &groupBys + return r +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *CountCasesOptionalParameters) WithLimit(limit int32) *CountCasesOptionalParameters { + r.Limit = &limit + return r +} + +// CountCases Count cases. +// Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope. +func (a *CaseManagementApi) CountCases(ctx _context.Context, o ...CountCasesOptionalParameters) (CaseCountResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseCountResponse + optionalParams CountCasesOptionalParameters ) - operationId := "v2.CreateCaseServiceNowTicket" + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type CountCasesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.CountCases" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseServiceNowTicket") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CountCases") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/count" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + if optionalParams.QueryFilter != nil { + localVarQueryParams.Add("query_filter", datadog.ParameterToString(*optionalParams.QueryFilter, "")) + } + if optionalParams.GroupBys != nil { + localVarQueryParams.Add("group_bys", datadog.ParameterToString(*optionalParams.GroupBys, "")) + } + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -566,17 +620,17 @@ func (a *CaseManagementApi) CreateCaseServiceNowTicket(ctx _context.Context, cas } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -584,44 +638,44 @@ func (a *CaseManagementApi) CreateCaseServiceNowTicket(ctx _context.Context, cas ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -// CreateProject Create a project. -// Create a project. -func (a *CaseManagementApi) CreateProject(ctx _context.Context, body ProjectCreateRequest) (ProjectResponse, *_nethttp.Response, error) { +// CreateCase Create a case. +// Create a Case +func (a *CaseManagementApi) CreateCase(ctx _context.Context, body CaseCreateRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue ProjectResponse + localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateProject") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects" + localVarPath := localBasePath + "/api/v2/cases" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -687,21 +741,30 @@ func (a *CaseManagementApi) CreateProject(ctx _context.Context, body ProjectCrea return localVarReturnValue, localVarHTTPResponse, nil } -// CreateProjectNotificationRule Create a notification rule. -// Create a notification rule for a project. -func (a *CaseManagementApi) CreateProjectNotificationRule(ctx _context.Context, projectId string, body CaseNotificationRuleCreateRequest) (CaseNotificationRuleResponse, *_nethttp.Response, error) { +// CreateCaseAutomationRule Create an automation rule. +// Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute. +func (a *CaseManagementApi) CreateCaseAutomationRule(ctx _context.Context, projectId string, body AutomationRuleCreateRequest) (AutomationRuleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue CaseNotificationRuleResponse + localVarReturnValue AutomationRuleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateProjectNotificationRule") + operationId := "v2.CreateCaseAutomationRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseAutomationRule") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules" + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules" localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) localVarHeaderParams := make(map[string]string) @@ -768,28 +831,39 @@ func (a *CaseManagementApi) CreateProjectNotificationRule(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteCaseComment Delete case comment. -// Delete case comment -func (a *CaseManagementApi) DeleteCaseComment(ctx _context.Context, caseId string, cellId string) (*_nethttp.Response, error) { +// CreateCaseJiraIssue Create Jira issue for case. +// Create a new Jira issue and link it to a case +func (a *CaseManagementApi) CreateCaseJiraIssue(ctx _context.Context, caseId string, body JiraIssueCreateRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseComment") - if err != nil { + operationId := "v2.CreateCaseJiraIssue" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseJiraIssue") + if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/comment/{cell_id}" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/jira_issues" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{cell_id}", _neturl.PathEscape(datadog.ParameterToString(cellId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "*/*" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -823,7 +897,16 @@ func (a *CaseManagementApi) DeleteCaseComment(ctx _context.Context, caseId strin ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -837,29 +920,39 @@ func (a *CaseManagementApi) DeleteCaseComment(ctx _context.Context, caseId strin return localVarHTTPResponse, nil } -// DeleteCaseCustomAttribute Delete custom attribute from case. -// Delete custom attribute from case -func (a *CaseManagementApi) DeleteCaseCustomAttribute(ctx _context.Context, caseId string, customAttributeKey string) (CaseResponse, *_nethttp.Response, error) { +// CreateCaseLink Create a case link. +// Creates a directional link between two cases (for example, case A blocks case B). The parent and child cases and their relationship type must be specified. +func (a *CaseManagementApi) CreateCaseLink(ctx _context.Context, body CaseLinkCreateRequest) (CaseLinkResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarReturnValue CaseLinkResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseCustomAttribute") + operationId := "v2.CreateCaseLink" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseLink") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_attribute_key}", _neturl.PathEscape(datadog.ParameterToString(customAttributeKey, ""))) + localVarPath := localBasePath + "/api/v2/cases/link" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -893,7 +986,7 @@ func (a *CaseManagementApi) DeleteCaseCustomAttribute(ctx _context.Context, case ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -916,27 +1009,39 @@ func (a *CaseManagementApi) DeleteCaseCustomAttribute(ctx _context.Context, case return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteProject Remove a project. -// Remove a project using the project's `id`. -func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { +// CreateCaseNotebook Create investigation notebook for case. +// Create a new investigation notebook and link it to a case +func (a *CaseManagementApi) CreateCaseNotebook(ctx _context.Context, caseId string, body NotebookCreateRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteProject") + operationId := "v2.CreateCaseNotebook" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseNotebook") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/notebook" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "*/*" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -970,7 +1075,16 @@ func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -984,28 +1098,39 @@ func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string return localVarHTTPResponse, nil } -// DeleteProjectNotificationRule Delete a notification rule. -// Delete a notification rule using the notification rule's `id`. -func (a *CaseManagementApi) DeleteProjectNotificationRule(ctx _context.Context, projectId string, notificationRuleId string) (*_nethttp.Response, error) { +// CreateCaseServiceNowTicket Create ServiceNow ticket for case. +// Create a new ServiceNow incident ticket and link it to a case +func (a *CaseManagementApi) CreateCaseServiceNowTicket(ctx _context.Context, caseId string, body ServiceNowTicketCreateRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteProjectNotificationRule") + operationId := "v2.CreateCaseServiceNowTicket" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseServiceNowTicket") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{notification_rule_id}", _neturl.PathEscape(datadog.ParameterToString(notificationRuleId, ""))) + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "*/*" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1039,7 +1164,16 @@ func (a *CaseManagementApi) DeleteProjectNotificationRule(ctx _context.Context, ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1053,28 +1187,39 @@ func (a *CaseManagementApi) DeleteProjectNotificationRule(ctx _context.Context, return localVarHTTPResponse, nil } -// GetCase Get the details of a case. -// Get the details of case by `case_id` -func (a *CaseManagementApi) GetCase(ctx _context.Context, caseId string) (CaseResponse, *_nethttp.Response, error) { +// CreateCaseView Create a case view. +// Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view. +func (a *CaseManagementApi) CreateCaseView(ctx _context.Context, body CaseViewCreateRequest) (CaseViewResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarReturnValue CaseViewResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetCase") + operationId := "v2.CreateCaseView" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCaseView") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/views" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1131,28 +1276,39 @@ func (a *CaseManagementApi) GetCase(ctx _context.Context, caseId string) (CaseRe return localVarReturnValue, localVarHTTPResponse, nil } -// GetProject Get the details of a project. -// Get the details of a project by `project_id`. -func (a *CaseManagementApi) GetProject(ctx _context.Context, projectId string) (ProjectResponse, *_nethttp.Response, error) { +// CreateMaintenanceWindow Create a maintenance window. +// Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end). +func (a *CaseManagementApi) CreateMaintenanceWindow(ctx _context.Context, body MaintenanceWindowCreateRequest) (MaintenanceWindowResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue ProjectResponse + localVarReturnValue MaintenanceWindowResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProject") + operationId := "v2.CreateMaintenanceWindow" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateMaintenanceWindow") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath := localBasePath + "/api/v2/maintenance_windows" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1209,28 +1365,30 @@ func (a *CaseManagementApi) GetProject(ctx _context.Context, projectId string) ( return localVarReturnValue, localVarHTTPResponse, nil } -// GetProjectNotificationRules Get notification rules. -// Get all notification rules for a project. -func (a *CaseManagementApi) GetProjectNotificationRules(ctx _context.Context, projectId string) (CaseNotificationRulesResponse, *_nethttp.Response, error) { +// CreateProject Create a project. +// Create a project. +func (a *CaseManagementApi) CreateProject(ctx _context.Context, body ProjectCreateRequest) (ProjectResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue CaseNotificationRulesResponse + localVarReturnValue ProjectResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProjectNotificationRules") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateProject") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath := localBasePath + "/api/v2/cases/projects" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1287,27 +1445,31 @@ func (a *CaseManagementApi) GetProjectNotificationRules(ctx _context.Context, pr return localVarReturnValue, localVarHTTPResponse, nil } -// GetProjects Get all projects. -// Get all projects. -func (a *CaseManagementApi) GetProjects(ctx _context.Context) (ProjectsResponse, *_nethttp.Response, error) { +// CreateProjectNotificationRule Create a notification rule. +// Create a notification rule for a project. +func (a *CaseManagementApi) CreateProjectNotificationRule(ctx _context.Context, projectId string, body CaseNotificationRuleCreateRequest) (CaseNotificationRuleResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarReturnValue ProjectsResponse + localVarReturnValue CaseNotificationRuleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProjects") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateProjectNotificationRule") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/projects" + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1364,44 +1526,41 @@ func (a *CaseManagementApi) GetProjects(ctx _context.Context) (ProjectsResponse, return localVarReturnValue, localVarHTTPResponse, nil } -// LinkIncident Link incident to case. -// Link an incident to a case -func (a *CaseManagementApi) LinkIncident(ctx _context.Context, caseId string, body RelationshipToIncidentRequest) (CaseResponse, *_nethttp.Response, error) { +// DeleteCaseAutomationRule Delete an automation rule. +// Permanently deletes an automation rule from a project. +func (a *CaseManagementApi) DeleteCaseAutomationRule(ctx _context.Context, projectId string, ruleId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) - operationId := "v2.LinkIncident" + operationId := "v2.DeleteCaseAutomationRule" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.LinkIncident") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseAutomationRule") if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/incidents" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return localVarReturnValue, nil, err + return nil, err } } else { datadog.SetAuthKeys( @@ -1413,17 +1572,17 @@ func (a *CaseManagementApi) LinkIncident(ctx _context.Context, caseId string, bo } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1431,47 +1590,2786 @@ func (a *CaseManagementApi) LinkIncident(ctx _context.Context, caseId string, bo ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteCaseComment Delete case comment. +// Delete case comment +func (a *CaseManagementApi) DeleteCaseComment(ctx _context.Context, caseId string, cellId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseComment") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/comment/{cell_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cell_id}", _neturl.PathEscape(datadog.ParameterToString(cellId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteCaseCustomAttribute Delete custom attribute from case. +// Delete custom attribute from case +func (a *CaseManagementApi) DeleteCaseCustomAttribute(ctx _context.Context, caseId string, customAttributeKey string) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseCustomAttribute") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_attribute_key}", _neturl.PathEscape(datadog.ParameterToString(customAttributeKey, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DeleteCaseLink Delete a case link. +// Deletes an existing link between cases by link ID. +func (a *CaseManagementApi) DeleteCaseLink(ctx _context.Context, linkId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteCaseLink" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseLink") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/link/{link_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{link_id}", _neturl.PathEscape(datadog.ParameterToString(linkId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteCaseView Delete a case view. +// Permanently deletes a saved case view. +func (a *CaseManagementApi) DeleteCaseView(ctx _context.Context, viewId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteCaseView" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteCaseView") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/views/{view_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{view_id}", _neturl.PathEscape(datadog.ParameterToString(viewId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteMaintenanceWindow Delete a maintenance window. +// Permanently deletes a maintenance window. +func (a *CaseManagementApi) DeleteMaintenanceWindow(ctx _context.Context, maintenanceWindowId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteMaintenanceWindow" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteMaintenanceWindow") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/maintenance_windows/{maintenance_window_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{maintenance_window_id}", _neturl.PathEscape(datadog.ParameterToString(maintenanceWindowId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteProject Remove a project. +// Remove a project using the project's `id`. +func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteProjectNotificationRule Delete a notification rule. +// Delete a notification rule using the notification rule's `id`. +func (a *CaseManagementApi) DeleteProjectNotificationRule(ctx _context.Context, projectId string, notificationRuleId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteProjectNotificationRule") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{notification_rule_id}", _neturl.PathEscape(datadog.ParameterToString(notificationRuleId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DisableCaseAutomationRule Disable an automation rule. +// Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved. +func (a *CaseManagementApi) DisableCaseAutomationRule(ctx _context.Context, projectId string, ruleId string) (AutomationRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AutomationRuleResponse + ) + + operationId := "v2.DisableCaseAutomationRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DisableCaseAutomationRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// EnableCaseAutomationRule Enable an automation rule. +// Enables a previously disabled automation rule so it triggers on matching case events. +func (a *CaseManagementApi) EnableCaseAutomationRule(ctx _context.Context, projectId string, ruleId string) (AutomationRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue AutomationRuleResponse + ) + + operationId := "v2.EnableCaseAutomationRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.EnableCaseAutomationRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FavoriteCaseProject Favorite a project. +// Marks a case project as a favorite for the current authenticated user. +func (a *CaseManagementApi) FavoriteCaseProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.FavoriteCaseProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.FavoriteCaseProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/favorites" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// GetCase Get the details of a case. +// Get the details of case by `case_id` +func (a *CaseManagementApi) GetCase(ctx _context.Context, caseId string) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetCase") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCaseAutomationRule Get an automation rule. +// Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled). +func (a *CaseManagementApi) GetCaseAutomationRule(ctx _context.Context, projectId string, ruleId string) (AutomationRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AutomationRuleResponse + ) + + operationId := "v2.GetCaseAutomationRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetCaseAutomationRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCaseView Get a case view. +// Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps. +func (a *CaseManagementApi) GetCaseView(ctx _context.Context, viewId string) (CaseViewResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseViewResponse + ) + + operationId := "v2.GetCaseView" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetCaseView") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/views/{view_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{view_id}", _neturl.PathEscape(datadog.ParameterToString(viewId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetProject Get the details of a project. +// Get the details of a project by `project_id`. +func (a *CaseManagementApi) GetProject(ctx _context.Context, projectId string) (ProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProjectResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProject") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetProjectNotificationRules Get notification rules. +// Get all notification rules for a project. +func (a *CaseManagementApi) GetProjectNotificationRules(ctx _context.Context, projectId string) (CaseNotificationRulesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseNotificationRulesResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProjectNotificationRules") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/notification_rules" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetProjects Get all projects. +// Get all projects. +func (a *CaseManagementApi) GetProjects(ctx _context.Context) (ProjectsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProjectsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProjects") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// LinkIncident Link incident to case. +// Link an incident to a case +func (a *CaseManagementApi) LinkIncident(ctx _context.Context, caseId string, body RelationshipToIncidentRequest) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + operationId := "v2.LinkIncident" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.LinkIncident") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/incidents" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// LinkJiraIssueToCase Link existing Jira issue to case. +// Link an existing Jira issue to a case +func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId string, body JiraIssueLinkRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + ) + + operationId := "v2.LinkJiraIssueToCase" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.LinkJiraIssueToCase") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/jira_issues" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// ListCaseAutomationRules List automation rules. +// Returns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes. +func (a *CaseManagementApi) ListCaseAutomationRules(ctx _context.Context, projectId string) (AutomationRulesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AutomationRulesResponse + ) + + operationId := "v2.ListCaseAutomationRules" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListCaseAutomationRules") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCaseLinksOptionalParameters holds optional parameters for ListCaseLinks. +type ListCaseLinksOptionalParameters struct { + Relationship *string +} + +// NewListCaseLinksOptionalParameters creates an empty struct for parameters. +func NewListCaseLinksOptionalParameters() *ListCaseLinksOptionalParameters { + this := ListCaseLinksOptionalParameters{} + return &this +} + +// WithRelationship sets the corresponding parameter name and returns the struct. +func (r *ListCaseLinksOptionalParameters) WithRelationship(relationship string) *ListCaseLinksOptionalParameters { + r.Relationship = &relationship + return r +} + +// ListCaseLinks List case links. +// Returns all links associated with a case. Links define relationships (for example, BLOCKS) between cases. Requires entity_type and entity_id query parameters. +func (a *CaseManagementApi) ListCaseLinks(ctx _context.Context, entityType string, entityId string, o ...ListCaseLinksOptionalParameters) (CaseLinksResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseLinksResponse + optionalParams ListCaseLinksOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCaseLinksOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCaseLinks" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListCaseLinks") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/link" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("entity_type", datadog.ParameterToString(entityType, "")) + localVarQueryParams.Add("entity_id", datadog.ParameterToString(entityId, "")) + if optionalParams.Relationship != nil { + localVarQueryParams.Add("relationship", datadog.ParameterToString(*optionalParams.Relationship, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCaseTimelineOptionalParameters holds optional parameters for ListCaseTimeline. +type ListCaseTimelineOptionalParameters struct { + PageSize *int32 + PageNumber *int32 + SortAscending *bool +} + +// NewListCaseTimelineOptionalParameters creates an empty struct for parameters. +func NewListCaseTimelineOptionalParameters() *ListCaseTimelineOptionalParameters { + this := ListCaseTimelineOptionalParameters{} + return &this +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *ListCaseTimelineOptionalParameters) WithPageSize(pageSize int32) *ListCaseTimelineOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageNumber sets the corresponding parameter name and returns the struct. +func (r *ListCaseTimelineOptionalParameters) WithPageNumber(pageNumber int32) *ListCaseTimelineOptionalParameters { + r.PageNumber = &pageNumber + return r +} + +// WithSortAscending sets the corresponding parameter name and returns the struct. +func (r *ListCaseTimelineOptionalParameters) WithSortAscending(sortAscending bool) *ListCaseTimelineOptionalParameters { + r.SortAscending = &sortAscending + return r +} + +// ListCaseTimeline Get case timeline. +// Returns the timeline of events for a case, including comments, status changes, and other activity. Supports pagination and sort order. +func (a *CaseManagementApi) ListCaseTimeline(ctx _context.Context, caseId string, o ...ListCaseTimelineOptionalParameters) (TimelineResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue TimelineResponse + optionalParams ListCaseTimelineOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCaseTimelineOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCaseTimeline" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListCaseTimeline") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/timelines" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageNumber != nil { + localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) + } + if optionalParams.SortAscending != nil { + localVarQueryParams.Add("sort[ascending]", datadog.ParameterToString(*optionalParams.SortAscending, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCaseViews List case views. +// Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases. +func (a *CaseManagementApi) ListCaseViews(ctx _context.Context, projectId string) (CaseViewsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseViewsResponse + ) + + operationId := "v2.ListCaseViews" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListCaseViews") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/views" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("project_id", datadog.ParameterToString(projectId, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCaseWatchers List case watchers. +// Returns the list of users who are watching a case. Watchers receive notifications about updates to the case. +func (a *CaseManagementApi) ListCaseWatchers(ctx _context.Context, caseId string) (CaseWatchersResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CaseWatchersResponse + ) + + operationId := "v2.ListCaseWatchers" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListCaseWatchers") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/watchers" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListMaintenanceWindows List maintenance windows. +// Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query. +func (a *CaseManagementApi) ListMaintenanceWindows(ctx _context.Context) (MaintenanceWindowsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue MaintenanceWindowsResponse + ) + + operationId := "v2.ListMaintenanceWindows" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListMaintenanceWindows") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/maintenance_windows" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListUserCaseProjectFavorites List project favorites. +// Returns the list of case projects that the current authenticated user has marked as favorites. +func (a *CaseManagementApi) ListUserCaseProjectFavorites(ctx _context.Context) (ProjectFavoritesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProjectFavoritesResponse + ) + + operationId := "v2.ListUserCaseProjectFavorites" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ListUserCaseProjectFavorites") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/favorites" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// MoveCaseToProject Update case project. +// Update the project associated with a case +func (a *CaseManagementApi) MoveCaseToProject(ctx _context.Context, caseId string, body ProjectRelationship) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + operationId := "v2.MoveCaseToProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.MoveCaseToProject") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/project" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// RemoveCaseInsights Remove insights from a case. +// Removes one or more previously added insights from a case by specifying their type and resource identifier in the request body. +func (a *CaseManagementApi) RemoveCaseInsights(ctx _context.Context, caseId string, body CaseInsightsRequest) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + operationId := "v2.RemoveCaseInsights" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.RemoveCaseInsights") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/insights" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// SearchCasesOptionalParameters holds optional parameters for SearchCases. +type SearchCasesOptionalParameters struct { + PageSize *int64 + PageNumber *int64 + SortField *CaseSortableField + Filter *string + SortAsc *bool +} + +// NewSearchCasesOptionalParameters creates an empty struct for parameters. +func NewSearchCasesOptionalParameters() *SearchCasesOptionalParameters { + this := SearchCasesOptionalParameters{} + return &this +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *SearchCasesOptionalParameters) WithPageSize(pageSize int64) *SearchCasesOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageNumber sets the corresponding parameter name and returns the struct. +func (r *SearchCasesOptionalParameters) WithPageNumber(pageNumber int64) *SearchCasesOptionalParameters { + r.PageNumber = &pageNumber + return r +} + +// WithSortField sets the corresponding parameter name and returns the struct. +func (r *SearchCasesOptionalParameters) WithSortField(sortField CaseSortableField) *SearchCasesOptionalParameters { + r.SortField = &sortField + return r +} + +// WithFilter sets the corresponding parameter name and returns the struct. +func (r *SearchCasesOptionalParameters) WithFilter(filter string) *SearchCasesOptionalParameters { + r.Filter = &filter + return r +} + +// WithSortAsc sets the corresponding parameter name and returns the struct. +func (r *SearchCasesOptionalParameters) WithSortAsc(sortAsc bool) *SearchCasesOptionalParameters { + r.SortAsc = &sortAsc + return r +} + +// SearchCases Search cases. +// Search cases. +func (a *CaseManagementApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalParameters) (CasesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CasesResponse + optionalParams SearchCasesOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type SearchCasesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.SearchCases") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageNumber != nil { + localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) + } + if optionalParams.SortField != nil { + localVarQueryParams.Add("sort[field]", datadog.ParameterToString(*optionalParams.SortField, "")) + } + if optionalParams.Filter != nil { + localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) + } + if optionalParams.SortAsc != nil { + localVarQueryParams.Add("sort[asc]", datadog.ParameterToString(*optionalParams.SortAsc, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// SearchCasesWithPagination provides a paginated version of SearchCases returning a channel with all items. +func (a *CaseManagementApi) SearchCasesWithPagination(ctx _context.Context, o ...SearchCasesOptionalParameters) (<-chan datadog.PaginationResult[Case], func()) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int64(10) + if len(o) == 0 { + o = append(o, SearchCasesOptionalParameters{}) + } + if o[0].PageSize != nil { + pageSize_ = *o[0].PageSize + } + o[0].PageSize = &pageSize_ + page_ := int64(1) + o[0].PageNumber = &page_ + + items := make(chan datadog.PaginationResult[Case], pageSize_) + go func() { + for { + resp, _, err := a.SearchCases(ctx, o...) + if err != nil { + var returnItem Case + items <- datadog.PaginationResult[Case]{Item: returnItem, Error: err} + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- datadog.PaginationResult[Case]{Item: item, Error: nil}: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + pageOffset_ := *o[0].PageNumber + 1 + o[0].PageNumber = &pageOffset_ + } + close(items) + }() + return items, cancel +} + +// UnarchiveCase Unarchive case. +// Unarchive case +func (a *CaseManagementApi) UnarchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnarchiveCase") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/unarchive" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UnassignCase Unassign case. +// Unassign case +func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnassignCase") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/unassign" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, nil } -// LinkJiraIssueToCase Link existing Jira issue to case. -// Link an existing Jira issue to a case -func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId string, body JiraIssueLinkRequest) (*_nethttp.Response, error) { +// UnfavoriteCaseProject Unfavorite a project. +// Removes a case project from the current user's favorites list. +func (a *CaseManagementApi) UnfavoriteCaseProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.UnfavoriteCaseProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnfavoriteCaseProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/favorites" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UnlinkJiraIssue Remove Jira issue link from case. +// Remove the link between a Jira issue and a case +func (a *CaseManagementApi) UnlinkJiraIssue(ctx _context.Context, caseId string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} ) - operationId := "v2.LinkJiraIssueToCase" + operationId := "v2.UnlinkJiraIssue" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -1480,7 +4378,7 @@ func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId str _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.LinkJiraIssueToCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnlinkJiraIssue") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -1491,11 +4389,8 @@ func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId str localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "*/*" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1529,7 +4424,7 @@ func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId str ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1552,30 +4447,99 @@ func (a *CaseManagementApi) LinkJiraIssueToCase(ctx _context.Context, caseId str return localVarHTTPResponse, nil } -// MoveCaseToProject Update case project. -// Update the project associated with a case -func (a *CaseManagementApi) MoveCaseToProject(ctx _context.Context, caseId string, body ProjectRelationship) (CaseResponse, *_nethttp.Response, error) { +// UnwatchCase Unwatch a case. +// Removes a user from the watchers list of a case. The user no longer receives notifications about updates to the case. +func (a *CaseManagementApi) UnwatchCase(ctx _context.Context, caseId string, userUuid string) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) - operationId := "v2.MoveCaseToProject" + operationId := "v2.UnwatchCase" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.MoveCaseToProject") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnwatchCase") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_uuid}", _neturl.PathEscape(datadog.ParameterToString(userUuid, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateAttributes Update case attributes. +// Update case attributes +func (a *CaseManagementApi) UpdateAttributes(ctx _context.Context, caseId string, body CaseUpdateAttributesRequest) (CaseResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CaseResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateAttributes") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/project" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/attributes" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) @@ -1619,16 +4583,7 @@ func (a *CaseManagementApi) MoveCaseToProject(ctx _context.Context, caseId strin ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1651,95 +4606,41 @@ func (a *CaseManagementApi) MoveCaseToProject(ctx _context.Context, caseId strin return localVarReturnValue, localVarHTTPResponse, nil } -// SearchCasesOptionalParameters holds optional parameters for SearchCases. -type SearchCasesOptionalParameters struct { - PageSize *int64 - PageNumber *int64 - SortField *CaseSortableField - Filter *string - SortAsc *bool -} - -// NewSearchCasesOptionalParameters creates an empty struct for parameters. -func NewSearchCasesOptionalParameters() *SearchCasesOptionalParameters { - this := SearchCasesOptionalParameters{} - return &this -} - -// WithPageSize sets the corresponding parameter name and returns the struct. -func (r *SearchCasesOptionalParameters) WithPageSize(pageSize int64) *SearchCasesOptionalParameters { - r.PageSize = &pageSize - return r -} - -// WithPageNumber sets the corresponding parameter name and returns the struct. -func (r *SearchCasesOptionalParameters) WithPageNumber(pageNumber int64) *SearchCasesOptionalParameters { - r.PageNumber = &pageNumber - return r -} - -// WithSortField sets the corresponding parameter name and returns the struct. -func (r *SearchCasesOptionalParameters) WithSortField(sortField CaseSortableField) *SearchCasesOptionalParameters { - r.SortField = &sortField - return r -} - -// WithFilter sets the corresponding parameter name and returns the struct. -func (r *SearchCasesOptionalParameters) WithFilter(filter string) *SearchCasesOptionalParameters { - r.Filter = &filter - return r -} - -// WithSortAsc sets the corresponding parameter name and returns the struct. -func (r *SearchCasesOptionalParameters) WithSortAsc(sortAsc bool) *SearchCasesOptionalParameters { - r.SortAsc = &sortAsc - return r -} - -// SearchCases Search cases. -// Search cases. -func (a *CaseManagementApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalParameters) (CasesResponse, *_nethttp.Response, error) { +// UpdateCaseAutomationRule Update an automation rule. +// Updates the trigger, action, name, or state of an existing automation rule. +func (a *CaseManagementApi) UpdateCaseAutomationRule(ctx _context.Context, projectId string, ruleId string, body AutomationRuleUpdateRequest) (AutomationRuleResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarReturnValue CasesResponse - optionalParams SearchCasesOptionalParameters + localVarReturnValue AutomationRuleResponse ) - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type SearchCasesOptionalParameters is allowed") + operationId := "v2.UpdateCaseAutomationRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } - if len(o) == 1 { - optionalParams = o[0] + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.SearchCases") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseAutomationRule") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases" + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.PageSize != nil { - localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) - } - if optionalParams.PageNumber != nil { - localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) - } - if optionalParams.SortField != nil { - localVarQueryParams.Add("sort[field]", datadog.ParameterToString(*optionalParams.SortField, "")) - } - if optionalParams.Filter != nil { - localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) - } - if optionalParams.SortAsc != nil { - localVarQueryParams.Add("sort[asc]", datadog.ParameterToString(*optionalParams.SortAsc, "")) - } + localVarHeaderParams["Content-Type"] = "application/json" localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { @@ -1796,70 +4697,104 @@ func (a *CaseManagementApi) SearchCases(ctx _context.Context, o ...SearchCasesOp return localVarReturnValue, localVarHTTPResponse, nil } -// SearchCasesWithPagination provides a paginated version of SearchCases returning a channel with all items. -func (a *CaseManagementApi) SearchCasesWithPagination(ctx _context.Context, o ...SearchCasesOptionalParameters) (<-chan datadog.PaginationResult[Case], func()) { - ctx, cancel := _context.WithCancel(ctx) - pageSize_ := int64(10) - if len(o) == 0 { - o = append(o, SearchCasesOptionalParameters{}) +// UpdateCaseComment Update case comment. +// Updates the text content of an existing comment on a case timeline. The comment is identified by its cell ID. +func (a *CaseManagementApi) UpdateCaseComment(ctx _context.Context, caseId string, cellId string, body CaseUpdateCommentRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + ) + + operationId := "v2.UpdateCaseComment" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseComment") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/comment/{cell_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cell_id}", _neturl.PathEscape(datadog.ParameterToString(cellId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - if o[0].PageSize != nil { - pageSize_ = *o[0].PageSize + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err } - o[0].PageSize = &pageSize_ - page_ := int64(1) - o[0].PageNumber = &page_ - items := make(chan datadog.PaginationResult[Case], pageSize_) - go func() { - for { - resp, _, err := a.SearchCases(ctx, o...) + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - var returnItem Case - items <- datadog.PaginationResult[Case]{Item: returnItem, Error: err} - break - } - respData, ok := resp.GetDataOk() - if !ok { - break - } - results := *respData - - for _, item := range results { - select { - case items <- datadog.PaginationResult[Case]{Item: item, Error: nil}: - case <-ctx.Done(): - close(items) - return - } - } - if len(results) < int(pageSize_) { - break + return localVarHTTPResponse, newErr } - pageOffset_ := *o[0].PageNumber + 1 - o[0].PageNumber = &pageOffset_ + newErr.ErrorModel = v } - close(items) - }() - return items, cancel + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil } -// UnarchiveCase Unarchive case. -// Unarchive case -func (a *CaseManagementApi) UnarchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateCaseCustomAttribute Update case custom attribute. +// Update case custom attribute +func (a *CaseManagementApi) UpdateCaseCustomAttribute(ctx _context.Context, caseId string, customAttributeKey string, body CaseUpdateCustomAttributeRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnarchiveCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseCustomAttribute") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/unarchive" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_attribute_key}", _neturl.PathEscape(datadog.ParameterToString(customAttributeKey, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1925,21 +4860,21 @@ func (a *CaseManagementApi) UnarchiveCase(ctx _context.Context, caseId string, b return localVarReturnValue, localVarHTTPResponse, nil } -// UnassignCase Unassign case. -// Unassign case -func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateCaseDescription Update case description. +// Update case description +func (a *CaseManagementApi) UpdateCaseDescription(ctx _context.Context, caseId string, body CaseUpdateDescriptionRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnassignCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseDescription") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/unassign" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/description" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) @@ -2006,40 +4941,44 @@ func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, bo return localVarReturnValue, localVarHTTPResponse, nil } -// UnlinkJiraIssue Remove Jira issue link from case. -// Remove the link between a Jira issue and a case -func (a *CaseManagementApi) UnlinkJiraIssue(ctx _context.Context, caseId string) (*_nethttp.Response, error) { +// UpdateCaseDueDate Update case due date. +// Sets or updates the due date for a case. The due date is a calendar date (without a time component) indicating when the case should be resolved. +func (a *CaseManagementApi) UpdateCaseDueDate(ctx _context.Context, caseId string, body CaseUpdateDueDateRequest) (CaseResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CaseResponse ) - operationId := "v2.UnlinkJiraIssue" + operationId := "v2.UpdateCaseDueDate" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnlinkJiraIssue") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseDueDate") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/relationships/jira_issues" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/due_date" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + // body params + localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -2051,17 +4990,17 @@ func (a *CaseManagementApi) UnlinkJiraIssue(ctx _context.Context, caseId string) } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2069,44 +5008,53 @@ func (a *CaseManagementApi) UnlinkJiraIssue(ctx _context.Context, caseId string) ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateAttributes Update case attributes. -// Update case attributes -func (a *CaseManagementApi) UpdateAttributes(ctx _context.Context, caseId string, body CaseUpdateAttributesRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateCaseResolvedReason Update case resolved reason. +// Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). Applicable to security-type cases. +func (a *CaseManagementApi) UpdateCaseResolvedReason(ctx _context.Context, caseId string, body CaseUpdateResolvedReasonRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateAttributes") + operationId := "v2.UpdateCaseResolvedReason" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseResolvedReason") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/attributes" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/resolved_reason" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) localVarHeaderParams := make(map[string]string) @@ -2173,23 +5121,22 @@ func (a *CaseManagementApi) UpdateAttributes(ctx _context.Context, caseId string return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateCaseCustomAttribute Update case custom attribute. -// Update case custom attribute -func (a *CaseManagementApi) UpdateCaseCustomAttribute(ctx _context.Context, caseId string, customAttributeKey string, body CaseUpdateCustomAttributeRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateCaseTitle Update case title. +// Update case title +func (a *CaseManagementApi) UpdateCaseTitle(ctx _context.Context, caseId string, body CaseUpdateTitleRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseCustomAttribute") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseTitle") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + localVarPath := localBasePath + "/api/v2/cases/{case_id}/title" localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_attribute_key}", _neturl.PathEscape(datadog.ParameterToString(customAttributeKey, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2255,22 +5202,31 @@ func (a *CaseManagementApi) UpdateCaseCustomAttribute(ctx _context.Context, case return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateCaseDescription Update case description. -// Update case description -func (a *CaseManagementApi) UpdateCaseDescription(ctx _context.Context, caseId string, body CaseUpdateDescriptionRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateCaseView Update a case view. +// Updates the name, query, or notification rule of an existing case view. +func (a *CaseManagementApi) UpdateCaseView(ctx _context.Context, viewId string, body CaseViewUpdateRequest) (CaseViewResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarReturnValue CaseViewResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseDescription") + operationId := "v2.UpdateCaseView" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseView") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/description" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/cases/views/{view_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{view_id}", _neturl.PathEscape(datadog.ParameterToString(viewId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2336,22 +5292,31 @@ func (a *CaseManagementApi) UpdateCaseDescription(ctx _context.Context, caseId s return localVarReturnValue, localVarHTTPResponse, nil } -// UpdateCaseTitle Update case title. -// Update case title -func (a *CaseManagementApi) UpdateCaseTitle(ctx _context.Context, caseId string, body CaseUpdateTitleRequest) (CaseResponse, *_nethttp.Response, error) { +// UpdateMaintenanceWindow Update a maintenance window. +// Updates the name, query, start time, or end time of an existing maintenance window. +func (a *CaseManagementApi) UpdateMaintenanceWindow(ctx _context.Context, maintenanceWindowId string, body MaintenanceWindowUpdateRequest) (MaintenanceWindowResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarReturnValue CaseResponse + localVarReturnValue MaintenanceWindowResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateCaseTitle") + operationId := "v2.UpdateMaintenanceWindow" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateMaintenanceWindow") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cases/{case_id}/title" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath := localBasePath + "/api/v2/maintenance_windows/{maintenance_window_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{maintenance_window_id}", _neturl.PathEscape(datadog.ParameterToString(maintenanceWindowId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2732,6 +5697,84 @@ func (a *CaseManagementApi) UpdateStatus(ctx _context.Context, caseId string, bo return localVarReturnValue, localVarHTTPResponse, nil } +// WatchCase Watch a case. +// Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications about subsequent updates to the case. +func (a *CaseManagementApi) WatchCase(ctx _context.Context, caseId string, userUuid string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.WatchCase" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.WatchCase") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{user_uuid}", _neturl.PathEscape(datadog.ParameterToString(userUuid, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // NewCaseManagementApi Returns NewCaseManagementApi. func NewCaseManagementApi(client *datadog.APIClient) *CaseManagementApi { return &CaseManagementApi{ diff --git a/api/datadogV2/api_case_management_attribute.go b/api/datadogV2/api_case_management_attribute.go index 33832b05970..f25d3039b4a 100644 --- a/api/datadogV2/api_case_management_attribute.go +++ b/api/datadogV2/api_case_management_attribute.go @@ -6,6 +6,8 @@ package datadogV2 import ( _context "context" + _fmt "fmt" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -320,6 +322,97 @@ func (a *CaseManagementAttributeApi) GetAllCustomAttributes(ctx _context.Context return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateCustomAttributeConfig Update custom attribute config. +// Updates the display name, description, type, or options of an existing custom attribute configuration for a case type. +func (a *CaseManagementAttributeApi) UpdateCustomAttributeConfig(ctx _context.Context, caseTypeId string, customAttributeId string, body CustomAttributeConfigUpdateRequest) (CustomAttributeConfigResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarReturnValue CustomAttributeConfigResponse + ) + + operationId := "v2.UpdateCustomAttributeConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementAttributeApi.UpdateCustomAttributeConfig") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/types/{case_type_id}/custom_attributes/{custom_attribute_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_type_id}", _neturl.PathEscape(datadog.ParameterToString(caseTypeId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{custom_attribute_id}", _neturl.PathEscape(datadog.ParameterToString(customAttributeId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // NewCaseManagementAttributeApi Returns NewCaseManagementAttributeApi. func NewCaseManagementAttributeApi(client *datadog.APIClient) *CaseManagementAttributeApi { return &CaseManagementAttributeApi{ diff --git a/api/datadogV2/api_case_management_type.go b/api/datadogV2/api_case_management_type.go index 00932b49bba..43af452d9d3 100644 --- a/api/datadogV2/api_case_management_type.go +++ b/api/datadogV2/api_case_management_type.go @@ -6,6 +6,8 @@ package datadogV2 import ( _context "context" + _fmt "fmt" + _log "log" _nethttp "net/http" _neturl "net/url" @@ -240,6 +242,96 @@ func (a *CaseManagementTypeApi) GetAllCaseTypes(ctx _context.Context) (CaseTypes return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateCaseType Update a case type. +// Updates the name, emoji, or description of an existing case type. +func (a *CaseManagementTypeApi) UpdateCaseType(ctx _context.Context, caseTypeId string, body CaseTypeUpdateRequest) (CaseTypeResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarReturnValue CaseTypeResponse + ) + + operationId := "v2.UpdateCaseType" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementTypeApi.UpdateCaseType") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/types/{case_type_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_type_id}", _neturl.PathEscape(datadog.ParameterToString(caseTypeId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // NewCaseManagementTypeApi Returns NewCaseManagementTypeApi. func NewCaseManagementTypeApi(client *datadog.APIClient) *CaseManagementTypeApi { return &CaseManagementTypeApi{ diff --git a/api/datadogV2/api_cloud_cost_management.go b/api/datadogV2/api_cloud_cost_management.go index 36338ab70b2..9416f6b0ef6 100644 --- a/api/datadogV2/api_cloud_cost_management.go +++ b/api/datadogV2/api_cloud_cost_management.go @@ -984,26 +984,76 @@ func (a *CloudCostManagementApi) GetBudget(ctx _context.Context, budgetId string return localVarReturnValue, localVarHTTPResponse, nil } -// GetCostAWSCURConfig Get cost AWS CUR config. -// Get a specific AWS CUR config. -func (a *CloudCostManagementApi) GetCostAWSCURConfig(ctx _context.Context, cloudAccountId int64) (AwsCurConfigResponse, *_nethttp.Response, error) { +// GetCommitmentsCommitmentListOptionalParameters holds optional parameters for GetCommitmentsCommitmentList. +type GetCommitmentsCommitmentListOptionalParameters struct { + FilterBy *string + CommitmentType *CommitmentsCommitmentType +} + +// NewGetCommitmentsCommitmentListOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsCommitmentListOptionalParameters() *GetCommitmentsCommitmentListOptionalParameters { + this := GetCommitmentsCommitmentListOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsCommitmentListOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsCommitmentListOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// WithCommitmentType sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsCommitmentListOptionalParameters) WithCommitmentType(commitmentType CommitmentsCommitmentType) *GetCommitmentsCommitmentListOptionalParameters { + r.CommitmentType = &commitmentType + return r +} + +// GetCommitmentsCommitmentList Get commitments list. +// Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. +func (a *CloudCostManagementApi) GetCommitmentsCommitmentList(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsCommitmentListOptionalParameters) (CommitmentsListResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue AwsCurConfigResponse + localVarReturnValue CommitmentsListResponse + optionalParams GetCommitmentsCommitmentListOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAWSCURConfig") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsCommitmentListOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsCommitmentList" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsCommitmentList") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/aws_cur_config/{cloud_account_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/commitment-list" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } + if optionalParams.CommitmentType != nil { + localVarQueryParams.Add("commitmentType", datadog.ParameterToString(*optionalParams.CommitmentType, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1039,6 +1089,15 @@ func (a *CloudCostManagementApi) GetCostAWSCURConfig(ctx _context.Context, cloud ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1062,16 +1121,41 @@ func (a *CloudCostManagementApi) GetCostAWSCURConfig(ctx _context.Context, cloud return localVarReturnValue, localVarHTTPResponse, nil } -// GetCostAnomaly Get cost anomaly. -// Get a detected Cloud Cost Management anomaly by UUID. -func (a *CloudCostManagementApi) GetCostAnomaly(ctx _context.Context, anomalyId string) (CostAnomalyResponse, *_nethttp.Response, error) { +// GetCommitmentsCoverageScalarOptionalParameters holds optional parameters for GetCommitmentsCoverageScalar. +type GetCommitmentsCoverageScalarOptionalParameters struct { + FilterBy *string +} + +// NewGetCommitmentsCoverageScalarOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsCoverageScalarOptionalParameters() *GetCommitmentsCoverageScalarOptionalParameters { + this := GetCommitmentsCoverageScalarOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsCoverageScalarOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsCoverageScalarOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// GetCommitmentsCoverageScalar Get commitments coverage (scalar). +// Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. +func (a *CloudCostManagementApi) GetCommitmentsCoverageScalar(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsCoverageScalarOptionalParameters) (CommitmentsCoverageScalarResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CostAnomalyResponse + localVarReturnValue CommitmentsCoverageScalarResponse + optionalParams GetCommitmentsCoverageScalarOptionalParameters ) - operationId := "v2.GetCostAnomaly" + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsCoverageScalarOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsCoverageScalar" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -1080,17 +1164,23 @@ func (a *CloudCostManagementApi) GetCostAnomaly(ctx _context.Context, anomalyId _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAnomaly") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsCoverageScalar") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/anomalies/{anomaly_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{anomaly_id}", _neturl.PathEscape(datadog.ParameterToString(anomalyId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/coverage/scalar" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1126,7 +1216,16 @@ func (a *CloudCostManagementApi) GetCostAnomaly(ctx _context.Context, anomalyId ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1149,26 +1248,66 @@ func (a *CloudCostManagementApi) GetCostAnomaly(ctx _context.Context, anomalyId return localVarReturnValue, localVarHTTPResponse, nil } -// GetCostAzureUCConfig Get cost Azure UC config. -// Get a specific Azure config. -func (a *CloudCostManagementApi) GetCostAzureUCConfig(ctx _context.Context, cloudAccountId int64) (UCConfigPair, *_nethttp.Response, error) { +// GetCommitmentsCoverageTimeseriesOptionalParameters holds optional parameters for GetCommitmentsCoverageTimeseries. +type GetCommitmentsCoverageTimeseriesOptionalParameters struct { + FilterBy *string +} + +// NewGetCommitmentsCoverageTimeseriesOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsCoverageTimeseriesOptionalParameters() *GetCommitmentsCoverageTimeseriesOptionalParameters { + this := GetCommitmentsCoverageTimeseriesOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsCoverageTimeseriesOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsCoverageTimeseriesOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// GetCommitmentsCoverageTimeseries Get commitments coverage (timeseries). +// Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. +func (a *CloudCostManagementApi) GetCommitmentsCoverageTimeseries(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsCoverageTimeseriesOptionalParameters) (CommitmentsCoverageTimeseriesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue UCConfigPair + localVarReturnValue CommitmentsCoverageTimeseriesResponse + optionalParams GetCommitmentsCoverageTimeseriesOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAzureUCConfig") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsCoverageTimeseriesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsCoverageTimeseries" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsCoverageTimeseries") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/azure_uc_config/{cloud_account_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/coverage/timeseries" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1204,6 +1343,15 @@ func (a *CloudCostManagementApi) GetCostAzureUCConfig(ctx _context.Context, clou ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1227,26 +1375,66 @@ func (a *CloudCostManagementApi) GetCostAzureUCConfig(ctx _context.Context, clou return localVarReturnValue, localVarHTTPResponse, nil } -// GetCostGCPUsageCostConfig Get Google Cloud Usage Cost config. -// Get a specific Google Cloud Usage Cost config. -func (a *CloudCostManagementApi) GetCostGCPUsageCostConfig(ctx _context.Context, cloudAccountId int64) (GcpUcConfigResponse, *_nethttp.Response, error) { +// GetCommitmentsOnDemandHotspotsScalarOptionalParameters holds optional parameters for GetCommitmentsOnDemandHotspotsScalar. +type GetCommitmentsOnDemandHotspotsScalarOptionalParameters struct { + FilterBy *string +} + +// NewGetCommitmentsOnDemandHotspotsScalarOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsOnDemandHotspotsScalarOptionalParameters() *GetCommitmentsOnDemandHotspotsScalarOptionalParameters { + this := GetCommitmentsOnDemandHotspotsScalarOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsOnDemandHotspotsScalarOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsOnDemandHotspotsScalarOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// GetCommitmentsOnDemandHotspotsScalar Get commitments on-demand hot spots (scalar). +// Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. +func (a *CloudCostManagementApi) GetCommitmentsOnDemandHotspotsScalar(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsOnDemandHotspotsScalarOptionalParameters) (CommitmentsOnDemandHotspotsScalarResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue GcpUcConfigResponse + localVarReturnValue CommitmentsOnDemandHotspotsScalarResponse + optionalParams GetCommitmentsOnDemandHotspotsScalarOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostGCPUsageCostConfig") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsOnDemandHotspotsScalarOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsOnDemandHotspotsScalar" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsOnDemandHotspotsScalar") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/on-demand-hot-spots/scalar" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1282,6 +1470,15 @@ func (a *CloudCostManagementApi) GetCostGCPUsageCostConfig(ctx _context.Context, ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1305,63 +1502,65 @@ func (a *CloudCostManagementApi) GetCostGCPUsageCostConfig(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } -// GetCostTagKeyOptionalParameters holds optional parameters for GetCostTagKey. -type GetCostTagKeyOptionalParameters struct { - FilterMetric *string - PageSize *int32 +// GetCommitmentsSavingsScalarOptionalParameters holds optional parameters for GetCommitmentsSavingsScalar. +type GetCommitmentsSavingsScalarOptionalParameters struct { + FilterBy *string } -// NewGetCostTagKeyOptionalParameters creates an empty struct for parameters. -func NewGetCostTagKeyOptionalParameters() *GetCostTagKeyOptionalParameters { - this := GetCostTagKeyOptionalParameters{} +// NewGetCommitmentsSavingsScalarOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsSavingsScalarOptionalParameters() *GetCommitmentsSavingsScalarOptionalParameters { + this := GetCommitmentsSavingsScalarOptionalParameters{} return &this } -// WithFilterMetric sets the corresponding parameter name and returns the struct. -func (r *GetCostTagKeyOptionalParameters) WithFilterMetric(filterMetric string) *GetCostTagKeyOptionalParameters { - r.FilterMetric = &filterMetric - return r -} - -// WithPageSize sets the corresponding parameter name and returns the struct. -func (r *GetCostTagKeyOptionalParameters) WithPageSize(pageSize int32) *GetCostTagKeyOptionalParameters { - r.PageSize = &pageSize +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsSavingsScalarOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsSavingsScalarOptionalParameters { + r.FilterBy = &filterBy return r } -// GetCostTagKey Get a Cloud Cost Management tag key. -// Get details for a specific Cloud Cost Management tag key, including example tag values and description. -func (a *CloudCostManagementApi) GetCostTagKey(ctx _context.Context, tagKey string, o ...GetCostTagKeyOptionalParameters) (CostTagKeyResponse, *_nethttp.Response, error) { +// GetCommitmentsSavingsScalar Get commitments savings (scalar). +// Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. +func (a *CloudCostManagementApi) GetCommitmentsSavingsScalar(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsSavingsScalarOptionalParameters) (CommitmentsSavingsScalarResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CostTagKeyResponse - optionalParams GetCostTagKeyOptionalParameters + localVarReturnValue CommitmentsSavingsScalarResponse + optionalParams GetCommitmentsSavingsScalarOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCostTagKeyOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsSavingsScalarOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostTagKey") + operationId := "v2.GetCommitmentsSavingsScalar" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsSavingsScalar") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/tag_keys/{tag_key}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{tag_key}", _neturl.PathEscape(datadog.ParameterToString(tagKey, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/savings/scalar" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.FilterMetric != nil { - localVarQueryParams.Add("filter[metric]", datadog.ParameterToString(*optionalParams.FilterMetric, "")) - } - if optionalParams.PageSize != nil { - localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -1398,7 +1597,16 @@ func (a *CloudCostManagementApi) GetCostTagKey(ctx _context.Context, tagKey stri ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1421,26 +1629,66 @@ func (a *CloudCostManagementApi) GetCostTagKey(ctx _context.Context, tagKey stri return localVarReturnValue, localVarHTTPResponse, nil } -// GetCustomAllocationRule Get custom allocation rule. -// Get a specific custom allocation rule - Retrieve a specific custom allocation rule by its ID -func (a *CloudCostManagementApi) GetCustomAllocationRule(ctx _context.Context, ruleId int64) (ArbitraryRuleResponse, *_nethttp.Response, error) { +// GetCommitmentsSavingsTimeseriesOptionalParameters holds optional parameters for GetCommitmentsSavingsTimeseries. +type GetCommitmentsSavingsTimeseriesOptionalParameters struct { + FilterBy *string +} + +// NewGetCommitmentsSavingsTimeseriesOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsSavingsTimeseriesOptionalParameters() *GetCommitmentsSavingsTimeseriesOptionalParameters { + this := GetCommitmentsSavingsTimeseriesOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsSavingsTimeseriesOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsSavingsTimeseriesOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// GetCommitmentsSavingsTimeseries Get commitments savings (timeseries). +// Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. +func (a *CloudCostManagementApi) GetCommitmentsSavingsTimeseries(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsSavingsTimeseriesOptionalParameters) (CommitmentsSavingsTimeseriesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue ArbitraryRuleResponse + localVarReturnValue CommitmentsSavingsTimeseriesResponse + optionalParams GetCommitmentsSavingsTimeseriesOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCustomAllocationRule") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsSavingsTimeseriesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsSavingsTimeseries" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsSavingsTimeseries") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/arbitrary_rule/{rule_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/savings/timeseries" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1476,6 +1724,15 @@ func (a *CloudCostManagementApi) GetCustomAllocationRule(ctx _context.Context, r ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1499,26 +1756,76 @@ func (a *CloudCostManagementApi) GetCustomAllocationRule(ctx _context.Context, r return localVarReturnValue, localVarHTTPResponse, nil } -// GetCustomCostsFile Get Custom Costs file. -// Fetch the specified Custom Costs file. -func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId string) (CustomCostsFileGetResponse, *_nethttp.Response, error) { +// GetCommitmentsUtilizationScalarOptionalParameters holds optional parameters for GetCommitmentsUtilizationScalar. +type GetCommitmentsUtilizationScalarOptionalParameters struct { + FilterBy *string + CommitmentType *CommitmentsCommitmentType +} + +// NewGetCommitmentsUtilizationScalarOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsUtilizationScalarOptionalParameters() *GetCommitmentsUtilizationScalarOptionalParameters { + this := GetCommitmentsUtilizationScalarOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsUtilizationScalarOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsUtilizationScalarOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// WithCommitmentType sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsUtilizationScalarOptionalParameters) WithCommitmentType(commitmentType CommitmentsCommitmentType) *GetCommitmentsUtilizationScalarOptionalParameters { + r.CommitmentType = &commitmentType + return r +} + +// GetCommitmentsUtilizationScalar Get commitments utilization (scalar). +// Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. +func (a *CloudCostManagementApi) GetCommitmentsUtilizationScalar(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsUtilizationScalarOptionalParameters) (CommitmentsUtilizationScalarResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CustomCostsFileGetResponse + localVarReturnValue CommitmentsUtilizationScalarResponse + optionalParams GetCommitmentsUtilizationScalarOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCustomCostsFile") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsUtilizationScalarOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsUtilizationScalar" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsUtilizationScalar") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/custom_costs/{file_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{file_id}", _neturl.PathEscape(datadog.ParameterToString(fileId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/utilization/scalar" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } + if optionalParams.CommitmentType != nil { + localVarQueryParams.Add("commitmentType", datadog.ParameterToString(*optionalParams.CommitmentType, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1554,7 +1861,16 @@ func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1577,26 +1893,76 @@ func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId return localVarReturnValue, localVarHTTPResponse, nil } -// GetTagPipelinesRuleset Get a tag pipeline ruleset. -// Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID -func (a *CloudCostManagementApi) GetTagPipelinesRuleset(ctx _context.Context, rulesetId string) (RulesetResp, *_nethttp.Response, error) { +// GetCommitmentsUtilizationTimeseriesOptionalParameters holds optional parameters for GetCommitmentsUtilizationTimeseries. +type GetCommitmentsUtilizationTimeseriesOptionalParameters struct { + FilterBy *string + CommitmentType *CommitmentsCommitmentType +} + +// NewGetCommitmentsUtilizationTimeseriesOptionalParameters creates an empty struct for parameters. +func NewGetCommitmentsUtilizationTimeseriesOptionalParameters() *GetCommitmentsUtilizationTimeseriesOptionalParameters { + this := GetCommitmentsUtilizationTimeseriesOptionalParameters{} + return &this +} + +// WithFilterBy sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsUtilizationTimeseriesOptionalParameters) WithFilterBy(filterBy string) *GetCommitmentsUtilizationTimeseriesOptionalParameters { + r.FilterBy = &filterBy + return r +} + +// WithCommitmentType sets the corresponding parameter name and returns the struct. +func (r *GetCommitmentsUtilizationTimeseriesOptionalParameters) WithCommitmentType(commitmentType CommitmentsCommitmentType) *GetCommitmentsUtilizationTimeseriesOptionalParameters { + r.CommitmentType = &commitmentType + return r +} + +// GetCommitmentsUtilizationTimeseries Get commitments utilization (timeseries). +// Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. +func (a *CloudCostManagementApi) GetCommitmentsUtilizationTimeseries(ctx _context.Context, provider CommitmentsProvider, product string, start int64, end int64, o ...GetCommitmentsUtilizationTimeseriesOptionalParameters) (CommitmentsUtilizationTimeseriesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue RulesetResp + localVarReturnValue CommitmentsUtilizationTimeseriesResponse + optionalParams GetCommitmentsUtilizationTimeseriesOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetTagPipelinesRuleset") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCommitmentsUtilizationTimeseriesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCommitmentsUtilizationTimeseries" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCommitmentsUtilizationTimeseries") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/tags/enrichment/{ruleset_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_id}", _neturl.PathEscape(datadog.ParameterToString(rulesetId, ""))) + localVarPath := localBasePath + "/api/v2/cost/commitments/utilization/timeseries" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("provider", datadog.ParameterToString(provider, "")) + localVarQueryParams.Add("product", datadog.ParameterToString(product, "")) + localVarQueryParams.Add("start", datadog.ParameterToString(start, "")) + localVarQueryParams.Add("end", datadog.ParameterToString(end, "")) + if optionalParams.FilterBy != nil { + localVarQueryParams.Add("filterBy", datadog.ParameterToString(*optionalParams.FilterBy, "")) + } + if optionalParams.CommitmentType != nil { + localVarQueryParams.Add("commitmentType", datadog.ParameterToString(*optionalParams.CommitmentType, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -1632,6 +1998,15 @@ func (a *CloudCostManagementApi) GetTagPipelinesRuleset(ctx _context.Context, ru ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1655,21 +2030,22 @@ func (a *CloudCostManagementApi) GetTagPipelinesRuleset(ctx _context.Context, ru return localVarReturnValue, localVarHTTPResponse, nil } -// ListBudgets List budgets. -// List budgets. -func (a *CloudCostManagementApi) ListBudgets(ctx _context.Context) (BudgetArray, *_nethttp.Response, error) { +// GetCostAWSCURConfig Get cost AWS CUR config. +// Get a specific AWS CUR config. +func (a *CloudCostManagementApi) GetCostAWSCURConfig(ctx _context.Context, cloudAccountId int64) (AwsCurConfigResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue BudgetArray + localVarReturnValue AwsCurConfigResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListBudgets") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAWSCURConfig") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/budgets" + localVarPath := localBasePath + "/api/v2/cost/aws_cur_config/{cloud_account_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1732,21 +2108,31 @@ func (a *CloudCostManagementApi) ListBudgets(ctx _context.Context) (BudgetArray, return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostAWSCURConfigs List Cloud Cost Management AWS CUR configs. -// List the AWS CUR configs. -func (a *CloudCostManagementApi) ListCostAWSCURConfigs(ctx _context.Context) (AwsCURConfigsResponse, *_nethttp.Response, error) { +// GetCostAnomaly Get cost anomaly. +// Get a detected Cloud Cost Management anomaly by UUID. +func (a *CloudCostManagementApi) GetCostAnomaly(ctx _context.Context, anomalyId string) (CostAnomalyResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue AwsCURConfigsResponse + localVarReturnValue CostAnomalyResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostAWSCURConfigs") + operationId := "v2.GetCostAnomaly" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAnomaly") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/aws_cur_config" + localVarPath := localBasePath + "/api/v2/cost/anomalies/{anomaly_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{anomaly_id}", _neturl.PathEscape(datadog.ParameterToString(anomalyId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1786,7 +2172,7 @@ func (a *CloudCostManagementApi) ListCostAWSCURConfigs(ctx _context.Context) (Aw ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1809,170 +2195,26 @@ func (a *CloudCostManagementApi) ListCostAWSCURConfigs(ctx _context.Context) (Aw return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostAnomaliesOptionalParameters holds optional parameters for ListCostAnomalies. -type ListCostAnomaliesOptionalParameters struct { - Start *int64 - End *int64 - Filter *string - MinAnomalousThreshold *string - MinCostThreshold *string - DismissalCause *string - OrderBy *string - Order *string - Limit *int32 - Offset *int32 - ProviderIds *[]string -} - -// NewListCostAnomaliesOptionalParameters creates an empty struct for parameters. -func NewListCostAnomaliesOptionalParameters() *ListCostAnomaliesOptionalParameters { - this := ListCostAnomaliesOptionalParameters{} - return &this -} - -// WithStart sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithStart(start int64) *ListCostAnomaliesOptionalParameters { - r.Start = &start - return r -} - -// WithEnd sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithEnd(end int64) *ListCostAnomaliesOptionalParameters { - r.End = &end - return r -} - -// WithFilter sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithFilter(filter string) *ListCostAnomaliesOptionalParameters { - r.Filter = &filter - return r -} - -// WithMinAnomalousThreshold sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithMinAnomalousThreshold(minAnomalousThreshold string) *ListCostAnomaliesOptionalParameters { - r.MinAnomalousThreshold = &minAnomalousThreshold - return r -} - -// WithMinCostThreshold sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithMinCostThreshold(minCostThreshold string) *ListCostAnomaliesOptionalParameters { - r.MinCostThreshold = &minCostThreshold - return r -} - -// WithDismissalCause sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithDismissalCause(dismissalCause string) *ListCostAnomaliesOptionalParameters { - r.DismissalCause = &dismissalCause - return r -} - -// WithOrderBy sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithOrderBy(orderBy string) *ListCostAnomaliesOptionalParameters { - r.OrderBy = &orderBy - return r -} - -// WithOrder sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithOrder(order string) *ListCostAnomaliesOptionalParameters { - r.Order = &order - return r -} - -// WithLimit sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithLimit(limit int32) *ListCostAnomaliesOptionalParameters { - r.Limit = &limit - return r -} - -// WithOffset sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithOffset(offset int32) *ListCostAnomaliesOptionalParameters { - r.Offset = &offset - return r -} - -// WithProviderIds sets the corresponding parameter name and returns the struct. -func (r *ListCostAnomaliesOptionalParameters) WithProviderIds(providerIds []string) *ListCostAnomaliesOptionalParameters { - r.ProviderIds = &providerIds - return r -} - -// ListCostAnomalies List cost anomalies. -// List detected Cloud Cost Management anomalies for the organization. -func (a *CloudCostManagementApi) ListCostAnomalies(ctx _context.Context, o ...ListCostAnomaliesOptionalParameters) (CostAnomaliesResponse, *_nethttp.Response, error) { +// GetCostAzureUCConfig Get cost Azure UC config. +// Get a specific Azure config. +func (a *CloudCostManagementApi) GetCostAzureUCConfig(ctx _context.Context, cloudAccountId int64) (UCConfigPair, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CostAnomaliesResponse - optionalParams ListCostAnomaliesOptionalParameters + localVarReturnValue UCConfigPair ) - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostAnomaliesOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - operationId := "v2.ListCostAnomalies" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostAnomalies") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostAzureUCConfig") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/anomalies" + localVarPath := localBasePath + "/api/v2/cost/azure_uc_config/{cloud_account_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.Start != nil { - localVarQueryParams.Add("start", datadog.ParameterToString(*optionalParams.Start, "")) - } - if optionalParams.End != nil { - localVarQueryParams.Add("end", datadog.ParameterToString(*optionalParams.End, "")) - } - if optionalParams.Filter != nil { - localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) - } - if optionalParams.MinAnomalousThreshold != nil { - localVarQueryParams.Add("min_anomalous_threshold", datadog.ParameterToString(*optionalParams.MinAnomalousThreshold, "")) - } - if optionalParams.MinCostThreshold != nil { - localVarQueryParams.Add("min_cost_threshold", datadog.ParameterToString(*optionalParams.MinCostThreshold, "")) - } - if optionalParams.DismissalCause != nil { - localVarQueryParams.Add("dismissal_cause", datadog.ParameterToString(*optionalParams.DismissalCause, "")) - } - if optionalParams.OrderBy != nil { - localVarQueryParams.Add("order_by", datadog.ParameterToString(*optionalParams.OrderBy, "")) - } - if optionalParams.Order != nil { - localVarQueryParams.Add("order", datadog.ParameterToString(*optionalParams.Order, "")) - } - if optionalParams.Limit != nil { - localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) - } - if optionalParams.Offset != nil { - localVarQueryParams.Add("offset", datadog.ParameterToString(*optionalParams.Offset, "")) - } - if optionalParams.ProviderIds != nil { - t := *optionalParams.ProviderIds - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("provider_ids", datadog.ParameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("provider_ids", datadog.ParameterToString(t, "multi")) - } - } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -2008,7 +2250,7 @@ func (a *CloudCostManagementApi) ListCostAnomalies(ctx _context.Context, o ...Li ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2031,13 +2273,932 @@ func (a *CloudCostManagementApi) ListCostAnomalies(ctx _context.Context, o ...Li return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostAzureUCConfigs List Cloud Cost Management Azure configs. -// List the Azure configs. -func (a *CloudCostManagementApi) ListCostAzureUCConfigs(ctx _context.Context) (AzureUCConfigsResponse, *_nethttp.Response, error) { +// GetCostGCPUsageCostConfig Get Google Cloud Usage Cost config. +// Get a specific Google Cloud Usage Cost config. +func (a *CloudCostManagementApi) GetCostGCPUsageCostConfig(ctx _context.Context, cloudAccountId int64) (GcpUcConfigResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue AzureUCConfigsResponse + localVarReturnValue GcpUcConfigResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostGCPUsageCostConfig") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{cloud_account_id}", _neturl.PathEscape(datadog.ParameterToString(cloudAccountId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCostTagKeyOptionalParameters holds optional parameters for GetCostTagKey. +type GetCostTagKeyOptionalParameters struct { + FilterMetric *string + PageSize *int32 +} + +// NewGetCostTagKeyOptionalParameters creates an empty struct for parameters. +func NewGetCostTagKeyOptionalParameters() *GetCostTagKeyOptionalParameters { + this := GetCostTagKeyOptionalParameters{} + return &this +} + +// WithFilterMetric sets the corresponding parameter name and returns the struct. +func (r *GetCostTagKeyOptionalParameters) WithFilterMetric(filterMetric string) *GetCostTagKeyOptionalParameters { + r.FilterMetric = &filterMetric + return r +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *GetCostTagKeyOptionalParameters) WithPageSize(pageSize int32) *GetCostTagKeyOptionalParameters { + r.PageSize = &pageSize + return r +} + +// GetCostTagKey Get a Cloud Cost Management tag key. +// Get details for a specific Cloud Cost Management tag key, including example tag values and description. +func (a *CloudCostManagementApi) GetCostTagKey(ctx _context.Context, tagKey string, o ...GetCostTagKeyOptionalParameters) (CostTagKeyResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CostTagKeyResponse + optionalParams GetCostTagKeyOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCostTagKeyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostTagKey") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/tag_keys/{tag_key}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{tag_key}", _neturl.PathEscape(datadog.ParameterToString(tagKey, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterMetric != nil { + localVarQueryParams.Add("filter[metric]", datadog.ParameterToString(*optionalParams.FilterMetric, "")) + } + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCostTagMetadataCurrencyOptionalParameters holds optional parameters for GetCostTagMetadataCurrency. +type GetCostTagMetadataCurrencyOptionalParameters struct { + FilterProvider *string +} + +// NewGetCostTagMetadataCurrencyOptionalParameters creates an empty struct for parameters. +func NewGetCostTagMetadataCurrencyOptionalParameters() *GetCostTagMetadataCurrencyOptionalParameters { + this := GetCostTagMetadataCurrencyOptionalParameters{} + return &this +} + +// WithFilterProvider sets the corresponding parameter name and returns the struct. +func (r *GetCostTagMetadataCurrencyOptionalParameters) WithFilterProvider(filterProvider string) *GetCostTagMetadataCurrencyOptionalParameters { + r.FilterProvider = &filterProvider + return r +} + +// GetCostTagMetadataCurrency Get the Cloud Cost Management billing currency. +// Get the dominant billing currency observed in Cloud Cost Management data for the requested period. The response wraps the currency in a JSON:API `data` array containing at most one entry; the array is empty when no currency data is available. +func (a *CloudCostManagementApi) GetCostTagMetadataCurrency(ctx _context.Context, filterMonth string, o ...GetCostTagMetadataCurrencyOptionalParameters) (CostCurrencyResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CostCurrencyResponse + optionalParams GetCostTagMetadataCurrencyOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetCostTagMetadataCurrencyOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetCostTagMetadataCurrency" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCostTagMetadataCurrency") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/tag_metadata/currency" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("filter[month]", datadog.ParameterToString(filterMonth, "")) + if optionalParams.FilterProvider != nil { + localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(*optionalParams.FilterProvider, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCustomAllocationRule Get custom allocation rule. +// Get a specific custom allocation rule - Retrieve a specific custom allocation rule by its ID +func (a *CloudCostManagementApi) GetCustomAllocationRule(ctx _context.Context, ruleId int64) (ArbitraryRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ArbitraryRuleResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCustomAllocationRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/arbitrary_rule/{rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCustomCostsFile Get Custom Costs file. +// Fetch the specified Custom Costs file. +func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId string) (CustomCostsFileGetResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CustomCostsFileGetResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetCustomCostsFile") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/custom_costs/{file_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{file_id}", _neturl.PathEscape(datadog.ParameterToString(fileId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetTagPipelinesRuleset Get a tag pipeline ruleset. +// Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID +func (a *CloudCostManagementApi) GetTagPipelinesRuleset(ctx _context.Context, rulesetId string) (RulesetResp, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RulesetResp + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.GetTagPipelinesRuleset") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/tags/enrichment/{ruleset_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_id}", _neturl.PathEscape(datadog.ParameterToString(rulesetId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListBudgets List budgets. +// List budgets. +func (a *CloudCostManagementApi) ListBudgets(ctx _context.Context) (BudgetArray, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue BudgetArray + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListBudgets") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/budgets" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostAWSCURConfigs List Cloud Cost Management AWS CUR configs. +// List the AWS CUR configs. +func (a *CloudCostManagementApi) ListCostAWSCURConfigs(ctx _context.Context) (AwsCURConfigsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AwsCURConfigsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostAWSCURConfigs") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/aws_cur_config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostAnomaliesOptionalParameters holds optional parameters for ListCostAnomalies. +type ListCostAnomaliesOptionalParameters struct { + Start *int64 + End *int64 + Filter *string + MinAnomalousThreshold *string + MinCostThreshold *string + DismissalCause *string + OrderBy *string + Order *string + Limit *int32 + Offset *int32 + ProviderIds *[]string +} + +// NewListCostAnomaliesOptionalParameters creates an empty struct for parameters. +func NewListCostAnomaliesOptionalParameters() *ListCostAnomaliesOptionalParameters { + this := ListCostAnomaliesOptionalParameters{} + return &this +} + +// WithStart sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithStart(start int64) *ListCostAnomaliesOptionalParameters { + r.Start = &start + return r +} + +// WithEnd sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithEnd(end int64) *ListCostAnomaliesOptionalParameters { + r.End = &end + return r +} + +// WithFilter sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithFilter(filter string) *ListCostAnomaliesOptionalParameters { + r.Filter = &filter + return r +} + +// WithMinAnomalousThreshold sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithMinAnomalousThreshold(minAnomalousThreshold string) *ListCostAnomaliesOptionalParameters { + r.MinAnomalousThreshold = &minAnomalousThreshold + return r +} + +// WithMinCostThreshold sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithMinCostThreshold(minCostThreshold string) *ListCostAnomaliesOptionalParameters { + r.MinCostThreshold = &minCostThreshold + return r +} + +// WithDismissalCause sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithDismissalCause(dismissalCause string) *ListCostAnomaliesOptionalParameters { + r.DismissalCause = &dismissalCause + return r +} + +// WithOrderBy sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithOrderBy(orderBy string) *ListCostAnomaliesOptionalParameters { + r.OrderBy = &orderBy + return r +} + +// WithOrder sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithOrder(order string) *ListCostAnomaliesOptionalParameters { + r.Order = &order + return r +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithLimit(limit int32) *ListCostAnomaliesOptionalParameters { + r.Limit = &limit + return r +} + +// WithOffset sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithOffset(offset int32) *ListCostAnomaliesOptionalParameters { + r.Offset = &offset + return r +} + +// WithProviderIds sets the corresponding parameter name and returns the struct. +func (r *ListCostAnomaliesOptionalParameters) WithProviderIds(providerIds []string) *ListCostAnomaliesOptionalParameters { + r.ProviderIds = &providerIds + return r +} + +// ListCostAnomalies List cost anomalies. +// List detected Cloud Cost Management anomalies for the organization. +func (a *CloudCostManagementApi) ListCostAnomalies(ctx _context.Context, o ...ListCostAnomaliesOptionalParameters) (CostAnomaliesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CostAnomaliesResponse + optionalParams ListCostAnomaliesOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostAnomaliesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCostAnomalies" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostAnomalies") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/anomalies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Start != nil { + localVarQueryParams.Add("start", datadog.ParameterToString(*optionalParams.Start, "")) + } + if optionalParams.End != nil { + localVarQueryParams.Add("end", datadog.ParameterToString(*optionalParams.End, "")) + } + if optionalParams.Filter != nil { + localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) + } + if optionalParams.MinAnomalousThreshold != nil { + localVarQueryParams.Add("min_anomalous_threshold", datadog.ParameterToString(*optionalParams.MinAnomalousThreshold, "")) + } + if optionalParams.MinCostThreshold != nil { + localVarQueryParams.Add("min_cost_threshold", datadog.ParameterToString(*optionalParams.MinCostThreshold, "")) + } + if optionalParams.DismissalCause != nil { + localVarQueryParams.Add("dismissal_cause", datadog.ParameterToString(*optionalParams.DismissalCause, "")) + } + if optionalParams.OrderBy != nil { + localVarQueryParams.Add("order_by", datadog.ParameterToString(*optionalParams.OrderBy, "")) + } + if optionalParams.Order != nil { + localVarQueryParams.Add("order", datadog.ParameterToString(*optionalParams.Order, "")) + } + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.Offset != nil { + localVarQueryParams.Add("offset", datadog.ParameterToString(*optionalParams.Offset, "")) + } + if optionalParams.ProviderIds != nil { + t := *optionalParams.ProviderIds + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("provider_ids", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("provider_ids", datadog.ParameterToString(t, "multi")) + } + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostAzureUCConfigs List Cloud Cost Management Azure configs. +// List the Azure configs. +func (a *CloudCostManagementApi) ListCostAzureUCConfigs(ctx _context.Context) (AzureUCConfigsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue AzureUCConfigsResponse ) localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostAzureUCConfigs") @@ -2045,7 +3206,161 @@ func (a *CloudCostManagementApi) ListCostAzureUCConfigs(ctx _context.Context) (A return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/azure_uc_config" + localVarPath := localBasePath + "/api/v2/cost/azure_uc_config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostGCPUsageCostConfigs List Google Cloud Usage Cost configs. +// List the Google Cloud Usage Cost configs. +func (a *CloudCostManagementApi) ListCostGCPUsageCostConfigs(ctx _context.Context) (GCPUsageCostConfigsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue GCPUsageCostConfigsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostGCPUsageCostConfigs") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/gcp_uc_config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostOCIConfigs List Cloud Cost Management OCI configs. +// List the OCI configs. +func (a *CloudCostManagementApi) ListCostOCIConfigs(ctx _context.Context) (OCIConfigsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OCIConfigsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostOCIConfigs") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/oci_config" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2108,25 +3423,291 @@ func (a *CloudCostManagementApi) ListCostAzureUCConfigs(ctx _context.Context) (A return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostGCPUsageCostConfigs List Google Cloud Usage Cost configs. -// List the Google Cloud Usage Cost configs. -func (a *CloudCostManagementApi) ListCostGCPUsageCostConfigs(ctx _context.Context) (GCPUsageCostConfigsResponse, *_nethttp.Response, error) { +// ListCostTagDescriptionsOptionalParameters holds optional parameters for ListCostTagDescriptions. +type ListCostTagDescriptionsOptionalParameters struct { + FilterCloud *string +} + +// NewListCostTagDescriptionsOptionalParameters creates an empty struct for parameters. +func NewListCostTagDescriptionsOptionalParameters() *ListCostTagDescriptionsOptionalParameters { + this := ListCostTagDescriptionsOptionalParameters{} + return &this +} + +// WithFilterCloud sets the corresponding parameter name and returns the struct. +func (r *ListCostTagDescriptionsOptionalParameters) WithFilterCloud(filterCloud string) *ListCostTagDescriptionsOptionalParameters { + r.FilterCloud = &filterCloud + return r +} + +// ListCostTagDescriptions List Cloud Cost Management tag descriptions. +// List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. +func (a *CloudCostManagementApi) ListCostTagDescriptions(ctx _context.Context, o ...ListCostTagDescriptionsOptionalParameters) (CostTagDescriptionsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue GCPUsageCostConfigsResponse + localVarReturnValue CostTagDescriptionsResponse + optionalParams ListCostTagDescriptionsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagDescriptionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagDescriptions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/tag_descriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterCloud != nil { + localVarQueryParams.Add("filter[cloud]", datadog.ParameterToString(*optionalParams.FilterCloud, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostTagKeySourcesOptionalParameters holds optional parameters for ListCostTagKeySources. +type ListCostTagKeySourcesOptionalParameters struct { + FilterProvider *string +} + +// NewListCostTagKeySourcesOptionalParameters creates an empty struct for parameters. +func NewListCostTagKeySourcesOptionalParameters() *ListCostTagKeySourcesOptionalParameters { + this := ListCostTagKeySourcesOptionalParameters{} + return &this +} + +// WithFilterProvider sets the corresponding parameter name and returns the struct. +func (r *ListCostTagKeySourcesOptionalParameters) WithFilterProvider(filterProvider string) *ListCostTagKeySourcesOptionalParameters { + r.FilterProvider = &filterProvider + return r +} + +// ListCostTagKeySources List Cloud Cost Management tag sources. +// List Cloud Cost Management tag keys observed for the requested period, along with the origin sources that produced them (for example, `aws-user-defined`, `custom`). +func (a *CloudCostManagementApi) ListCostTagKeySources(ctx _context.Context, filterMonth string, o ...ListCostTagKeySourcesOptionalParameters) (CostTagKeySourcesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CostTagKeySourcesResponse + optionalParams ListCostTagKeySourcesOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagKeySourcesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCostTagKeySources" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagKeySources") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/tag_metadata/tag_sources" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("filter[month]", datadog.ParameterToString(filterMonth, "")) + if optionalParams.FilterProvider != nil { + localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(*optionalParams.FilterProvider, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCostTagKeysOptionalParameters holds optional parameters for ListCostTagKeys. +type ListCostTagKeysOptionalParameters struct { + FilterMetric *string + FilterTags *[]string +} + +// NewListCostTagKeysOptionalParameters creates an empty struct for parameters. +func NewListCostTagKeysOptionalParameters() *ListCostTagKeysOptionalParameters { + this := ListCostTagKeysOptionalParameters{} + return &this +} + +// WithFilterMetric sets the corresponding parameter name and returns the struct. +func (r *ListCostTagKeysOptionalParameters) WithFilterMetric(filterMetric string) *ListCostTagKeysOptionalParameters { + r.FilterMetric = &filterMetric + return r +} + +// WithFilterTags sets the corresponding parameter name and returns the struct. +func (r *ListCostTagKeysOptionalParameters) WithFilterTags(filterTags []string) *ListCostTagKeysOptionalParameters { + r.FilterTags = &filterTags + return r +} + +// ListCostTagKeys List Cloud Cost Management tag keys. +// List Cloud Cost Management tag keys. +func (a *CloudCostManagementApi) ListCostTagKeys(ctx _context.Context, o ...ListCostTagKeysOptionalParameters) (CostTagKeysResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CostTagKeysResponse + optionalParams ListCostTagKeysOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostGCPUsageCostConfigs") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagKeysOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagKeys") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/gcp_uc_config" + localVarPath := localBasePath + "/api/v2/cost/tag_keys" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.FilterMetric != nil { + localVarQueryParams.Add("filter[metric]", datadog.ParameterToString(*optionalParams.FilterMetric, "")) + } + if optionalParams.FilterTags != nil { + t := *optionalParams.FilterTags + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(t, "multi")) + } + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -2162,7 +3743,7 @@ func (a *CloudCostManagementApi) ListCostGCPUsageCostConfigs(ctx _context.Contex ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2185,25 +3766,93 @@ func (a *CloudCostManagementApi) ListCostGCPUsageCostConfigs(ctx _context.Contex return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostOCIConfigs List Cloud Cost Management OCI configs. -// List the OCI configs. -func (a *CloudCostManagementApi) ListCostOCIConfigs(ctx _context.Context) (OCIConfigsResponse, *_nethttp.Response, error) { +// ListCostTagMetadataOptionalParameters holds optional parameters for ListCostTagMetadata. +type ListCostTagMetadataOptionalParameters struct { + FilterProvider *string + FilterMetric *string + FilterTagKey *string + FilterDaily *CostTagMetadataDailyFilter +} + +// NewListCostTagMetadataOptionalParameters creates an empty struct for parameters. +func NewListCostTagMetadataOptionalParameters() *ListCostTagMetadataOptionalParameters { + this := ListCostTagMetadataOptionalParameters{} + return &this +} + +// WithFilterProvider sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataOptionalParameters) WithFilterProvider(filterProvider string) *ListCostTagMetadataOptionalParameters { + r.FilterProvider = &filterProvider + return r +} + +// WithFilterMetric sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataOptionalParameters) WithFilterMetric(filterMetric string) *ListCostTagMetadataOptionalParameters { + r.FilterMetric = &filterMetric + return r +} + +// WithFilterTagKey sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataOptionalParameters) WithFilterTagKey(filterTagKey string) *ListCostTagMetadataOptionalParameters { + r.FilterTagKey = &filterTagKey + return r +} + +// WithFilterDaily sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataOptionalParameters) WithFilterDaily(filterDaily CostTagMetadataDailyFilter) *ListCostTagMetadataOptionalParameters { + r.FilterDaily = &filterDaily + return r +} + +// ListCostTagMetadata List Cloud Cost Management tag key metadata. +// List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, and a sample of top tag values per cloud account. Use `filter[daily]=true` to return daily rows instead of the default monthly roll-up. +func (a *CloudCostManagementApi) ListCostTagMetadata(ctx _context.Context, filterMonth string, o ...ListCostTagMetadataOptionalParameters) (CostTagKeyMetadataResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue OCIConfigsResponse + localVarReturnValue CostTagKeyMetadataResponse + optionalParams ListCostTagMetadataOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostOCIConfigs") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagMetadataOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCostTagMetadata" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagMetadata") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/oci_config" + localVarPath := localBasePath + "/api/v2/cost/tag_metadata" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("filter[month]", datadog.ParameterToString(filterMonth, "")) + if optionalParams.FilterProvider != nil { + localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(*optionalParams.FilterProvider, "")) + } + if optionalParams.FilterMetric != nil { + localVarQueryParams.Add("filter[metric]", datadog.ParameterToString(*optionalParams.FilterMetric, "")) + } + if optionalParams.FilterTagKey != nil { + localVarQueryParams.Add("filter[tag_key]", datadog.ParameterToString(*optionalParams.FilterTagKey, "")) + } + if optionalParams.FilterDaily != nil { + localVarQueryParams.Add("filter[daily]", datadog.ParameterToString(*optionalParams.FilterDaily, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -2239,7 +3888,7 @@ func (a *CloudCostManagementApi) ListCostOCIConfigs(ctx _context.Context) (OCICo ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2262,52 +3911,62 @@ func (a *CloudCostManagementApi) ListCostOCIConfigs(ctx _context.Context) (OCICo return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostTagDescriptionsOptionalParameters holds optional parameters for ListCostTagDescriptions. -type ListCostTagDescriptionsOptionalParameters struct { - FilterCloud *string +// ListCostTagMetadataMetricsOptionalParameters holds optional parameters for ListCostTagMetadataMetrics. +type ListCostTagMetadataMetricsOptionalParameters struct { + FilterProvider *string } -// NewListCostTagDescriptionsOptionalParameters creates an empty struct for parameters. -func NewListCostTagDescriptionsOptionalParameters() *ListCostTagDescriptionsOptionalParameters { - this := ListCostTagDescriptionsOptionalParameters{} +// NewListCostTagMetadataMetricsOptionalParameters creates an empty struct for parameters. +func NewListCostTagMetadataMetricsOptionalParameters() *ListCostTagMetadataMetricsOptionalParameters { + this := ListCostTagMetadataMetricsOptionalParameters{} return &this } -// WithFilterCloud sets the corresponding parameter name and returns the struct. -func (r *ListCostTagDescriptionsOptionalParameters) WithFilterCloud(filterCloud string) *ListCostTagDescriptionsOptionalParameters { - r.FilterCloud = &filterCloud +// WithFilterProvider sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataMetricsOptionalParameters) WithFilterProvider(filterProvider string) *ListCostTagMetadataMetricsOptionalParameters { + r.FilterProvider = &filterProvider return r } -// ListCostTagDescriptions List Cloud Cost Management tag descriptions. -// List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. -func (a *CloudCostManagementApi) ListCostTagDescriptions(ctx _context.Context, o ...ListCostTagDescriptionsOptionalParameters) (CostTagDescriptionsResponse, *_nethttp.Response, error) { +// ListCostTagMetadataMetrics List available Cloud Cost Management metrics. +// List Cloud Cost Management metrics that have data for the requested period. +func (a *CloudCostManagementApi) ListCostTagMetadataMetrics(ctx _context.Context, filterMonth string, o ...ListCostTagMetadataMetricsOptionalParameters) (CostMetricsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CostTagDescriptionsResponse - optionalParams ListCostTagDescriptionsOptionalParameters + localVarReturnValue CostMetricsResponse + optionalParams ListCostTagMetadataMetricsOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagDescriptionsOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagMetadataMetricsOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagDescriptions") + operationId := "v2.ListCostTagMetadataMetrics" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagMetadataMetrics") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/tag_descriptions" + localVarPath := localBasePath + "/api/v2/cost/tag_metadata/metrics" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.FilterCloud != nil { - localVarQueryParams.Add("filter[cloud]", datadog.ParameterToString(*optionalParams.FilterCloud, "")) + localVarQueryParams.Add("filter[month]", datadog.ParameterToString(filterMonth, "")) + if optionalParams.FilterProvider != nil { + localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(*optionalParams.FilterProvider, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -2344,7 +4003,7 @@ func (a *CloudCostManagementApi) ListCostTagDescriptions(ctx _context.Context, o ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2367,70 +4026,62 @@ func (a *CloudCostManagementApi) ListCostTagDescriptions(ctx _context.Context, o return localVarReturnValue, localVarHTTPResponse, nil } -// ListCostTagKeysOptionalParameters holds optional parameters for ListCostTagKeys. -type ListCostTagKeysOptionalParameters struct { - FilterMetric *string - FilterTags *[]string +// ListCostTagMetadataOrchestratorsOptionalParameters holds optional parameters for ListCostTagMetadataOrchestrators. +type ListCostTagMetadataOrchestratorsOptionalParameters struct { + FilterProvider *string } -// NewListCostTagKeysOptionalParameters creates an empty struct for parameters. -func NewListCostTagKeysOptionalParameters() *ListCostTagKeysOptionalParameters { - this := ListCostTagKeysOptionalParameters{} +// NewListCostTagMetadataOrchestratorsOptionalParameters creates an empty struct for parameters. +func NewListCostTagMetadataOrchestratorsOptionalParameters() *ListCostTagMetadataOrchestratorsOptionalParameters { + this := ListCostTagMetadataOrchestratorsOptionalParameters{} return &this } -// WithFilterMetric sets the corresponding parameter name and returns the struct. -func (r *ListCostTagKeysOptionalParameters) WithFilterMetric(filterMetric string) *ListCostTagKeysOptionalParameters { - r.FilterMetric = &filterMetric - return r -} - -// WithFilterTags sets the corresponding parameter name and returns the struct. -func (r *ListCostTagKeysOptionalParameters) WithFilterTags(filterTags []string) *ListCostTagKeysOptionalParameters { - r.FilterTags = &filterTags +// WithFilterProvider sets the corresponding parameter name and returns the struct. +func (r *ListCostTagMetadataOrchestratorsOptionalParameters) WithFilterProvider(filterProvider string) *ListCostTagMetadataOrchestratorsOptionalParameters { + r.FilterProvider = &filterProvider return r } -// ListCostTagKeys List Cloud Cost Management tag keys. -// List Cloud Cost Management tag keys. -func (a *CloudCostManagementApi) ListCostTagKeys(ctx _context.Context, o ...ListCostTagKeysOptionalParameters) (CostTagKeysResponse, *_nethttp.Response, error) { +// ListCostTagMetadataOrchestrators List Cloud Cost Management orchestrators. +// List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. +func (a *CloudCostManagementApi) ListCostTagMetadataOrchestrators(ctx _context.Context, filterMonth string, o ...ListCostTagMetadataOrchestratorsOptionalParameters) (CostOrchestratorsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue CostTagKeysResponse - optionalParams ListCostTagKeysOptionalParameters + localVarReturnValue CostOrchestratorsResponse + optionalParams ListCostTagMetadataOrchestratorsOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagKeysOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagMetadataOrchestratorsOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagKeys") + operationId := "v2.ListCostTagMetadataOrchestrators" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagMetadataOrchestrators") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/cost/tag_keys" + localVarPath := localBasePath + "/api/v2/cost/tag_metadata/orchestrators" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.FilterMetric != nil { - localVarQueryParams.Add("filter[metric]", datadog.ParameterToString(*optionalParams.FilterMetric, "")) - } - if optionalParams.FilterTags != nil { - t := *optionalParams.FilterTags - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(t, "multi")) - } + localVarQueryParams.Add("filter[month]", datadog.ParameterToString(filterMonth, "")) + if optionalParams.FilterProvider != nil { + localVarQueryParams.Add("filter[provider]", datadog.ParameterToString(*optionalParams.FilterProvider, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -3268,6 +4919,133 @@ func (a *CloudCostManagementApi) ReorderTagPipelinesRulesets(ctx _context.Contex return localVarHTTPResponse, nil } +// SearchCostRecommendationsOptionalParameters holds optional parameters for SearchCostRecommendations. +type SearchCostRecommendationsOptionalParameters struct { + PageSize *string + PageToken *string +} + +// NewSearchCostRecommendationsOptionalParameters creates an empty struct for parameters. +func NewSearchCostRecommendationsOptionalParameters() *SearchCostRecommendationsOptionalParameters { + this := SearchCostRecommendationsOptionalParameters{} + return &this +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *SearchCostRecommendationsOptionalParameters) WithPageSize(pageSize string) *SearchCostRecommendationsOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageToken sets the corresponding parameter name and returns the struct. +func (r *SearchCostRecommendationsOptionalParameters) WithPageToken(pageToken string) *SearchCostRecommendationsOptionalParameters { + r.PageToken = &pageToken + return r +} + +// SearchCostRecommendations Search cost recommendations. +// List cost recommendations matching a filter, with pagination and sorting. +func (a *CloudCostManagementApi) SearchCostRecommendations(ctx _context.Context, body RecommendationsFilterRequest, o ...SearchCostRecommendationsOptionalParameters) (CostRecommendationArray, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CostRecommendationArray + optionalParams SearchCostRecommendationsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type SearchCostRecommendationsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.SearchCostRecommendations" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.SearchCostRecommendations") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cost/recommendations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageToken != nil { + localVarQueryParams.Add("page[token]", datadog.ParameterToString(*optionalParams.PageToken, "")) + } + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // UpdateCostAWSCURConfig Update Cloud Cost Management AWS CUR config. // Update the status (active/archived) and/or account filtering configuration of an AWS CUR config. func (a *CloudCostManagementApi) UpdateCostAWSCURConfig(ctx _context.Context, cloudAccountId int64, body AwsCURConfigPatchRequest) (AwsCURConfigsResponse, *_nethttp.Response, error) { diff --git a/api/datadogV2/api_compliance.go b/api/datadogV2/api_compliance.go new file mode 100644 index 00000000000..7de93910c83 --- /dev/null +++ b/api/datadogV2/api_compliance.go @@ -0,0 +1,200 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _fmt "fmt" + _log "log" + _nethttp "net/http" + _neturl "net/url" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComplianceApi service type +type ComplianceApi datadog.Service + +// GetRuleBasedViewOptionalParameters holds optional parameters for GetRuleBasedView. +type GetRuleBasedViewOptionalParameters struct { + Framework *string + Version *string + QueryFindingsWithoutFrameworkVersion *bool + IncludeRulesWithoutFindings *bool + IsCustom *bool + Query *string +} + +// NewGetRuleBasedViewOptionalParameters creates an empty struct for parameters. +func NewGetRuleBasedViewOptionalParameters() *GetRuleBasedViewOptionalParameters { + this := GetRuleBasedViewOptionalParameters{} + return &this +} + +// WithFramework sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithFramework(framework string) *GetRuleBasedViewOptionalParameters { + r.Framework = &framework + return r +} + +// WithVersion sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithVersion(version string) *GetRuleBasedViewOptionalParameters { + r.Version = &version + return r +} + +// WithQueryFindingsWithoutFrameworkVersion sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithQueryFindingsWithoutFrameworkVersion(queryFindingsWithoutFrameworkVersion bool) *GetRuleBasedViewOptionalParameters { + r.QueryFindingsWithoutFrameworkVersion = &queryFindingsWithoutFrameworkVersion + return r +} + +// WithIncludeRulesWithoutFindings sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithIncludeRulesWithoutFindings(includeRulesWithoutFindings bool) *GetRuleBasedViewOptionalParameters { + r.IncludeRulesWithoutFindings = &includeRulesWithoutFindings + return r +} + +// WithIsCustom sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithIsCustom(isCustom bool) *GetRuleBasedViewOptionalParameters { + r.IsCustom = &isCustom + return r +} + +// WithQuery sets the corresponding parameter name and returns the struct. +func (r *GetRuleBasedViewOptionalParameters) WithQuery(query string) *GetRuleBasedViewOptionalParameters { + r.Query = &query + return r +} + +// GetRuleBasedView Get the rule-based view of compliance findings. +// Get an aggregated view of compliance rules with their pass, fail, and muted finding counts. +// Supports filtering by compliance framework, framework version, and additional query filters. +func (a *ComplianceApi) GetRuleBasedView(ctx _context.Context, to int64, o ...GetRuleBasedViewOptionalParameters) (RuleBasedViewResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue RuleBasedViewResponse + optionalParams GetRuleBasedViewOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetRuleBasedViewOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetRuleBasedView" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ComplianceApi.GetRuleBasedView") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/compliance_findings/rule_based_view" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("to", datadog.ParameterToString(to, "")) + if optionalParams.Framework != nil { + localVarQueryParams.Add("framework", datadog.ParameterToString(*optionalParams.Framework, "")) + } + if optionalParams.Version != nil { + localVarQueryParams.Add("version", datadog.ParameterToString(*optionalParams.Version, "")) + } + if optionalParams.QueryFindingsWithoutFrameworkVersion != nil { + localVarQueryParams.Add("query_findings_without_framework_version", datadog.ParameterToString(*optionalParams.QueryFindingsWithoutFrameworkVersion, "")) + } + if optionalParams.IncludeRulesWithoutFindings != nil { + localVarQueryParams.Add("include_rules_without_findings", datadog.ParameterToString(*optionalParams.IncludeRulesWithoutFindings, "")) + } + if optionalParams.IsCustom != nil { + localVarQueryParams.Add("is_custom", datadog.ParameterToString(*optionalParams.IsCustom, "")) + } + if optionalParams.Query != nil { + localVarQueryParams.Add("query", datadog.ParameterToString(*optionalParams.Query, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 503 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewComplianceApi Returns NewComplianceApi. +func NewComplianceApi(client *datadog.APIClient) *ComplianceApi { + return &ComplianceApi{ + Client: client, + } +} diff --git a/api/datadogV2/api_dashboards.go b/api/datadogV2/api_dashboards.go new file mode 100644 index 00000000000..a32e2ef4866 --- /dev/null +++ b/api/datadogV2/api_dashboards.go @@ -0,0 +1,286 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _fmt "fmt" + _log "log" + _nethttp "net/http" + _neturl "net/url" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardsApi service type +type DashboardsApi datadog.Service + +// GetDashboardUsage Get usage stats for a dashboard. +// Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score. +func (a *DashboardsApi) GetDashboardUsage(ctx _context.Context, dashboardId string) (DashboardUsageResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue DashboardUsageResponse + ) + + operationId := "v2.GetDashboardUsage" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DashboardsApi.GetDashboardUsage") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/dashboards/{dashboard_id}/usage" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dashboard_id}", _neturl.PathEscape(datadog.ParameterToString(dashboardId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListDashboardsUsageOptionalParameters holds optional parameters for ListDashboardsUsage. +type ListDashboardsUsageOptionalParameters struct { + PageLimit *int64 + PageOffset *int64 +} + +// NewListDashboardsUsageOptionalParameters creates an empty struct for parameters. +func NewListDashboardsUsageOptionalParameters() *ListDashboardsUsageOptionalParameters { + this := ListDashboardsUsageOptionalParameters{} + return &this +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListDashboardsUsageOptionalParameters) WithPageLimit(pageLimit int64) *ListDashboardsUsageOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// WithPageOffset sets the corresponding parameter name and returns the struct. +func (r *ListDashboardsUsageOptionalParameters) WithPageOffset(pageOffset int64) *ListDashboardsUsageOptionalParameters { + r.PageOffset = &pageOffset + return r +} + +// ListDashboardsUsage Get usage stats for all dashboards. +// Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set. +func (a *DashboardsApi) ListDashboardsUsage(ctx _context.Context, o ...ListDashboardsUsageOptionalParameters) (ListDashboardsUsageResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListDashboardsUsageResponse + optionalParams ListDashboardsUsageOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListDashboardsUsageOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListDashboardsUsage" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DashboardsApi.ListDashboardsUsage") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/dashboards/usage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + if optionalParams.PageOffset != nil { + localVarQueryParams.Add("page[offset]", datadog.ParameterToString(*optionalParams.PageOffset, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListDashboardsUsageWithPagination provides a paginated version of ListDashboardsUsage returning a channel with all items. +func (a *DashboardsApi) ListDashboardsUsageWithPagination(ctx _context.Context, o ...ListDashboardsUsageOptionalParameters) (<-chan datadog.PaginationResult[DashboardUsage], func()) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int64(250) + if len(o) == 0 { + o = append(o, ListDashboardsUsageOptionalParameters{}) + } + if o[0].PageLimit != nil { + pageSize_ = *o[0].PageLimit + } + o[0].PageLimit = &pageSize_ + + items := make(chan datadog.PaginationResult[DashboardUsage], pageSize_) + go func() { + for { + resp, _, err := a.ListDashboardsUsage(ctx, o...) + if err != nil { + var returnItem DashboardUsage + items <- datadog.PaginationResult[DashboardUsage]{Item: returnItem, Error: err} + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- datadog.PaginationResult[DashboardUsage]{Item: item, Error: nil}: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + if o[0].PageOffset == nil { + o[0].PageOffset = &pageSize_ + } else { + pageOffset_ := *o[0].PageOffset + pageSize_ + o[0].PageOffset = &pageOffset_ + } + } + close(items) + }() + return items, cancel +} + +// NewDashboardsApi Returns NewDashboardsApi. +func NewDashboardsApi(client *datadog.APIClient) *DashboardsApi { + return &DashboardsApi{ + Client: client, + } +} diff --git a/api/datadogV2/api_email_transport.go b/api/datadogV2/api_email_transport.go deleted file mode 100644 index 5917f132b29..00000000000 --- a/api/datadogV2/api_email_transport.go +++ /dev/null @@ -1,115 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - _context "context" - _fmt "fmt" - _log "log" - _nethttp "net/http" - _neturl "net/url" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// EmailTransportApi service type -type EmailTransportApi datadog.Service - -// CreateEmailTransportWebhookIntake Ingest email transport webhook events. -// Receives a batch of email transport webhook log events and emits an audit trail entry -// for each event with a final delivery status (delivered, dropped, or bounced). -// Only authorized organizations can submit events. -func (a *EmailTransportApi) CreateEmailTransportWebhookIntake(ctx _context.Context, body []TransportWebhookLog) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - ) - - operationId := "v2.CreateEmailTransportWebhookIntake" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.EmailTransportApi.CreateEmailTransportWebhookIntake") - if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/email/transport/webhook_intake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" - - // body params - localVarPostBody = &body - if a.Client.Cfg.DelegatedTokenConfig != nil { - err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) - if err != nil { - return nil, err - } - } else { - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - } - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// NewEmailTransportApi Returns NewEmailTransportApi. -func NewEmailTransportApi(client *datadog.APIClient) *EmailTransportApi { - return &EmailTransportApi{ - Client: client, - } -} diff --git a/api/datadogV2/api_llm_observability.go b/api/datadogV2/api_llm_observability.go index 5c554a6e5bf..c48d403c5c4 100644 --- a/api/datadogV2/api_llm_observability.go +++ b/api/datadogV2/api_llm_observability.go @@ -18,6 +18,107 @@ import ( // LLMObservabilityApi service type type LLMObservabilityApi datadog.Service +// AggregateLLMObsExperimentation Aggregate LLM Observability experimentation. +// Execute an analytics aggregation over LLM Observability experimentation data. +// Use this endpoint to compute metrics (for example average eval scores) grouped by fields such as `span_id` or `experiment_id`. +// +// At least one `compute` definition and one `index` must be provided. +func (a *LLMObservabilityApi) AggregateLLMObsExperimentation(ctx _context.Context, body LLMObsExperimentationAnalyticsRequest) (LLMObsExperimentationAnalyticsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsExperimentationAnalyticsResponse + ) + + operationId := "v2.AggregateLLMObsExperimentation" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.AggregateLLMObsExperimentation") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experimentation/analytics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // CreateLLMObsAnnotationQueue Create an LLM Observability annotation queue. // Create an annotation queue. The `name` and `project_id` fields are required. // An optional `annotation_schema` can be provided to define the labels for the queue. @@ -120,8 +221,16 @@ func (a *LLMObservabilityApi) CreateLLMObsAnnotationQueue(ctx _context.Context, } // CreateLLMObsAnnotationQueueInteractions Add annotation queue interactions. -// Add one or more interactions (traces or sessions) to an annotation queue. -// At least one interaction must be provided. +// Add one or more interactions to an annotation queue. At least one +// interaction must be provided. Each interaction has a `type`: +// +// - `trace`, `experiment_trace`, `session`: `content_id` references the +// upstream entity; the server fetches the actual content. +// - `display_block`: omit `content_id` and provide the rendered content +// in `display_block`. The server generates `content_id` as a +// deterministic hash of the block list. +// +// Items of different types can be mixed in a single request. func (a *LLMObservabilityApi) CreateLLMObsAnnotationQueueInteractions(ctx _context.Context, queueId string, body LLMObsAnnotationQueueInteractionsRequest) (LLMObsAnnotationQueueInteractionsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -605,6 +714,106 @@ func (a *LLMObservabilityApi) CreateLLMObsExperimentEvents(ctx _context.Context, return localVarHTTPResponse, nil } +// CreateLLMObsIntegrationInference Run an LLM inference. +// Run an LLM inference request through the specified integration and account, returning the model response and token usage. +func (a *LLMObservabilityApi) CreateLLMObsIntegrationInference(ctx _context.Context, integration LLMObsIntegrationName, accountId string, body LLMObsIntegrationInferenceRequest) (LLMObsIntegrationInferenceResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsIntegrationInferenceResponse + ) + + operationId := "v2.CreateLLMObsIntegrationInference" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.CreateLLMObsIntegrationInference") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration}", _neturl.PathEscape(datadog.ParameterToString(integration, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // CreateLLMObsProject Create an LLM Observability project. // Create a new LLM Observability project. Returns the existing project if a name conflict occurs. func (a *LLMObservabilityApi) CreateLLMObsProject(ctx _context.Context, body LLMObsProjectRequest) (LLMObsProjectResponse, *_nethttp.Response, error) { @@ -964,44 +1173,43 @@ func (a *LLMObservabilityApi) DeleteLLMObsCustomEvalConfig(ctx _context.Context, return localVarHTTPResponse, nil } -// DeleteLLMObsDatasetRecords Delete LLM Observability dataset records. -// Delete one or more records from an LLM Observability dataset. -func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, projectId string, datasetId string, body LLMObsDeleteDatasetRecordsRequest) (*_nethttp.Response, error) { +// DeleteLLMObsData Delete LLM Observability data. +// Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. +func (a *LLMObservabilityApi) DeleteLLMObsData(ctx _context.Context, body LLMObsDataDeletionRequest) (LLMObsDataDeletionResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsDataDeletionResponse ) - operationId := "v2.DeleteLLMObsDatasetRecords" + operationId := "v2.DeleteLLMObsData" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasetRecords") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsData") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{dataset_id}", _neturl.PathEscape(datadog.ParameterToString(datasetId, ""))) + localVarPath := localBasePath + "/api/v2/llm-obs/deletion/data/llmobs" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "application/json" // body params localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -1013,17 +1221,17 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, p } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1031,38 +1239,47 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, p ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteLLMObsDatasets Delete LLM Observability datasets. -// Delete one or more LLM Observability datasets within the specified project. -func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, projectId string, body LLMObsDeleteDatasetsRequest) (*_nethttp.Response, error) { +// DeleteLLMObsDatasetRecords Delete LLM Observability dataset records. +// Delete one or more records from an LLM Observability dataset. +func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, projectId string, datasetId string, body LLMObsDeleteDatasetRecordsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - operationId := "v2.DeleteLLMObsDatasets" + operationId := "v2.DeleteLLMObsDatasetRecords" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -1071,13 +1288,14 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, project _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasets") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasetRecords") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/delete" + localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete" localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dataset_id}", _neturl.PathEscape(datadog.ParameterToString(datasetId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1143,15 +1361,15 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, project return localVarHTTPResponse, nil } -// DeleteLLMObsExperiments Delete LLM Observability experiments. -// Delete one or more LLM Observability experiments. -func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body LLMObsDeleteExperimentsRequest) (*_nethttp.Response, error) { +// DeleteLLMObsDatasets Delete LLM Observability datasets. +// Delete one or more LLM Observability datasets within the specified project. +func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, projectId string, body LLMObsDeleteDatasetsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - operationId := "v2.DeleteLLMObsExperiments" + operationId := "v2.DeleteLLMObsDatasets" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -1160,12 +1378,13 @@ func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsExperiments") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasets") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments/delete" + localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/delete" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1208,7 +1427,7 @@ func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1231,7 +1450,95 @@ func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body return localVarHTTPResponse, nil } -// DeleteLLMObsProjects Delete LLM Observability projects. +// DeleteLLMObsExperiments Delete LLM Observability experiments. +// Delete one or more LLM Observability experiments. +func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body LLMObsDeleteExperimentsRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.DeleteLLMObsExperiments" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsExperiments") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments/delete" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteLLMObsProjects Delete LLM Observability projects. // Delete one or more LLM Observability projects. func (a *LLMObservabilityApi) DeleteLLMObsProjects(ctx _context.Context, body LLMObsDeleteProjectsRequest) (*_nethttp.Response, error) { var ( @@ -2048,69 +2355,48 @@ func (a *LLMObservabilityApi) ListLLMObsDatasets(ctx _context.Context, projectId return localVarReturnValue, localVarHTTPResponse, nil } -// ListLLMObsExperimentsOptionalParameters holds optional parameters for ListLLMObsExperiments. -type ListLLMObsExperimentsOptionalParameters struct { - FilterProjectId *string - FilterDatasetId *string - FilterId *string - PageCursor *string - PageLimit *int64 +// ListLLMObsExperimentEventsOptionalParameters holds optional parameters for ListLLMObsExperimentEvents. +type ListLLMObsExperimentEventsOptionalParameters struct { + PageLimit *int64 + PageCursor *string } -// NewListLLMObsExperimentsOptionalParameters creates an empty struct for parameters. -func NewListLLMObsExperimentsOptionalParameters() *ListLLMObsExperimentsOptionalParameters { - this := ListLLMObsExperimentsOptionalParameters{} +// NewListLLMObsExperimentEventsOptionalParameters creates an empty struct for parameters. +func NewListLLMObsExperimentEventsOptionalParameters() *ListLLMObsExperimentEventsOptionalParameters { + this := ListLLMObsExperimentEventsOptionalParameters{} return &this } -// WithFilterProjectId sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsExperimentsOptionalParameters) WithFilterProjectId(filterProjectId string) *ListLLMObsExperimentsOptionalParameters { - r.FilterProjectId = &filterProjectId - return r -} - -// WithFilterDatasetId sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsExperimentsOptionalParameters) WithFilterDatasetId(filterDatasetId string) *ListLLMObsExperimentsOptionalParameters { - r.FilterDatasetId = &filterDatasetId - return r -} - -// WithFilterId sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsExperimentsOptionalParameters) WithFilterId(filterId string) *ListLLMObsExperimentsOptionalParameters { - r.FilterId = &filterId +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsExperimentEventsOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsExperimentEventsOptionalParameters { + r.PageLimit = &pageLimit return r } // WithPageCursor sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsExperimentsOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsExperimentsOptionalParameters { +func (r *ListLLMObsExperimentEventsOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsExperimentEventsOptionalParameters { r.PageCursor = &pageCursor return r } -// WithPageLimit sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsExperimentsOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsExperimentsOptionalParameters { - r.PageLimit = &pageLimit - return r -} - -// ListLLMObsExperiments List LLM Observability experiments. -// List all LLM Observability experiments sorted by creation date, newest first. -func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...ListLLMObsExperimentsOptionalParameters) (LLMObsExperimentsResponse, *_nethttp.Response, error) { +// ListLLMObsExperimentEvents List events for an LLM Observability experiment. +// Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. +func (a *LLMObservabilityApi) ListLLMObsExperimentEvents(ctx _context.Context, experimentId string, o ...ListLLMObsExperimentEventsOptionalParameters) (LLMObsExperimentEventsV2Response, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue LLMObsExperimentsResponse - optionalParams ListLLMObsExperimentsOptionalParameters + localVarReturnValue LLMObsExperimentEventsV2Response + optionalParams ListLLMObsExperimentEventsOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsExperimentsOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsExperimentEventsOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - operationId := "v2.ListLLMObsExperiments" + operationId := "v2.ListLLMObsExperimentEvents" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -2119,31 +2405,23 @@ func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...L _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsExperiments") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsExperimentEvents") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments" + localVarPath := localBasePath + "/api/v2/llm-obs/v3/experiments/{experiment_id}/events" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{experiment_id}", _neturl.PathEscape(datadog.ParameterToString(experimentId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.FilterProjectId != nil { - localVarQueryParams.Add("filter[project_id]", datadog.ParameterToString(*optionalParams.FilterProjectId, "")) - } - if optionalParams.FilterDatasetId != nil { - localVarQueryParams.Add("filter[dataset_id]", datadog.ParameterToString(*optionalParams.FilterDatasetId, "")) - } - if optionalParams.FilterId != nil { - localVarQueryParams.Add("filter[id]", datadog.ParameterToString(*optionalParams.FilterId, "")) + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) } if optionalParams.PageCursor != nil { localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) } - if optionalParams.PageLimit != nil { - localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) - } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -2179,7 +2457,7 @@ func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...L ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2211,62 +2489,69 @@ func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...L return localVarReturnValue, localVarHTTPResponse, nil } -// ListLLMObsProjectsOptionalParameters holds optional parameters for ListLLMObsProjects. -type ListLLMObsProjectsOptionalParameters struct { - FilterId *string - FilterName *string - PageCursor *string - PageLimit *int64 +// ListLLMObsExperimentsOptionalParameters holds optional parameters for ListLLMObsExperiments. +type ListLLMObsExperimentsOptionalParameters struct { + FilterProjectId *string + FilterDatasetId *string + FilterId *string + PageCursor *string + PageLimit *int64 } -// NewListLLMObsProjectsOptionalParameters creates an empty struct for parameters. -func NewListLLMObsProjectsOptionalParameters() *ListLLMObsProjectsOptionalParameters { - this := ListLLMObsProjectsOptionalParameters{} +// NewListLLMObsExperimentsOptionalParameters creates an empty struct for parameters. +func NewListLLMObsExperimentsOptionalParameters() *ListLLMObsExperimentsOptionalParameters { + this := ListLLMObsExperimentsOptionalParameters{} return &this } -// WithFilterId sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsProjectsOptionalParameters) WithFilterId(filterId string) *ListLLMObsProjectsOptionalParameters { - r.FilterId = &filterId +// WithFilterProjectId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsExperimentsOptionalParameters) WithFilterProjectId(filterProjectId string) *ListLLMObsExperimentsOptionalParameters { + r.FilterProjectId = &filterProjectId return r } -// WithFilterName sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsProjectsOptionalParameters) WithFilterName(filterName string) *ListLLMObsProjectsOptionalParameters { - r.FilterName = &filterName +// WithFilterDatasetId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsExperimentsOptionalParameters) WithFilterDatasetId(filterDatasetId string) *ListLLMObsExperimentsOptionalParameters { + r.FilterDatasetId = &filterDatasetId + return r +} + +// WithFilterId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsExperimentsOptionalParameters) WithFilterId(filterId string) *ListLLMObsExperimentsOptionalParameters { + r.FilterId = &filterId return r } // WithPageCursor sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsProjectsOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsProjectsOptionalParameters { +func (r *ListLLMObsExperimentsOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsExperimentsOptionalParameters { r.PageCursor = &pageCursor return r } // WithPageLimit sets the corresponding parameter name and returns the struct. -func (r *ListLLMObsProjectsOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsProjectsOptionalParameters { +func (r *ListLLMObsExperimentsOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsExperimentsOptionalParameters { r.PageLimit = &pageLimit return r } -// ListLLMObsProjects List LLM Observability projects. -// List all LLM Observability projects sorted by creation date, newest first. -func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...ListLLMObsProjectsOptionalParameters) (LLMObsProjectsResponse, *_nethttp.Response, error) { +// ListLLMObsExperiments List LLM Observability experiments. +// List all LLM Observability experiments sorted by creation date, newest first. +func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...ListLLMObsExperimentsOptionalParameters) (LLMObsExperimentsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue LLMObsProjectsResponse - optionalParams ListLLMObsProjectsOptionalParameters + localVarReturnValue LLMObsExperimentsResponse + optionalParams ListLLMObsExperimentsOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsProjectsOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsExperimentsOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - operationId := "v2.ListLLMObsProjects" + operationId := "v2.ListLLMObsExperiments" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -2275,22 +2560,25 @@ func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...List _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsProjects") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsExperiments") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/projects" + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.FilterProjectId != nil { + localVarQueryParams.Add("filter[project_id]", datadog.ParameterToString(*optionalParams.FilterProjectId, "")) + } + if optionalParams.FilterDatasetId != nil { + localVarQueryParams.Add("filter[dataset_id]", datadog.ParameterToString(*optionalParams.FilterDatasetId, "")) + } if optionalParams.FilterId != nil { localVarQueryParams.Add("filter[id]", datadog.ParameterToString(*optionalParams.FilterId, "")) } - if optionalParams.FilterName != nil { - localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, "")) - } if optionalParams.PageCursor != nil { localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) } @@ -2364,6 +2652,886 @@ func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...List return localVarReturnValue, localVarHTTPResponse, nil } +// ListLLMObsIntegrationAccounts List LLM integration accounts. +// Retrieve the list of configured accounts for the specified LLM provider integration. +func (a *LLMObservabilityApi) ListLLMObsIntegrationAccounts(ctx _context.Context, integration LLMObsIntegrationName) ([]LLMObsIntegrationAccount, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []LLMObsIntegrationAccount + ) + + operationId := "v2.ListLLMObsIntegrationAccounts" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsIntegrationAccounts") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/integrations/{integration}/accounts" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration}", _neturl.PathEscape(datadog.ParameterToString(integration, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListLLMObsIntegrationModels List LLM integration models. +// Retrieve the list of models available for the specified LLM provider integration and account. +func (a *LLMObservabilityApi) ListLLMObsIntegrationModels(ctx _context.Context, integration LLMObsIntegrationName, accountId string) ([]LLMObsIntegrationModel, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue []LLMObsIntegrationModel + ) + + operationId := "v2.ListLLMObsIntegrationModels" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsIntegrationModels") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration}", _neturl.PathEscape(datadog.ParameterToString(integration, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{account_id}", _neturl.PathEscape(datadog.ParameterToString(accountId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListLLMObsProjectsOptionalParameters holds optional parameters for ListLLMObsProjects. +type ListLLMObsProjectsOptionalParameters struct { + FilterId *string + FilterName *string + PageCursor *string + PageLimit *int64 +} + +// NewListLLMObsProjectsOptionalParameters creates an empty struct for parameters. +func NewListLLMObsProjectsOptionalParameters() *ListLLMObsProjectsOptionalParameters { + this := ListLLMObsProjectsOptionalParameters{} + return &this +} + +// WithFilterId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsProjectsOptionalParameters) WithFilterId(filterId string) *ListLLMObsProjectsOptionalParameters { + r.FilterId = &filterId + return r +} + +// WithFilterName sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsProjectsOptionalParameters) WithFilterName(filterName string) *ListLLMObsProjectsOptionalParameters { + r.FilterName = &filterName + return r +} + +// WithPageCursor sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsProjectsOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsProjectsOptionalParameters { + r.PageCursor = &pageCursor + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsProjectsOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsProjectsOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// ListLLMObsProjects List LLM Observability projects. +// List all LLM Observability projects sorted by creation date, newest first. +func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...ListLLMObsProjectsOptionalParameters) (LLMObsProjectsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LLMObsProjectsResponse + optionalParams ListLLMObsProjectsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsProjectsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListLLMObsProjects" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsProjects") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterId != nil { + localVarQueryParams.Add("filter[id]", datadog.ParameterToString(*optionalParams.FilterId, "")) + } + if optionalParams.FilterName != nil { + localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, "")) + } + if optionalParams.PageCursor != nil { + localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) + } + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListLLMObsSpansOptionalParameters holds optional parameters for ListLLMObsSpans. +type ListLLMObsSpansOptionalParameters struct { + FilterFrom *string + FilterTo *string + FilterQuery *string + FilterSpanId *string + FilterTraceId *string + FilterSpanKind *string + FilterSpanName *string + FilterMlApp *string + PageLimit *int64 + PageCursor *string + Sort *string + IncludeAttachments *bool +} + +// NewListLLMObsSpansOptionalParameters creates an empty struct for parameters. +func NewListLLMObsSpansOptionalParameters() *ListLLMObsSpansOptionalParameters { + this := ListLLMObsSpansOptionalParameters{} + return &this +} + +// WithFilterFrom sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterFrom(filterFrom string) *ListLLMObsSpansOptionalParameters { + r.FilterFrom = &filterFrom + return r +} + +// WithFilterTo sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterTo(filterTo string) *ListLLMObsSpansOptionalParameters { + r.FilterTo = &filterTo + return r +} + +// WithFilterQuery sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterQuery(filterQuery string) *ListLLMObsSpansOptionalParameters { + r.FilterQuery = &filterQuery + return r +} + +// WithFilterSpanId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterSpanId(filterSpanId string) *ListLLMObsSpansOptionalParameters { + r.FilterSpanId = &filterSpanId + return r +} + +// WithFilterTraceId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterTraceId(filterTraceId string) *ListLLMObsSpansOptionalParameters { + r.FilterTraceId = &filterTraceId + return r +} + +// WithFilterSpanKind sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterSpanKind(filterSpanKind string) *ListLLMObsSpansOptionalParameters { + r.FilterSpanKind = &filterSpanKind + return r +} + +// WithFilterSpanName sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterSpanName(filterSpanName string) *ListLLMObsSpansOptionalParameters { + r.FilterSpanName = &filterSpanName + return r +} + +// WithFilterMlApp sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithFilterMlApp(filterMlApp string) *ListLLMObsSpansOptionalParameters { + r.FilterMlApp = &filterMlApp + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithPageLimit(pageLimit int64) *ListLLMObsSpansOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// WithPageCursor sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithPageCursor(pageCursor string) *ListLLMObsSpansOptionalParameters { + r.PageCursor = &pageCursor + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithSort(sort string) *ListLLMObsSpansOptionalParameters { + r.Sort = &sort + return r +} + +// WithIncludeAttachments sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsSpansOptionalParameters) WithIncludeAttachments(includeAttachments bool) *ListLLMObsSpansOptionalParameters { + r.IncludeAttachments = &includeAttachments + return r +} + +// ListLLMObsSpans List LLM Observability spans. +// List LLM Observability spans matching the specified filters. +func (a *LLMObservabilityApi) ListLLMObsSpans(ctx _context.Context, o ...ListLLMObsSpansOptionalParameters) (LLMObsSpansResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LLMObsSpansResponse + optionalParams ListLLMObsSpansOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsSpansOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListLLMObsSpans" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsSpans") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/spans/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterFrom != nil { + localVarQueryParams.Add("filter[from]", datadog.ParameterToString(*optionalParams.FilterFrom, "")) + } + if optionalParams.FilterTo != nil { + localVarQueryParams.Add("filter[to]", datadog.ParameterToString(*optionalParams.FilterTo, "")) + } + if optionalParams.FilterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) + } + if optionalParams.FilterSpanId != nil { + localVarQueryParams.Add("filter[span_id]", datadog.ParameterToString(*optionalParams.FilterSpanId, "")) + } + if optionalParams.FilterTraceId != nil { + localVarQueryParams.Add("filter[trace_id]", datadog.ParameterToString(*optionalParams.FilterTraceId, "")) + } + if optionalParams.FilterSpanKind != nil { + localVarQueryParams.Add("filter[span_kind]", datadog.ParameterToString(*optionalParams.FilterSpanKind, "")) + } + if optionalParams.FilterSpanName != nil { + localVarQueryParams.Add("filter[span_name]", datadog.ParameterToString(*optionalParams.FilterSpanName, "")) + } + if optionalParams.FilterMlApp != nil { + localVarQueryParams.Add("filter[ml_app]", datadog.ParameterToString(*optionalParams.FilterMlApp, "")) + } + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + if optionalParams.PageCursor != nil { + localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) + } + if optionalParams.IncludeAttachments != nil { + localVarQueryParams.Add("include_attachments", datadog.ParameterToString(*optionalParams.IncludeAttachments, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// SearchLLMObsExperimentation Search LLM Observability experimentation entities. +// Search across LLM Observability experimentation entities — projects, datasets, dataset records, experiments, and experiment runs — using cursor-based pagination. +// +// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. +// +// Returns `200 OK` when all results fit in a single page. Returns `206 Partial Content` with a cursor in `meta.after` when additional pages are available. +func (a *LLMObservabilityApi) SearchLLMObsExperimentation(ctx _context.Context, body LLMObsExperimentationSearchRequest) (LLMObsExperimentationSearchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsExperimentationSearchResponse + ) + + operationId := "v2.SearchLLMObsExperimentation" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.SearchLLMObsExperimentation") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experimentation/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// SearchLLMObsSpans Search LLM Observability spans. +// Search LLM Observability spans using structured filters in the request body. +func (a *LLMObservabilityApi) SearchLLMObsSpans(ctx _context.Context, body LLMObsSearchSpansRequest) (LLMObsSpansResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsSpansResponse + ) + + operationId := "v2.SearchLLMObsSpans" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.SearchLLMObsSpans") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/spans/events/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// SimpleSearchLLMObsExperimentation Simple search experimentation entities. +// Search across LLM Observability experimentation entities using offset-based (page-number) pagination. +// Use this endpoint when you need total page count or want to navigate to a specific page number. +// +// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. +func (a *LLMObservabilityApi) SimpleSearchLLMObsExperimentation(ctx _context.Context, body LLMObsExperimentationSimpleSearchRequest) (LLMObsExperimentationSimpleSearchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsExperimentationSimpleSearchResponse + ) + + operationId := "v2.SimpleSearchLLMObsExperimentation" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.SimpleSearchLLMObsExperimentation") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experimentation/simple-search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // UpdateLLMObsAnnotationQueue Update an LLM Observability annotation queue. // Partially update an annotation queue. The `name`, `description`, and `annotation_schema` fields can be updated. func (a *LLMObservabilityApi) UpdateLLMObsAnnotationQueue(ctx _context.Context, queueId string, body LLMObsAnnotationQueueUpdateRequest) (LLMObsAnnotationQueueResponse, *_nethttp.Response, error) { diff --git a/api/datadogV2/api_model_lab_api.go b/api/datadogV2/api_model_lab_api.go new file mode 100644 index 00000000000..1f13446dbd2 --- /dev/null +++ b/api/datadogV2/api_model_lab_api.go @@ -0,0 +1,1770 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _fmt "fmt" + _io "io" + _log "log" + _nethttp "net/http" + _neturl "net/url" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/google/uuid" +) + +// ModelLabAPIApi service type +type ModelLabAPIApi datadog.Service + +// DeleteModelLabRun Delete a Model Lab run. +// Delete a Model Lab run by its ID. +func (a *ModelLabAPIApi) DeleteModelLabRun(ctx _context.Context, runId int64) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteModelLabRun" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.DeleteModelLabRun") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs/{run_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{run_id}", _neturl.PathEscape(datadog.ParameterToString(runId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// GetModelLabArtifactContent Get Model Lab artifact content. +// Download the raw content of a Model Lab artifact file. +func (a *ModelLabAPIApi) GetModelLabArtifactContent(ctx _context.Context, projectId string, artifactPath string) (_io.Reader, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue _io.Reader + ) + + operationId := "v2.GetModelLabArtifactContent" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.GetModelLabArtifactContent") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/artifacts/content" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("project_id", datadog.ParameterToString(projectId, "")) + localVarQueryParams.Add("artifact_path", datadog.ParameterToString(artifactPath, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + localVarReturnValue = localVarHTTPResponse.Body + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetModelLabProject Get a Model Lab project. +// Get a single Model Lab project by its ID. +func (a *ModelLabAPIApi) GetModelLabProject(ctx _context.Context, projectId int64) (ModelLabProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabProjectResponse + ) + + operationId := "v2.GetModelLabProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.GetModelLabProject") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/projects/{project_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetModelLabRun Get a Model Lab run. +// Get a single Model Lab run by its ID. +func (a *ModelLabAPIApi) GetModelLabRun(ctx _context.Context, runId int64) (ModelLabRunResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabRunResponse + ) + + operationId := "v2.GetModelLabRun" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.GetModelLabRun") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs/{run_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{run_id}", _neturl.PathEscape(datadog.ParameterToString(runId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabProjectArtifacts List Model Lab project artifacts. +// List all artifact files for a specific Model Lab project. +func (a *ModelLabAPIApi) ListModelLabProjectArtifacts(ctx _context.Context, projectId int64) (ModelLabProjectArtifactsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabProjectArtifactsResponse + ) + + operationId := "v2.ListModelLabProjectArtifacts" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabProjectArtifacts") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/projects/{project_id}/artifacts" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabProjectFacetKeys List Model Lab project facet keys. +// List all available facet keys for filtering Model Lab projects. +func (a *ModelLabAPIApi) ListModelLabProjectFacetKeys(ctx _context.Context) (ModelLabFacetKeysResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabFacetKeysResponse + ) + + operationId := "v2.ListModelLabProjectFacetKeys" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabProjectFacetKeys") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/project-facet-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabProjectFacetValues List Model Lab project facet values. +// List available facet values for a specific project facet key. +func (a *ModelLabAPIApi) ListModelLabProjectFacetValues(ctx _context.Context, facetType ModelLabProjectFacetType, facetName string) (ModelLabFacetValuesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabFacetValuesResponse + ) + + operationId := "v2.ListModelLabProjectFacetValues" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabProjectFacetValues") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/project-facet-values" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("facet_type", datadog.ParameterToString(facetType, "")) + localVarQueryParams.Add("facet_name", datadog.ParameterToString(facetName, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabProjectsOptionalParameters holds optional parameters for ListModelLabProjects. +type ListModelLabProjectsOptionalParameters struct { + Filter *string + FilterOwnerId *uuid.UUID + FilterTags *string + Sort *string + PageSize *int32 + PageNumber *int32 +} + +// NewListModelLabProjectsOptionalParameters creates an empty struct for parameters. +func NewListModelLabProjectsOptionalParameters() *ListModelLabProjectsOptionalParameters { + this := ListModelLabProjectsOptionalParameters{} + return &this +} + +// WithFilter sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithFilter(filter string) *ListModelLabProjectsOptionalParameters { + r.Filter = &filter + return r +} + +// WithFilterOwnerId sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithFilterOwnerId(filterOwnerId uuid.UUID) *ListModelLabProjectsOptionalParameters { + r.FilterOwnerId = &filterOwnerId + return r +} + +// WithFilterTags sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithFilterTags(filterTags string) *ListModelLabProjectsOptionalParameters { + r.FilterTags = &filterTags + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithSort(sort string) *ListModelLabProjectsOptionalParameters { + r.Sort = &sort + return r +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithPageSize(pageSize int32) *ListModelLabProjectsOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageNumber sets the corresponding parameter name and returns the struct. +func (r *ListModelLabProjectsOptionalParameters) WithPageNumber(pageNumber int32) *ListModelLabProjectsOptionalParameters { + r.PageNumber = &pageNumber + return r +} + +// ListModelLabProjects List Model Lab projects. +// List all Model Lab projects for the current organization. +func (a *ModelLabAPIApi) ListModelLabProjects(ctx _context.Context, o ...ListModelLabProjectsOptionalParameters) (ModelLabProjectsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabProjectsResponse + optionalParams ListModelLabProjectsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListModelLabProjectsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListModelLabProjects" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabProjects") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Filter != nil { + localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) + } + if optionalParams.FilterOwnerId != nil { + localVarQueryParams.Add("filter[owner_id]", datadog.ParameterToString(*optionalParams.FilterOwnerId, "")) + } + if optionalParams.FilterTags != nil { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) + } + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageNumber != nil { + localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabRunArtifactsOptionalParameters holds optional parameters for ListModelLabRunArtifacts. +type ListModelLabRunArtifactsOptionalParameters struct { + Path *string +} + +// NewListModelLabRunArtifactsOptionalParameters creates an empty struct for parameters. +func NewListModelLabRunArtifactsOptionalParameters() *ListModelLabRunArtifactsOptionalParameters { + this := ListModelLabRunArtifactsOptionalParameters{} + return &this +} + +// WithPath sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunArtifactsOptionalParameters) WithPath(path string) *ListModelLabRunArtifactsOptionalParameters { + r.Path = &path + return r +} + +// ListModelLabRunArtifacts List Model Lab run artifacts. +// List artifact files for a specific Model Lab run. +func (a *ModelLabAPIApi) ListModelLabRunArtifacts(ctx _context.Context, runId int64, o ...ListModelLabRunArtifactsOptionalParameters) (ModelLabRunArtifactsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabRunArtifactsResponse + optionalParams ListModelLabRunArtifactsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListModelLabRunArtifactsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListModelLabRunArtifacts" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabRunArtifacts") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs/{run_id}/artifacts" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{run_id}", _neturl.PathEscape(datadog.ParameterToString(runId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Path != nil { + localVarQueryParams.Add("path", datadog.ParameterToString(*optionalParams.Path, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabRunFacetKeys List Model Lab run facet keys. +// List all available facet keys for filtering Model Lab runs. +func (a *ModelLabAPIApi) ListModelLabRunFacetKeys(ctx _context.Context, filterProjectId int64) (ModelLabFacetKeysResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabFacetKeysResponse + ) + + operationId := "v2.ListModelLabRunFacetKeys" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabRunFacetKeys") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/facet-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("filter[project_id]", datadog.ParameterToString(filterProjectId, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabRunFacetValues List Model Lab run facet values. +// List available facet values for a specific run facet key. +func (a *ModelLabAPIApi) ListModelLabRunFacetValues(ctx _context.Context, filterProjectId int64, facetType ModelLabFacetType, facetName string) (ModelLabFacetValuesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabFacetValuesResponse + ) + + operationId := "v2.ListModelLabRunFacetValues" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabRunFacetValues") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/facet-values" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("filter[project_id]", datadog.ParameterToString(filterProjectId, "")) + localVarQueryParams.Add("facet_type", datadog.ParameterToString(facetType, "")) + localVarQueryParams.Add("facet_name", datadog.ParameterToString(facetName, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListModelLabRunsOptionalParameters holds optional parameters for ListModelLabRuns. +type ListModelLabRunsOptionalParameters struct { + FilterId *string + Filter *string + FilterOwnerId *string + FilterStatus *ModelLabRunStatus + FilterProjectId *int64 + FilterTags *string + FilterParams *string + FilterParentRunId *string + PinnedFirst *bool + IncludePinned *bool + IncludeDescendantMatches *bool + Sort *string + PageSize *int32 + PageNumber *int32 +} + +// NewListModelLabRunsOptionalParameters creates an empty struct for parameters. +func NewListModelLabRunsOptionalParameters() *ListModelLabRunsOptionalParameters { + this := ListModelLabRunsOptionalParameters{} + return &this +} + +// WithFilterId sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterId(filterId string) *ListModelLabRunsOptionalParameters { + r.FilterId = &filterId + return r +} + +// WithFilter sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilter(filter string) *ListModelLabRunsOptionalParameters { + r.Filter = &filter + return r +} + +// WithFilterOwnerId sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterOwnerId(filterOwnerId string) *ListModelLabRunsOptionalParameters { + r.FilterOwnerId = &filterOwnerId + return r +} + +// WithFilterStatus sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterStatus(filterStatus ModelLabRunStatus) *ListModelLabRunsOptionalParameters { + r.FilterStatus = &filterStatus + return r +} + +// WithFilterProjectId sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterProjectId(filterProjectId int64) *ListModelLabRunsOptionalParameters { + r.FilterProjectId = &filterProjectId + return r +} + +// WithFilterTags sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterTags(filterTags string) *ListModelLabRunsOptionalParameters { + r.FilterTags = &filterTags + return r +} + +// WithFilterParams sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterParams(filterParams string) *ListModelLabRunsOptionalParameters { + r.FilterParams = &filterParams + return r +} + +// WithFilterParentRunId sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithFilterParentRunId(filterParentRunId string) *ListModelLabRunsOptionalParameters { + r.FilterParentRunId = &filterParentRunId + return r +} + +// WithPinnedFirst sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithPinnedFirst(pinnedFirst bool) *ListModelLabRunsOptionalParameters { + r.PinnedFirst = &pinnedFirst + return r +} + +// WithIncludePinned sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithIncludePinned(includePinned bool) *ListModelLabRunsOptionalParameters { + r.IncludePinned = &includePinned + return r +} + +// WithIncludeDescendantMatches sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithIncludeDescendantMatches(includeDescendantMatches bool) *ListModelLabRunsOptionalParameters { + r.IncludeDescendantMatches = &includeDescendantMatches + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithSort(sort string) *ListModelLabRunsOptionalParameters { + r.Sort = &sort + return r +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithPageSize(pageSize int32) *ListModelLabRunsOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageNumber sets the corresponding parameter name and returns the struct. +func (r *ListModelLabRunsOptionalParameters) WithPageNumber(pageNumber int32) *ListModelLabRunsOptionalParameters { + r.PageNumber = &pageNumber + return r +} + +// ListModelLabRuns List Model Lab runs. +// List all Model Lab runs for the current organization. +func (a *ModelLabAPIApi) ListModelLabRuns(ctx _context.Context, o ...ListModelLabRunsOptionalParameters) (ModelLabRunsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ModelLabRunsResponse + optionalParams ListModelLabRunsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListModelLabRunsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListModelLabRuns" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.ListModelLabRuns") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterId != nil { + localVarQueryParams.Add("filter[id]", datadog.ParameterToString(*optionalParams.FilterId, "")) + } + if optionalParams.Filter != nil { + localVarQueryParams.Add("filter", datadog.ParameterToString(*optionalParams.Filter, "")) + } + if optionalParams.FilterOwnerId != nil { + localVarQueryParams.Add("filter[owner_id]", datadog.ParameterToString(*optionalParams.FilterOwnerId, "")) + } + if optionalParams.FilterStatus != nil { + localVarQueryParams.Add("filter[status]", datadog.ParameterToString(*optionalParams.FilterStatus, "")) + } + if optionalParams.FilterProjectId != nil { + localVarQueryParams.Add("filter[project_id]", datadog.ParameterToString(*optionalParams.FilterProjectId, "")) + } + if optionalParams.FilterTags != nil { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, "")) + } + if optionalParams.FilterParams != nil { + localVarQueryParams.Add("filter[params]", datadog.ParameterToString(*optionalParams.FilterParams, "")) + } + if optionalParams.FilterParentRunId != nil { + localVarQueryParams.Add("filter[parent_run_id]", datadog.ParameterToString(*optionalParams.FilterParentRunId, "")) + } + if optionalParams.PinnedFirst != nil { + localVarQueryParams.Add("pinned_first", datadog.ParameterToString(*optionalParams.PinnedFirst, "")) + } + if optionalParams.IncludePinned != nil { + localVarQueryParams.Add("include_pinned", datadog.ParameterToString(*optionalParams.IncludePinned, "")) + } + if optionalParams.IncludeDescendantMatches != nil { + localVarQueryParams.Add("include_descendant_matches", datadog.ParameterToString(*optionalParams.IncludeDescendantMatches, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) + } + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageNumber != nil { + localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// PinModelLabRun Pin a Model Lab run. +// Pin a Model Lab run for the current user. +func (a *ModelLabAPIApi) PinModelLabRun(ctx _context.Context, runId int64) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.PinModelLabRun" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.PinModelLabRun") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs/{run_id}/pin" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{run_id}", _neturl.PathEscape(datadog.ParameterToString(runId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// StarModelLabProject Star a Model Lab project. +// Star a Model Lab project for the current user. +func (a *ModelLabAPIApi) StarModelLabProject(ctx _context.Context, projectId int64) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.StarModelLabProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.StarModelLabProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/projects/{project_id}/star" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UnpinModelLabRun Unpin a Model Lab run. +// Remove the pin from a Model Lab run for the current user. +func (a *ModelLabAPIApi) UnpinModelLabRun(ctx _context.Context, runId int64) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.UnpinModelLabRun" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.UnpinModelLabRun") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/runs/{run_id}/pin" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{run_id}", _neturl.PathEscape(datadog.ParameterToString(runId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UnstarModelLabProject Remove star from a Model Lab project. +// Remove the star from a Model Lab project for the current user. +func (a *ModelLabAPIApi) UnstarModelLabProject(ctx _context.Context, projectId int64) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.UnstarModelLabProject" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ModelLabAPIApi.UnstarModelLabProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/model-lab-api/projects/{project_id}/star" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 500 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// NewModelLabAPIApi Returns NewModelLabAPIApi. +func NewModelLabAPIApi(client *datadog.APIClient) *ModelLabAPIApi { + return &ModelLabAPIApi{ + Client: client, + } +} diff --git a/api/datadogV2/api_scorecards.go b/api/datadogV2/api_scorecards.go index 21900259c74..9b2a166c125 100644 --- a/api/datadogV2/api_scorecards.go +++ b/api/datadogV2/api_scorecards.go @@ -1191,6 +1191,192 @@ func (a *ScorecardsApi) ListScorecardRulesWithPagination(ctx _context.Context, o return items, cancel } +// ListScorecardScoresOptionalParameters holds optional parameters for ListScorecardScores. +type ListScorecardScoresOptionalParameters struct { + FilterRuleId *string + FilterRuleName *string + FilterRuleLevel *string + FilterRuleScorecardId *string + FilterRuleIsCustom *bool + FilterRuleIsEnabled *bool + Sort *string + PageOffset *int32 + PageLimit *int32 +} + +// NewListScorecardScoresOptionalParameters creates an empty struct for parameters. +func NewListScorecardScoresOptionalParameters() *ListScorecardScoresOptionalParameters { + this := ListScorecardScoresOptionalParameters{} + return &this +} + +// WithFilterRuleId sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleId(filterRuleId string) *ListScorecardScoresOptionalParameters { + r.FilterRuleId = &filterRuleId + return r +} + +// WithFilterRuleName sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleName(filterRuleName string) *ListScorecardScoresOptionalParameters { + r.FilterRuleName = &filterRuleName + return r +} + +// WithFilterRuleLevel sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleLevel(filterRuleLevel string) *ListScorecardScoresOptionalParameters { + r.FilterRuleLevel = &filterRuleLevel + return r +} + +// WithFilterRuleScorecardId sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleScorecardId(filterRuleScorecardId string) *ListScorecardScoresOptionalParameters { + r.FilterRuleScorecardId = &filterRuleScorecardId + return r +} + +// WithFilterRuleIsCustom sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleIsCustom(filterRuleIsCustom bool) *ListScorecardScoresOptionalParameters { + r.FilterRuleIsCustom = &filterRuleIsCustom + return r +} + +// WithFilterRuleIsEnabled sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithFilterRuleIsEnabled(filterRuleIsEnabled bool) *ListScorecardScoresOptionalParameters { + r.FilterRuleIsEnabled = &filterRuleIsEnabled + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithSort(sort string) *ListScorecardScoresOptionalParameters { + r.Sort = &sort + return r +} + +// WithPageOffset sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithPageOffset(pageOffset int32) *ListScorecardScoresOptionalParameters { + r.PageOffset = &pageOffset + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListScorecardScoresOptionalParameters) WithPageLimit(pageLimit int32) *ListScorecardScoresOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// ListScorecardScores List all scores. +// Returns a list of scorecard scores for each aggregation type, with score breakdowns. +func (a *ScorecardsApi) ListScorecardScores(ctx _context.Context, aggregation ScorecardScoresAggregation, o ...ListScorecardScoresOptionalParameters) (ListScorecardScoresResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListScorecardScoresResponse + optionalParams ListScorecardScoresOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListScorecardScoresOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ScorecardsApi.ListScorecardScores") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/scorecard/scores/{aggregation}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{aggregation}", _neturl.PathEscape(datadog.ParameterToString(aggregation, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterRuleId != nil { + localVarQueryParams.Add("filter[rule][id]", datadog.ParameterToString(*optionalParams.FilterRuleId, "")) + } + if optionalParams.FilterRuleName != nil { + localVarQueryParams.Add("filter[rule][name]", datadog.ParameterToString(*optionalParams.FilterRuleName, "")) + } + if optionalParams.FilterRuleLevel != nil { + localVarQueryParams.Add("filter[rule][level]", datadog.ParameterToString(*optionalParams.FilterRuleLevel, "")) + } + if optionalParams.FilterRuleScorecardId != nil { + localVarQueryParams.Add("filter[rule][scorecard_id]", datadog.ParameterToString(*optionalParams.FilterRuleScorecardId, "")) + } + if optionalParams.FilterRuleIsCustom != nil { + localVarQueryParams.Add("filter[rule][is_custom]", datadog.ParameterToString(*optionalParams.FilterRuleIsCustom, "")) + } + if optionalParams.FilterRuleIsEnabled != nil { + localVarQueryParams.Add("filter[rule][is_enabled]", datadog.ParameterToString(*optionalParams.FilterRuleIsEnabled, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) + } + if optionalParams.PageOffset != nil { + localVarQueryParams.Add("page[offset]", datadog.ParameterToString(*optionalParams.PageOffset, "")) + } + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // ListScorecardsOptionalParameters holds optional parameters for ListScorecards. type ListScorecardsOptionalParameters struct { PageOffset *int64 diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index 60d9e0da6b8..19170e79cbe 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -271,6 +271,101 @@ func (a *SecurityMonitoringApi) AttachJiraIssue(ctx _context.Context, body Attac return localVarReturnValue, localVarHTTPResponse, nil } +// BulkCreateSampleLogGenerationSubscriptions Bulk subscribe to sample log generation. +// Subscribe to sample log generation for multiple Cloud SIEM content packs in a single call. +// Each requested content pack is processed independently; the response includes a per-item +// status so partial successes can be inspected. +// +// **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an +// eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject +// requests with `400 Bad Request`, and legacy pricing tiers receive per-item responses with `status: not_available`. +func (a *SecurityMonitoringApi) BulkCreateSampleLogGenerationSubscriptions(ctx _context.Context, body SampleLogGenerationBulkSubscriptionRequest) (SampleLogGenerationBulkSubscriptionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue SampleLogGenerationBulkSubscriptionResponse + ) + + operationId := "v2.BulkCreateSampleLogGenerationSubscriptions" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.BulkCreateSampleLogGenerationSubscriptions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/sample_log_generation/subscriptions/bulk" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // BulkDeleteSecurityMonitoringRules Bulk delete security monitoring rules. // Delete multiple security monitoring rules in a single request. Default rules cannot be deleted. func (a *SecurityMonitoringApi) BulkDeleteSecurityMonitoringRules(ctx _context.Context, body SecurityMonitoringRuleBulkDeletePayload) (SecurityMonitoringRuleBulkDeleteResponse, *_nethttp.Response, error) { @@ -1440,6 +1535,101 @@ func (a *SecurityMonitoringApi) CreateJiraIssues(ctx _context.Context, body Crea return localVarReturnValue, localVarHTTPResponse, nil } +// CreateSampleLogGenerationSubscription Subscribe to sample log generation. +// Subscribe to sample log generation for a Cloud SIEM content pack. Sample logs for the +// requested content pack are injected into the Logs platform for the duration of the subscription, +// so detection rules can be exercised without onboarding the underlying integration first. +// +// **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an +// eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject +// requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. +func (a *SecurityMonitoringApi) CreateSampleLogGenerationSubscription(ctx _context.Context, body SampleLogGenerationSubscriptionCreateRequest) (SampleLogGenerationSubscriptionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue SampleLogGenerationSubscriptionResponse + ) + + operationId := "v2.CreateSampleLogGenerationSubscription" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.CreateSampleLogGenerationSubscription") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/sample_log_generation/subscriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // CreateSecurityFilter Create a security filter. // Create a security filter. // @@ -1603,6 +1793,97 @@ func (a *SecurityMonitoringApi) CreateSecurityMonitoringCriticalAsset(ctx _conte return localVarReturnValue, localVarHTTPResponse, nil } +// CreateSecurityMonitoringIntegrationConfig Create an entity context sync configuration. +// Create a new entity context sync configuration so Cloud SIEM can ingest entities from an external +// source. The credentials provided in `secrets` are validated against the source before the configuration +// is stored and never returned in subsequent responses. +func (a *SecurityMonitoringApi) CreateSecurityMonitoringIntegrationConfig(ctx _context.Context, body SecurityMonitoringIntegrationConfigCreateRequest) (SecurityMonitoringIntegrationConfigResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue SecurityMonitoringIntegrationConfigResponse + ) + + operationId := "v2.CreateSecurityMonitoringIntegrationConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.CreateSecurityMonitoringIntegrationConfig") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // CreateSecurityMonitoringRule Create a detection rule. // Create a detection rule. func (a *SecurityMonitoringApi) CreateSecurityMonitoringRule(ctx _context.Context, body SecurityMonitoringRuleCreatePayload) (SecurityMonitoringRuleResponse, *_nethttp.Response, error) { @@ -2166,12 +2447,104 @@ func (a *SecurityMonitoringApi) DeleteHistoricalJob(ctx _context.Context, jobId return localVarHTTPResponse, nil } -// DeleteSecurityFilter Delete a security filter. -// Delete a specific security filter. -func (a *SecurityMonitoringApi) DeleteSecurityFilter(ctx _context.Context, securityFilterId string) (*_nethttp.Response, error) { +// DeleteSampleLogGenerationSubscription Unsubscribe from sample log generation. +// Unsubscribe from sample log generation for a Cloud SIEM content pack. +// After unsubscribing, no more sample logs are generated for the requested content pack. +// +// **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an +// eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject +// requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. +func (a *SecurityMonitoringApi) DeleteSampleLogGenerationSubscription(ctx _context.Context, contentPackId string) (SampleLogGenerationSubscriptionResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue SampleLogGenerationSubscriptionResponse + ) + + operationId := "v2.DeleteSampleLogGenerationSubscription" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.DeleteSampleLogGenerationSubscription") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{content_pack_id}", _neturl.PathEscape(datadog.ParameterToString(contentPackId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DeleteSecurityFilter Delete a security filter. +// Delete a specific security filter. +func (a *SecurityMonitoringApi) DeleteSecurityFilter(ctx _context.Context, securityFilterId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} ) localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.DeleteSecurityFilter") @@ -2302,6 +2675,84 @@ func (a *SecurityMonitoringApi) DeleteSecurityMonitoringCriticalAsset(ctx _conte return localVarHTTPResponse, nil } +// DeleteSecurityMonitoringIntegrationConfig Delete an entity context sync configuration. +// Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, +// and the credentials stored for the configuration are removed from the secrets store. +func (a *SecurityMonitoringApi) DeleteSecurityMonitoringIntegrationConfig(ctx _context.Context, integrationConfigId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteSecurityMonitoringIntegrationConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.DeleteSecurityMonitoringIntegrationConfig") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_config_id}", _neturl.PathEscape(datadog.ParameterToString(integrationConfigId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // DeleteSecurityMonitoringRule Delete an existing rule. // Delete an existing rule. Default rules cannot be deleted. func (a *SecurityMonitoringApi) DeleteSecurityMonitoringRule(ctx _context.Context, ruleId string) (*_nethttp.Response, error) { @@ -3321,41 +3772,79 @@ func (a *SecurityMonitoringApi) GetCustomFramework(ctx _context.Context, handle return localVarReturnValue, localVarHTTPResponse, nil } -// GetFindingOptionalParameters holds optional parameters for GetFinding. -type GetFindingOptionalParameters struct { - SnapshotTimestamp *int64 +// GetEntityContextOptionalParameters holds optional parameters for GetEntityContext. +type GetEntityContextOptionalParameters struct { + Query *string + From *string + To *string + AsOf *string + Limit *int64 + PageToken *string } -// NewGetFindingOptionalParameters creates an empty struct for parameters. -func NewGetFindingOptionalParameters() *GetFindingOptionalParameters { - this := GetFindingOptionalParameters{} +// NewGetEntityContextOptionalParameters creates an empty struct for parameters. +func NewGetEntityContextOptionalParameters() *GetEntityContextOptionalParameters { + this := GetEntityContextOptionalParameters{} return &this } -// WithSnapshotTimestamp sets the corresponding parameter name and returns the struct. -func (r *GetFindingOptionalParameters) WithSnapshotTimestamp(snapshotTimestamp int64) *GetFindingOptionalParameters { - r.SnapshotTimestamp = &snapshotTimestamp +// WithQuery sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithQuery(query string) *GetEntityContextOptionalParameters { + r.Query = &query return r } -// GetFinding Get a finding. -// Returns a single finding with message and resource configuration. -func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId string, o ...GetFindingOptionalParameters) (GetFindingResponse, *_nethttp.Response, error) { +// WithFrom sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithFrom(from string) *GetEntityContextOptionalParameters { + r.From = &from + return r +} + +// WithTo sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithTo(to string) *GetEntityContextOptionalParameters { + r.To = &to + return r +} + +// WithAsOf sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithAsOf(asOf string) *GetEntityContextOptionalParameters { + r.AsOf = &asOf + return r +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithLimit(limit int64) *GetEntityContextOptionalParameters { + r.Limit = &limit + return r +} + +// WithPageToken sets the corresponding parameter name and returns the struct. +func (r *GetEntityContextOptionalParameters) WithPageToken(pageToken string) *GetEntityContextOptionalParameters { + r.PageToken = &pageToken + return r +} + +// GetEntityContext Get entity context. +// Search the Cloud SIEM entity context store for entities that match a query, and return the historical +// revisions of each entity in the requested time range. The endpoint can either return revisions across an +// interval (`from` / `to`) or the snapshot of each entity at a single point in time (`as_of`); the two modes +// are mutually exclusive. +func (a *SecurityMonitoringApi) GetEntityContext(ctx _context.Context, o ...GetEntityContextOptionalParameters) (EntityContextResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue GetFindingResponse - optionalParams GetFindingOptionalParameters + localVarReturnValue EntityContextResponse + optionalParams GetEntityContextOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetFindingOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetEntityContextOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - operationId := "v2.GetFinding" + operationId := "v2.GetEntityContext" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -3364,19 +3853,33 @@ func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId strin _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetFinding") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetEntityContext") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/posture_management/findings/{finding_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{finding_id}", _neturl.PathEscape(datadog.ParameterToString(findingId, ""))) + localVarPath := localBasePath + "/api/v2/security_monitoring/entity_context" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.SnapshotTimestamp != nil { - localVarQueryParams.Add("snapshot_timestamp", datadog.ParameterToString(*optionalParams.SnapshotTimestamp, "")) + if optionalParams.Query != nil { + localVarQueryParams.Add("query", datadog.ParameterToString(*optionalParams.Query, "")) + } + if optionalParams.From != nil { + localVarQueryParams.Add("from", datadog.ParameterToString(*optionalParams.From, "")) + } + if optionalParams.To != nil { + localVarQueryParams.Add("to", datadog.ParameterToString(*optionalParams.To, "")) + } + if optionalParams.AsOf != nil { + localVarQueryParams.Add("as_of", datadog.ParameterToString(*optionalParams.AsOf, "")) + } + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.PageToken != nil { + localVarQueryParams.Add("page_token", datadog.ParameterToString(*optionalParams.PageToken, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -3413,8 +3916,8 @@ func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId strin ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v JSONAPIErrorResponse + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -3436,16 +3939,41 @@ func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId strin return localVarReturnValue, localVarHTTPResponse, nil } -// GetHistoricalJob Get a job's details. -// Get a job's details. -func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId string) (HistoricalJobResponse, *_nethttp.Response, error) { +// GetFindingOptionalParameters holds optional parameters for GetFinding. +type GetFindingOptionalParameters struct { + SnapshotTimestamp *int64 +} + +// NewGetFindingOptionalParameters creates an empty struct for parameters. +func NewGetFindingOptionalParameters() *GetFindingOptionalParameters { + this := GetFindingOptionalParameters{} + return &this +} + +// WithSnapshotTimestamp sets the corresponding parameter name and returns the struct. +func (r *GetFindingOptionalParameters) WithSnapshotTimestamp(snapshotTimestamp int64) *GetFindingOptionalParameters { + r.SnapshotTimestamp = &snapshotTimestamp + return r +} + +// GetFinding Get a finding. +// Returns a single finding with message and resource configuration. +func (a *SecurityMonitoringApi) GetFinding(ctx _context.Context, findingId string, o ...GetFindingOptionalParameters) (GetFindingResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue HistoricalJobResponse + localVarReturnValue GetFindingResponse + optionalParams GetFindingOptionalParameters ) - operationId := "v2.GetHistoricalJob" + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetFindingOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetFinding" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -3454,17 +3982,20 @@ func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId str _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetHistoricalJob") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetFinding") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/siem-historical-detections/jobs/{job_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{job_id}", _neturl.PathEscape(datadog.ParameterToString(jobId, ""))) + localVarPath := localBasePath + "/api/v2/posture_management/findings/{finding_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{finding_id}", _neturl.PathEscape(datadog.ParameterToString(findingId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.SnapshotTimestamp != nil { + localVarQueryParams.Add("snapshot_timestamp", datadog.ParameterToString(*optionalParams.SnapshotTimestamp, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -3501,7 +4032,7 @@ func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId str ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -3523,7 +4054,94 @@ func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId str return localVarReturnValue, localVarHTTPResponse, nil } -// GetIndicatorOfCompromise Get an indicator of compromise. +// GetHistoricalJob Get a job's details. +// Get a job's details. +func (a *SecurityMonitoringApi) GetHistoricalJob(ctx _context.Context, jobId string) (HistoricalJobResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue HistoricalJobResponse + ) + + operationId := "v2.GetHistoricalJob" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetHistoricalJob") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/siem-historical-detections/jobs/{job_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{job_id}", _neturl.PathEscape(datadog.ParameterToString(jobId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetIndicatorOfCompromise Get an indicator of compromise. // Get detailed information about a specific indicator of compromise (IoC). func (a *SecurityMonitoringApi) GetIndicatorOfCompromise(ctx _context.Context, indicator string) (GetIoCIndicatorResponse, *_nethttp.Response, error) { var ( @@ -4561,22 +5179,31 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringHistsignalsByJobId(ctx _con return localVarReturnValue, localVarHTTPResponse, nil } -// GetSecurityMonitoringRule Get a rule's details. -// Get a rule's details. -func (a *SecurityMonitoringApi) GetSecurityMonitoringRule(ctx _context.Context, ruleId string) (SecurityMonitoringRuleResponse, *_nethttp.Response, error) { +// GetSecurityMonitoringIntegrationConfig Get an entity context sync configuration. +// Get the details of a specific entity context sync configuration. +func (a *SecurityMonitoringApi) GetSecurityMonitoringIntegrationConfig(ctx _context.Context, integrationConfigId string) (SecurityMonitoringIntegrationConfigResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue SecurityMonitoringRuleResponse + localVarReturnValue SecurityMonitoringIntegrationConfigResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringRule") + operationId := "v2.GetSecurityMonitoringIntegrationConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringIntegrationConfig") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_config_id}", _neturl.PathEscape(datadog.ParameterToString(integrationConfigId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -4616,7 +5243,7 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringRule(ctx _context.Context, ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -4639,22 +5266,22 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringRule(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } -// GetSecurityMonitoringSignal Get a signal's details. -// Get a signal's details. -func (a *SecurityMonitoringApi) GetSecurityMonitoringSignal(ctx _context.Context, signalId string) (SecurityMonitoringSignalResponse, *_nethttp.Response, error) { +// GetSecurityMonitoringRule Get a rule's details. +// Get a rule's details. +func (a *SecurityMonitoringApi) GetSecurityMonitoringRule(ctx _context.Context, ruleId string) (SecurityMonitoringRuleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue SecurityMonitoringSignalResponse + localVarReturnValue SecurityMonitoringRuleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringSignal") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringRule") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) + localVarPath := localBasePath + "/api/v2/security_monitoring/rules/{rule_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_id}", _neturl.PathEscape(datadog.ParameterToString(ruleId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -4694,7 +5321,7 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringSignal(ctx _context.Context ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -4717,22 +5344,22 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringSignal(ctx _context.Context return localVarReturnValue, localVarHTTPResponse, nil } -// GetSecurityMonitoringSuppression Get a suppression rule. -// Get the details of a specific suppression rule. -func (a *SecurityMonitoringApi) GetSecurityMonitoringSuppression(ctx _context.Context, suppressionId string) (SecurityMonitoringSuppressionResponse, *_nethttp.Response, error) { +// GetSecurityMonitoringSignal Get a signal's details. +// Get a signal's details. +func (a *SecurityMonitoringApi) GetSecurityMonitoringSignal(ctx _context.Context, signalId string) (SecurityMonitoringSignalResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue SecurityMonitoringSuppressionResponse + localVarReturnValue SecurityMonitoringSignalResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringSuppression") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringSignal") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) + localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -4795,22 +5422,22 @@ func (a *SecurityMonitoringApi) GetSecurityMonitoringSuppression(ctx _context.Co return localVarReturnValue, localVarHTTPResponse, nil } -// GetSignalNotificationRule Get details of a signal-based notification rule. -// Get the details of a notification rule for security signals. -func (a *SecurityMonitoringApi) GetSignalNotificationRule(ctx _context.Context, id string) (NotificationRuleResponse, *_nethttp.Response, error) { +// GetSecurityMonitoringSuppression Get a suppression rule. +// Get the details of a specific suppression rule. +func (a *SecurityMonitoringApi) GetSecurityMonitoringSuppression(ctx _context.Context, suppressionId string) (SecurityMonitoringSuppressionResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue NotificationRuleResponse + localVarReturnValue SecurityMonitoringSuppressionResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSignalNotificationRule") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSecurityMonitoringSuppression") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security/signals/notification_rules/{id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -4850,7 +5477,7 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRule(ctx _context.Context, ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -4873,25 +5500,63 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRule(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } -// GetSignalNotificationRules Get the list of signal-based notification rules. -// Returns the list of notification rules for security signals. -func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context) (interface{}, *_nethttp.Response, error) { +// GetSignalEntitiesOptionalParameters holds optional parameters for GetSignalEntities. +type GetSignalEntitiesOptionalParameters struct { + Limit *int32 +} + +// NewGetSignalEntitiesOptionalParameters creates an empty struct for parameters. +func NewGetSignalEntitiesOptionalParameters() *GetSignalEntitiesOptionalParameters { + this := GetSignalEntitiesOptionalParameters{} + return &this +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *GetSignalEntitiesOptionalParameters) WithLimit(limit int32) *GetSignalEntitiesOptionalParameters { + r.Limit = &limit + return r +} + +// GetSignalEntities Get entities related to a signal. +// Get the list of entities related to a security signal, captured at the signal's timestamp. +func (a *SecurityMonitoringApi) GetSignalEntities(ctx _context.Context, signalId string, o ...GetSignalEntitiesOptionalParameters) (SignalEntitiesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue interface{} + localVarReturnValue SignalEntitiesResponse + optionalParams GetSignalEntitiesOptionalParameters ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSignalNotificationRules") + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSignalEntitiesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.GetSignalEntities" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSignalEntities") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security/signals/notification_rules" + localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/entities" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -4927,7 +5592,7 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context) ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -4950,22 +5615,22 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context) return localVarReturnValue, localVarHTTPResponse, nil } -// GetSuggestedActionsMatchingSignal Get suggested actions for a signal. -// Get the list of suggested actions for a given security signal. -func (a *SecurityMonitoringApi) GetSuggestedActionsMatchingSignal(ctx _context.Context, signalId string) (SecurityMonitoringSignalSuggestedActionsResponse, *_nethttp.Response, error) { +// GetSignalNotificationRule Get details of a signal-based notification rule. +// Get the details of a notification rule for security signals. +func (a *SecurityMonitoringApi) GetSignalNotificationRule(ctx _context.Context, id string) (NotificationRuleResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue SecurityMonitoringSignalSuggestedActionsResponse + localVarReturnValue NotificationRuleResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSuggestedActionsMatchingSignal") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSignalNotificationRule") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/suggested_actions" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) + localVarPath := localBasePath + "/api/v2/security/signals/notification_rules/{id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -5005,7 +5670,7 @@ func (a *SecurityMonitoringApi) GetSuggestedActionsMatchingSignal(ctx _context.C ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -5028,64 +5693,25 @@ func (a *SecurityMonitoringApi) GetSuggestedActionsMatchingSignal(ctx _context.C return localVarReturnValue, localVarHTTPResponse, nil } -// GetSuppressionVersionHistoryOptionalParameters holds optional parameters for GetSuppressionVersionHistory. -type GetSuppressionVersionHistoryOptionalParameters struct { - PageSize *int64 - PageNumber *int64 -} - -// NewGetSuppressionVersionHistoryOptionalParameters creates an empty struct for parameters. -func NewGetSuppressionVersionHistoryOptionalParameters() *GetSuppressionVersionHistoryOptionalParameters { - this := GetSuppressionVersionHistoryOptionalParameters{} - return &this -} - -// WithPageSize sets the corresponding parameter name and returns the struct. -func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageSize(pageSize int64) *GetSuppressionVersionHistoryOptionalParameters { - r.PageSize = &pageSize - return r -} - -// WithPageNumber sets the corresponding parameter name and returns the struct. -func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageNumber(pageNumber int64) *GetSuppressionVersionHistoryOptionalParameters { - r.PageNumber = &pageNumber - return r -} - -// GetSuppressionVersionHistory Get a suppression's version history. -// Get a suppression's version history. -func (a *SecurityMonitoringApi) GetSuppressionVersionHistory(ctx _context.Context, suppressionId string, o ...GetSuppressionVersionHistoryOptionalParameters) (GetSuppressionVersionHistoryResponse, *_nethttp.Response, error) { +// GetSignalNotificationRules Get the list of signal-based notification rules. +// Returns the list of notification rules for security signals. +func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context) (interface{}, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue GetSuppressionVersionHistoryResponse - optionalParams GetSuppressionVersionHistoryOptionalParameters + localVarReturnValue interface{} ) - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSuppressionVersionHistoryOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSuppressionVersionHistory") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSignalNotificationRules") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) + localVarPath := localBasePath + "/api/v2/security/signals/notification_rules" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.PageSize != nil { - localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) - } - if optionalParams.PageNumber != nil { - localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) - } localVarHeaderParams["Accept"] = "application/json" if a.Client.Cfg.DelegatedTokenConfig != nil { @@ -5121,7 +5747,201 @@ func (a *SecurityMonitoringApi) GetSuppressionVersionHistory(ctx _context.Contex ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetSuggestedActionsMatchingSignal Get suggested actions for a signal. +// Get the list of suggested actions for a given security signal. +func (a *SecurityMonitoringApi) GetSuggestedActionsMatchingSignal(ctx _context.Context, signalId string) (SecurityMonitoringSignalSuggestedActionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SecurityMonitoringSignalSuggestedActionsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSuggestedActionsMatchingSignal") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/signals/{signal_id}/suggested_actions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{signal_id}", _neturl.PathEscape(datadog.ParameterToString(signalId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetSuppressionVersionHistoryOptionalParameters holds optional parameters for GetSuppressionVersionHistory. +type GetSuppressionVersionHistoryOptionalParameters struct { + PageSize *int64 + PageNumber *int64 +} + +// NewGetSuppressionVersionHistoryOptionalParameters creates an empty struct for parameters. +func NewGetSuppressionVersionHistoryOptionalParameters() *GetSuppressionVersionHistoryOptionalParameters { + this := GetSuppressionVersionHistoryOptionalParameters{} + return &this +} + +// WithPageSize sets the corresponding parameter name and returns the struct. +func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageSize(pageSize int64) *GetSuppressionVersionHistoryOptionalParameters { + r.PageSize = &pageSize + return r +} + +// WithPageNumber sets the corresponding parameter name and returns the struct. +func (r *GetSuppressionVersionHistoryOptionalParameters) WithPageNumber(pageNumber int64) *GetSuppressionVersionHistoryOptionalParameters { + r.PageNumber = &pageNumber + return r +} + +// GetSuppressionVersionHistory Get a suppression's version history. +// Get a suppression's version history. +func (a *SecurityMonitoringApi) GetSuppressionVersionHistory(ctx _context.Context, suppressionId string, o ...GetSuppressionVersionHistoryOptionalParameters) (GetSuppressionVersionHistoryResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue GetSuppressionVersionHistoryResponse + optionalParams GetSuppressionVersionHistoryOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSuppressionVersionHistoryOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSuppressionVersionHistory") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{suppression_id}", _neturl.PathEscape(datadog.ParameterToString(suppressionId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageSize != nil { + localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) + } + if optionalParams.PageNumber != nil { + localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -6403,6 +7223,146 @@ func (a *SecurityMonitoringApi) ListMultipleRulesets(ctx _context.Context, body return localVarReturnValue, localVarHTTPResponse, nil } +// ListSampleLogGenerationSubscriptionsOptionalParameters holds optional parameters for ListSampleLogGenerationSubscriptions. +type ListSampleLogGenerationSubscriptionsOptionalParameters struct { + Status *SampleLogGenerationSubscriptionsStatusFilter + StartTimestamp *time.Time + EndTimestamp *time.Time +} + +// NewListSampleLogGenerationSubscriptionsOptionalParameters creates an empty struct for parameters. +func NewListSampleLogGenerationSubscriptionsOptionalParameters() *ListSampleLogGenerationSubscriptionsOptionalParameters { + this := ListSampleLogGenerationSubscriptionsOptionalParameters{} + return &this +} + +// WithStatus sets the corresponding parameter name and returns the struct. +func (r *ListSampleLogGenerationSubscriptionsOptionalParameters) WithStatus(status SampleLogGenerationSubscriptionsStatusFilter) *ListSampleLogGenerationSubscriptionsOptionalParameters { + r.Status = &status + return r +} + +// WithStartTimestamp sets the corresponding parameter name and returns the struct. +func (r *ListSampleLogGenerationSubscriptionsOptionalParameters) WithStartTimestamp(startTimestamp time.Time) *ListSampleLogGenerationSubscriptionsOptionalParameters { + r.StartTimestamp = &startTimestamp + return r +} + +// WithEndTimestamp sets the corresponding parameter name and returns the struct. +func (r *ListSampleLogGenerationSubscriptionsOptionalParameters) WithEndTimestamp(endTimestamp time.Time) *ListSampleLogGenerationSubscriptionsOptionalParameters { + r.EndTimestamp = &endTimestamp + return r +} + +// ListSampleLogGenerationSubscriptions Get sample log generation subscriptions. +// Get the sample log generation subscriptions for the organization. +// Sample log generation injects representative example logs for a given Cloud SIEM content pack into the Logs platform, +// which can be used to test detection rules without onboarding the underlying integration first. +// +// **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an eligible +// pricing model. Other organizations receive a `403 Forbidden` (non-trial orgs) or a `400 Bad Request` +// (feature disabled), and legacy pricing tiers receive a response with `status: not_available`. +func (a *SecurityMonitoringApi) ListSampleLogGenerationSubscriptions(ctx _context.Context, o ...ListSampleLogGenerationSubscriptionsOptionalParameters) (SampleLogGenerationSubscriptionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SampleLogGenerationSubscriptionsResponse + optionalParams ListSampleLogGenerationSubscriptionsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSampleLogGenerationSubscriptionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListSampleLogGenerationSubscriptions" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ListSampleLogGenerationSubscriptions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/sample_log_generation/subscriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Status != nil { + localVarQueryParams.Add("status", datadog.ParameterToString(*optionalParams.Status, "")) + } + if optionalParams.StartTimestamp != nil { + localVarQueryParams.Add("start_timestamp", datadog.ParameterToString(*optionalParams.StartTimestamp, "")) + } + if optionalParams.EndTimestamp != nil { + localVarQueryParams.Add("end_timestamp", datadog.ParameterToString(*optionalParams.EndTimestamp, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // ListScannedAssetsMetadataOptionalParameters holds optional parameters for ListScannedAssetsMetadata. type ListScannedAssetsMetadataOptionalParameters struct { PageToken *string @@ -6619,6 +7579,85 @@ func (a *SecurityMonitoringApi) ListScannedAssetsMetadata(ctx _context.Context, return localVarReturnValue, localVarHTTPResponse, nil } +// ListSecurityFilterVersions Get the version history of security filters. +// Get the configured security filters at each historical version of the configuration. +// Each entry in the response represents the set of all security filters at a given version, +// ordered from the most recent version to the oldest. +func (a *SecurityMonitoringApi) ListSecurityFilterVersions(ctx _context.Context) (SecurityFilterVersionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SecurityFilterVersionsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ListSecurityFilterVersions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/security_filters/versions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // ListSecurityFilters Get all security filters. // Get the list of configured security filters with their definitions. func (a *SecurityMonitoringApi) ListSecurityFilters(ctx _context.Context) (SecurityFiltersResponse, *_nethttp.Response, error) { @@ -7018,30 +8057,161 @@ func (r *ListSecurityMonitoringHistsignalsOptionalParameters) WithPageCursor(pag return r } -// WithPageLimit sets the corresponding parameter name and returns the struct. -func (r *ListSecurityMonitoringHistsignalsOptionalParameters) WithPageLimit(pageLimit int32) *ListSecurityMonitoringHistsignalsOptionalParameters { - r.PageLimit = &pageLimit +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListSecurityMonitoringHistsignalsOptionalParameters) WithPageLimit(pageLimit int32) *ListSecurityMonitoringHistsignalsOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// ListSecurityMonitoringHistsignals List hist signals. +// List hist signals. +func (a *SecurityMonitoringApi) ListSecurityMonitoringHistsignals(ctx _context.Context, o ...ListSecurityMonitoringHistsignalsOptionalParameters) (SecurityMonitoringSignalsListResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SecurityMonitoringSignalsListResponse + optionalParams ListSecurityMonitoringHistsignalsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSecurityMonitoringHistsignalsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListSecurityMonitoringHistsignals" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ListSecurityMonitoringHistsignals") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/siem-historical-detections/histsignals" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FilterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) + } + if optionalParams.FilterFrom != nil { + localVarQueryParams.Add("filter[from]", datadog.ParameterToString(*optionalParams.FilterFrom, "")) + } + if optionalParams.FilterTo != nil { + localVarQueryParams.Add("filter[to]", datadog.ParameterToString(*optionalParams.FilterTo, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) + } + if optionalParams.PageCursor != nil { + localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) + } + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListSecurityMonitoringIntegrationConfigsOptionalParameters holds optional parameters for ListSecurityMonitoringIntegrationConfigs. +type ListSecurityMonitoringIntegrationConfigsOptionalParameters struct { + FilterIntegrationType *SecurityMonitoringIntegrationType +} + +// NewListSecurityMonitoringIntegrationConfigsOptionalParameters creates an empty struct for parameters. +func NewListSecurityMonitoringIntegrationConfigsOptionalParameters() *ListSecurityMonitoringIntegrationConfigsOptionalParameters { + this := ListSecurityMonitoringIntegrationConfigsOptionalParameters{} + return &this +} + +// WithFilterIntegrationType sets the corresponding parameter name and returns the struct. +func (r *ListSecurityMonitoringIntegrationConfigsOptionalParameters) WithFilterIntegrationType(filterIntegrationType SecurityMonitoringIntegrationType) *ListSecurityMonitoringIntegrationConfigsOptionalParameters { + r.FilterIntegrationType = &filterIntegrationType return r } -// ListSecurityMonitoringHistsignals List hist signals. -// List hist signals. -func (a *SecurityMonitoringApi) ListSecurityMonitoringHistsignals(ctx _context.Context, o ...ListSecurityMonitoringHistsignalsOptionalParameters) (SecurityMonitoringSignalsListResponse, *_nethttp.Response, error) { +// ListSecurityMonitoringIntegrationConfigs List entity context sync configurations. +// List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud SIEM +// to an external source that provides entities (for example, users from an identity provider) for use +// in signals and the entity explorer. +func (a *SecurityMonitoringApi) ListSecurityMonitoringIntegrationConfigs(ctx _context.Context, o ...ListSecurityMonitoringIntegrationConfigsOptionalParameters) (SecurityMonitoringIntegrationConfigsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarReturnValue SecurityMonitoringSignalsListResponse - optionalParams ListSecurityMonitoringHistsignalsOptionalParameters + localVarReturnValue SecurityMonitoringIntegrationConfigsResponse + optionalParams ListSecurityMonitoringIntegrationConfigsOptionalParameters ) if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSecurityMonitoringHistsignalsOptionalParameters is allowed") + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSecurityMonitoringIntegrationConfigsOptionalParameters is allowed") } if len(o) == 1 { optionalParams = o[0] } - operationId := "v2.ListSecurityMonitoringHistsignals" + operationId := "v2.ListSecurityMonitoringIntegrationConfigs" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -7050,33 +8220,18 @@ func (a *SecurityMonitoringApi) ListSecurityMonitoringHistsignals(ctx _context.C _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ListSecurityMonitoringHistsignals") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ListSecurityMonitoringIntegrationConfigs") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/siem-historical-detections/histsignals" + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if optionalParams.FilterQuery != nil { - localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) - } - if optionalParams.FilterFrom != nil { - localVarQueryParams.Add("filter[from]", datadog.ParameterToString(*optionalParams.FilterFrom, "")) - } - if optionalParams.FilterTo != nil { - localVarQueryParams.Add("filter[to]", datadog.ParameterToString(*optionalParams.FilterTo, "")) - } - if optionalParams.Sort != nil { - localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "")) - } - if optionalParams.PageCursor != nil { - localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, "")) - } - if optionalParams.PageLimit != nil { - localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + if optionalParams.FilterIntegrationType != nil { + localVarQueryParams.Add("filter[integration_type]", datadog.ParameterToString(*optionalParams.FilterIntegrationType, "")) } localVarHeaderParams["Accept"] = "application/json" @@ -7113,7 +8268,7 @@ func (a *SecurityMonitoringApi) ListSecurityMonitoringHistsignals(ctx _context.C ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -9938,6 +11093,96 @@ func (a *SecurityMonitoringApi) UpdateSecurityMonitoringCriticalAsset(ctx _conte return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateSecurityMonitoringIntegrationConfig Update an entity context sync configuration. +// Update an existing entity context sync configuration. Supports partial updates; only the fields provided in the request body are modified. +func (a *SecurityMonitoringApi) UpdateSecurityMonitoringIntegrationConfig(ctx _context.Context, integrationConfigId string, body SecurityMonitoringIntegrationConfigUpdateRequest) (SecurityMonitoringIntegrationConfigResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue SecurityMonitoringIntegrationConfigResponse + ) + + operationId := "v2.UpdateSecurityMonitoringIntegrationConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.UpdateSecurityMonitoringIntegrationConfig") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_config_id}", _neturl.PathEscape(datadog.ParameterToString(integrationConfigId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // UpdateSecurityMonitoringRule Update an existing rule. // Update an existing rule. When updating `cases`, `queries` or `options`, the whole field // must be included. For example, when modifying a query all queries must be included. @@ -10103,6 +11348,164 @@ func (a *SecurityMonitoringApi) UpdateSecurityMonitoringSuppression(ctx _context return localVarReturnValue, localVarHTTPResponse, nil } +// ValidateSecurityMonitoringIntegrationConfig Validate an entity context sync configuration. +// Validate the credentials currently stored on an existing entity context sync configuration. +// Returns a 200 status code if the credentials are still valid against the external entity source. +func (a *SecurityMonitoringApi) ValidateSecurityMonitoringIntegrationConfig(ctx _context.Context, integrationConfigId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.ValidateSecurityMonitoringIntegrationConfig" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationConfig") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}/validate" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{integration_config_id}", _neturl.PathEscape(datadog.ParameterToString(integrationConfigId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// ValidateSecurityMonitoringIntegrationCredentials Validate entity context sync credentials. +// Validate a set of credentials against the external entity source before creating a sync configuration. +// Returns a 200 status code if the credentials are valid. +func (a *SecurityMonitoringApi) ValidateSecurityMonitoringIntegrationCredentials(ctx _context.Context, body SecurityMonitoringIntegrationCredentialsValidateRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.ValidateSecurityMonitoringIntegrationCredentials" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationCredentials") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/security_monitoring/configuration/integration_config/validate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // ValidateSecurityMonitoringRule Validate a detection rule. // Validate a detection rule. func (a *SecurityMonitoringApi) ValidateSecurityMonitoringRule(ctx _context.Context, body SecurityMonitoringRuleValidatePayload) (*_nethttp.Response, error) { diff --git a/api/datadogV2/api_test_examples.go b/api/datadogV2/api_test_examples.go new file mode 100644 index 00000000000..a3f09677bdf --- /dev/null +++ b/api/datadogV2/api_test_examples.go @@ -0,0 +1,100 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _nethttp "net/http" + _neturl "net/url" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// TestExamplesApi service type +type TestExamplesApi datadog.Service + +// ListTestExamples List test examples. +// Get a list of all test examples. +func (a *TestExamplesApi) ListTestExamples(ctx _context.Context) (TestExamplesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue TestExamplesResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.TestExamplesApi.ListTestExamples") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/test-examples" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewTestExamplesApi Returns NewTestExamplesApi. +func NewTestExamplesApi(client *datadog.APIClient) *TestExamplesApi { + return &TestExamplesApi{ + Client: client, + } +} diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index a93fb008c6a..d0a0bba11f5 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -70,13 +70,26 @@ // - [AgentlessScanningApi.UpdateAzureScanOptions] // - [AgentlessScanningApi.UpdateGcpScanOptions] // - [AppBuilderApi.CreateApp] +// - [AppBuilderApi.CreatePublishRequest] // - [AppBuilderApi.DeleteApp] // - [AppBuilderApi.DeleteApps] // - [AppBuilderApi.GetApp] +// - [AppBuilderApi.GetBlueprint] +// - [AppBuilderApi.GetBlueprintsByIntegrationId] +// - [AppBuilderApi.GetBlueprintsBySlugs] +// - [AppBuilderApi.ListAppVersions] // - [AppBuilderApi.ListApps] +// - [AppBuilderApi.ListBlueprints] +// - [AppBuilderApi.ListTags] // - [AppBuilderApi.PublishApp] +// - [AppBuilderApi.RevertApp] // - [AppBuilderApi.UnpublishApp] // - [AppBuilderApi.UpdateApp] +// - [AppBuilderApi.UpdateAppFavorite] +// - [AppBuilderApi.UpdateAppSelfService] +// - [AppBuilderApi.UpdateAppTags] +// - [AppBuilderApi.UpdateAppVersionName] +// - [AppBuilderApi.UpdateProtectionLevel] // - [ApplicationSecurityApi.CreateApplicationSecurityWafCustomRule] // - [ApplicationSecurityApi.CreateApplicationSecurityWafExclusionFilter] // - [ApplicationSecurityApi.DeleteApplicationSecurityWafCustomRule] @@ -126,45 +139,81 @@ // - [CSMThreatsApi.UpdateCSMThreatsAgentPolicy] // - [CSMThreatsApi.UpdateCSMThreatsAgentRule] // - [CSMThreatsApi.UpdateCloudWorkloadSecurityAgentRule] +// - [CaseManagementApi.AddCaseInsights] +// - [CaseManagementApi.AggregateCases] // - [CaseManagementApi.ArchiveCase] // - [CaseManagementApi.AssignCase] +// - [CaseManagementApi.BulkUpdateCases] // - [CaseManagementApi.CommentCase] +// - [CaseManagementApi.CountCases] // - [CaseManagementApi.CreateCase] +// - [CaseManagementApi.CreateCaseAutomationRule] // - [CaseManagementApi.CreateCaseJiraIssue] +// - [CaseManagementApi.CreateCaseLink] // - [CaseManagementApi.CreateCaseNotebook] // - [CaseManagementApi.CreateCaseServiceNowTicket] +// - [CaseManagementApi.CreateCaseView] +// - [CaseManagementApi.CreateMaintenanceWindow] // - [CaseManagementApi.CreateProject] // - [CaseManagementApi.CreateProjectNotificationRule] +// - [CaseManagementApi.DeleteCaseAutomationRule] // - [CaseManagementApi.DeleteCaseComment] // - [CaseManagementApi.DeleteCaseCustomAttribute] +// - [CaseManagementApi.DeleteCaseLink] +// - [CaseManagementApi.DeleteCaseView] +// - [CaseManagementApi.DeleteMaintenanceWindow] // - [CaseManagementApi.DeleteProject] // - [CaseManagementApi.DeleteProjectNotificationRule] +// - [CaseManagementApi.DisableCaseAutomationRule] +// - [CaseManagementApi.EnableCaseAutomationRule] +// - [CaseManagementApi.FavoriteCaseProject] // - [CaseManagementApi.GetCase] +// - [CaseManagementApi.GetCaseAutomationRule] +// - [CaseManagementApi.GetCaseView] // - [CaseManagementApi.GetProject] // - [CaseManagementApi.GetProjectNotificationRules] // - [CaseManagementApi.GetProjects] // - [CaseManagementApi.LinkIncident] // - [CaseManagementApi.LinkJiraIssueToCase] +// - [CaseManagementApi.ListCaseAutomationRules] +// - [CaseManagementApi.ListCaseLinks] +// - [CaseManagementApi.ListCaseTimeline] +// - [CaseManagementApi.ListCaseViews] +// - [CaseManagementApi.ListCaseWatchers] +// - [CaseManagementApi.ListMaintenanceWindows] +// - [CaseManagementApi.ListUserCaseProjectFavorites] // - [CaseManagementApi.MoveCaseToProject] +// - [CaseManagementApi.RemoveCaseInsights] // - [CaseManagementApi.SearchCases] // - [CaseManagementApi.UnarchiveCase] // - [CaseManagementApi.UnassignCase] +// - [CaseManagementApi.UnfavoriteCaseProject] // - [CaseManagementApi.UnlinkJiraIssue] +// - [CaseManagementApi.UnwatchCase] // - [CaseManagementApi.UpdateAttributes] +// - [CaseManagementApi.UpdateCaseAutomationRule] +// - [CaseManagementApi.UpdateCaseComment] // - [CaseManagementApi.UpdateCaseCustomAttribute] // - [CaseManagementApi.UpdateCaseDescription] +// - [CaseManagementApi.UpdateCaseDueDate] +// - [CaseManagementApi.UpdateCaseResolvedReason] // - [CaseManagementApi.UpdateCaseTitle] +// - [CaseManagementApi.UpdateCaseView] +// - [CaseManagementApi.UpdateMaintenanceWindow] // - [CaseManagementApi.UpdatePriority] // - [CaseManagementApi.UpdateProject] // - [CaseManagementApi.UpdateProjectNotificationRule] // - [CaseManagementApi.UpdateStatus] +// - [CaseManagementApi.WatchCase] // - [CaseManagementAttributeApi.CreateCustomAttributeConfig] // - [CaseManagementAttributeApi.DeleteCustomAttributeConfig] // - [CaseManagementAttributeApi.GetAllCustomAttributeConfigsByCaseType] // - [CaseManagementAttributeApi.GetAllCustomAttributes] +// - [CaseManagementAttributeApi.UpdateCustomAttributeConfig] // - [CaseManagementTypeApi.CreateCaseType] // - [CaseManagementTypeApi.DeleteCaseType] // - [CaseManagementTypeApi.GetAllCaseTypes] +// - [CaseManagementTypeApi.UpdateCaseType] // - [ChangeManagementApi.CreateChangeRequest] // - [ChangeManagementApi.CreateChangeRequestBranch] // - [ChangeManagementApi.DeleteChangeRequestDecision] @@ -188,11 +237,20 @@ // - [CloudCostManagementApi.DeleteCustomCostsFile] // - [CloudCostManagementApi.DeleteTagPipelinesRuleset] // - [CloudCostManagementApi.GetBudget] +// - [CloudCostManagementApi.GetCommitmentsCommitmentList] +// - [CloudCostManagementApi.GetCommitmentsCoverageScalar] +// - [CloudCostManagementApi.GetCommitmentsCoverageTimeseries] +// - [CloudCostManagementApi.GetCommitmentsOnDemandHotspotsScalar] +// - [CloudCostManagementApi.GetCommitmentsSavingsScalar] +// - [CloudCostManagementApi.GetCommitmentsSavingsTimeseries] +// - [CloudCostManagementApi.GetCommitmentsUtilizationScalar] +// - [CloudCostManagementApi.GetCommitmentsUtilizationTimeseries] // - [CloudCostManagementApi.GetCostAWSCURConfig] // - [CloudCostManagementApi.GetCostAnomaly] // - [CloudCostManagementApi.GetCostAzureUCConfig] // - [CloudCostManagementApi.GetCostGCPUsageCostConfig] // - [CloudCostManagementApi.GetCostTagKey] +// - [CloudCostManagementApi.GetCostTagMetadataCurrency] // - [CloudCostManagementApi.GetCustomAllocationRule] // - [CloudCostManagementApi.GetCustomCostsFile] // - [CloudCostManagementApi.GetTagPipelinesRuleset] @@ -203,7 +261,11 @@ // - [CloudCostManagementApi.ListCostGCPUsageCostConfigs] // - [CloudCostManagementApi.ListCostOCIConfigs] // - [CloudCostManagementApi.ListCostTagDescriptions] +// - [CloudCostManagementApi.ListCostTagKeySources] // - [CloudCostManagementApi.ListCostTagKeys] +// - [CloudCostManagementApi.ListCostTagMetadata] +// - [CloudCostManagementApi.ListCostTagMetadataMetrics] +// - [CloudCostManagementApi.ListCostTagMetadataOrchestrators] // - [CloudCostManagementApi.ListCostTags] // - [CloudCostManagementApi.ListCustomAllocationRules] // - [CloudCostManagementApi.ListCustomAllocationRulesStatus] @@ -212,6 +274,7 @@ // - [CloudCostManagementApi.ListTagPipelinesRulesetsStatus] // - [CloudCostManagementApi.ReorderCustomAllocationRules] // - [CloudCostManagementApi.ReorderTagPipelinesRulesets] +// - [CloudCostManagementApi.SearchCostRecommendations] // - [CloudCostManagementApi.UpdateCostAWSCURConfig] // - [CloudCostManagementApi.UpdateCostAzureUCConfigs] // - [CloudCostManagementApi.UpdateCostGCPUsageCostConfig] @@ -231,6 +294,7 @@ // - [CloudflareIntegrationApi.UpdateCloudflareAccount] // - [CodeCoverageApi.GetCodeCoverageBranchSummary] // - [CodeCoverageApi.GetCodeCoverageCommitSummary] +// - [ComplianceApi.GetRuleBasedView] // - [ConfluentCloudApi.CreateConfluentAccount] // - [ConfluentCloudApi.CreateConfluentResource] // - [ConfluentCloudApi.DeleteConfluentAccount] @@ -261,6 +325,8 @@ // - [DashboardSecureEmbedApi.DeleteDashboardSecureEmbed] // - [DashboardSecureEmbedApi.GetDashboardSecureEmbed] // - [DashboardSecureEmbedApi.UpdateDashboardSecureEmbed] +// - [DashboardsApi.GetDashboardUsage] +// - [DashboardsApi.ListDashboardsUsage] // - [DataDeletionApi.CancelDataDeletionRequest] // - [DataDeletionApi.CreateDataDeletionRequest] // - [DataDeletionApi.GetDataDeletionRequests] @@ -289,7 +355,6 @@ // - [DowntimesApi.ListDowntimes] // - [DowntimesApi.ListMonitorDowntimes] // - [DowntimesApi.UpdateDowntime] -// - [EmailTransportApi.CreateEmailTransportWebhookIntake] // - [EntityRiskScoresApi.ListEntityRiskScores] // - [ErrorTrackingApi.DeleteIssueAssignee] // - [ErrorTrackingApi.GetIssue] @@ -453,16 +518,19 @@ // - [KeyManagementApi.UpdatePersonalAccessToken] // - [KeyManagementApi.Validate] // - [KeyManagementApi.ValidateAPIKey] +// - [LLMObservabilityApi.AggregateLLMObsExperimentation] // - [LLMObservabilityApi.CreateLLMObsAnnotationQueue] // - [LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions] // - [LLMObservabilityApi.CreateLLMObsDataset] // - [LLMObservabilityApi.CreateLLMObsDatasetRecords] // - [LLMObservabilityApi.CreateLLMObsExperiment] // - [LLMObservabilityApi.CreateLLMObsExperimentEvents] +// - [LLMObservabilityApi.CreateLLMObsIntegrationInference] // - [LLMObservabilityApi.CreateLLMObsProject] // - [LLMObservabilityApi.DeleteLLMObsAnnotationQueue] // - [LLMObservabilityApi.DeleteLLMObsAnnotationQueueInteractions] // - [LLMObservabilityApi.DeleteLLMObsCustomEvalConfig] +// - [LLMObservabilityApi.DeleteLLMObsData] // - [LLMObservabilityApi.DeleteLLMObsDatasetRecords] // - [LLMObservabilityApi.DeleteLLMObsDatasets] // - [LLMObservabilityApi.DeleteLLMObsExperiments] @@ -473,8 +541,15 @@ // - [LLMObservabilityApi.ListLLMObsAnnotationQueues] // - [LLMObservabilityApi.ListLLMObsDatasetRecords] // - [LLMObservabilityApi.ListLLMObsDatasets] +// - [LLMObservabilityApi.ListLLMObsExperimentEvents] // - [LLMObservabilityApi.ListLLMObsExperiments] +// - [LLMObservabilityApi.ListLLMObsIntegrationAccounts] +// - [LLMObservabilityApi.ListLLMObsIntegrationModels] // - [LLMObservabilityApi.ListLLMObsProjects] +// - [LLMObservabilityApi.ListLLMObsSpans] +// - [LLMObservabilityApi.SearchLLMObsExperimentation] +// - [LLMObservabilityApi.SearchLLMObsSpans] +// - [LLMObservabilityApi.SimpleSearchLLMObsExperimentation] // - [LLMObservabilityApi.UpdateLLMObsAnnotationQueue] // - [LLMObservabilityApi.UpdateLLMObsAnnotationQueueLabelSchema] // - [LLMObservabilityApi.UpdateLLMObsCustomEvalConfig] @@ -544,6 +619,22 @@ // - [MicrosoftTeamsIntegrationApi.ListWorkflowsWebhookHandles] // - [MicrosoftTeamsIntegrationApi.UpdateTenantBasedHandle] // - [MicrosoftTeamsIntegrationApi.UpdateWorkflowsWebhookHandle] +// - [ModelLabAPIApi.DeleteModelLabRun] +// - [ModelLabAPIApi.GetModelLabArtifactContent] +// - [ModelLabAPIApi.GetModelLabProject] +// - [ModelLabAPIApi.GetModelLabRun] +// - [ModelLabAPIApi.ListModelLabProjectArtifacts] +// - [ModelLabAPIApi.ListModelLabProjectFacetKeys] +// - [ModelLabAPIApi.ListModelLabProjectFacetValues] +// - [ModelLabAPIApi.ListModelLabProjects] +// - [ModelLabAPIApi.ListModelLabRunArtifacts] +// - [ModelLabAPIApi.ListModelLabRunFacetKeys] +// - [ModelLabAPIApi.ListModelLabRunFacetValues] +// - [ModelLabAPIApi.ListModelLabRuns] +// - [ModelLabAPIApi.PinModelLabRun] +// - [ModelLabAPIApi.StarModelLabProject] +// - [ModelLabAPIApi.UnpinModelLabRun] +// - [ModelLabAPIApi.UnstarModelLabProject] // - [MonitorsApi.CreateMonitorConfigPolicy] // - [MonitorsApi.CreateMonitorNotificationRule] // - [MonitorsApi.CreateMonitorUserTemplate] @@ -736,6 +827,7 @@ // - [ScorecardsApi.ListScorecardCampaigns] // - [ScorecardsApi.ListScorecardOutcomes] // - [ScorecardsApi.ListScorecardRules] +// - [ScorecardsApi.ListScorecardScores] // - [ScorecardsApi.ListScorecards] // - [ScorecardsApi.UpdateScorecardCampaign] // - [ScorecardsApi.UpdateScorecardOutcomes] @@ -746,6 +838,7 @@ // - [SecurityMonitoringApi.ActivateContentPack] // - [SecurityMonitoringApi.AttachCase] // - [SecurityMonitoringApi.AttachJiraIssue] +// - [SecurityMonitoringApi.BulkCreateSampleLogGenerationSubscriptions] // - [SecurityMonitoringApi.BulkDeleteSecurityMonitoringRules] // - [SecurityMonitoringApi.BulkEditSecurityMonitoringSignals] // - [SecurityMonitoringApi.BulkEditSecurityMonitoringSignalsAssignee] @@ -760,8 +853,10 @@ // - [SecurityMonitoringApi.CreateCases] // - [SecurityMonitoringApi.CreateCustomFramework] // - [SecurityMonitoringApi.CreateJiraIssues] +// - [SecurityMonitoringApi.CreateSampleLogGenerationSubscription] // - [SecurityMonitoringApi.CreateSecurityFilter] // - [SecurityMonitoringApi.CreateSecurityMonitoringCriticalAsset] +// - [SecurityMonitoringApi.CreateSecurityMonitoringIntegrationConfig] // - [SecurityMonitoringApi.CreateSecurityMonitoringRule] // - [SecurityMonitoringApi.CreateSecurityMonitoringSuppression] // - [SecurityMonitoringApi.CreateSignalNotificationRule] @@ -769,8 +864,10 @@ // - [SecurityMonitoringApi.DeactivateContentPack] // - [SecurityMonitoringApi.DeleteCustomFramework] // - [SecurityMonitoringApi.DeleteHistoricalJob] +// - [SecurityMonitoringApi.DeleteSampleLogGenerationSubscription] // - [SecurityMonitoringApi.DeleteSecurityFilter] // - [SecurityMonitoringApi.DeleteSecurityMonitoringCriticalAsset] +// - [SecurityMonitoringApi.DeleteSecurityMonitoringIntegrationConfig] // - [SecurityMonitoringApi.DeleteSecurityMonitoringRule] // - [SecurityMonitoringApi.DeleteSecurityMonitoringSuppression] // - [SecurityMonitoringApi.DeleteSignalNotificationRule] @@ -784,6 +881,7 @@ // - [SecurityMonitoringApi.GetContentPacksStates] // - [SecurityMonitoringApi.GetCriticalAssetsAffectingRule] // - [SecurityMonitoringApi.GetCustomFramework] +// - [SecurityMonitoringApi.GetEntityContext] // - [SecurityMonitoringApi.GetFinding] // - [SecurityMonitoringApi.GetHistoricalJob] // - [SecurityMonitoringApi.GetIndicatorOfCompromise] @@ -796,9 +894,11 @@ // - [SecurityMonitoringApi.GetSecurityMonitoringCriticalAsset] // - [SecurityMonitoringApi.GetSecurityMonitoringHistsignal] // - [SecurityMonitoringApi.GetSecurityMonitoringHistsignalsByJobId] +// - [SecurityMonitoringApi.GetSecurityMonitoringIntegrationConfig] // - [SecurityMonitoringApi.GetSecurityMonitoringRule] // - [SecurityMonitoringApi.GetSecurityMonitoringSignal] // - [SecurityMonitoringApi.GetSecurityMonitoringSuppression] +// - [SecurityMonitoringApi.GetSignalEntities] // - [SecurityMonitoringApi.GetSignalNotificationRule] // - [SecurityMonitoringApi.GetSignalNotificationRules] // - [SecurityMonitoringApi.GetSuggestedActionsMatchingSignal] @@ -812,11 +912,14 @@ // - [SecurityMonitoringApi.ListHistoricalJobs] // - [SecurityMonitoringApi.ListIndicatorsOfCompromise] // - [SecurityMonitoringApi.ListMultipleRulesets] +// - [SecurityMonitoringApi.ListSampleLogGenerationSubscriptions] // - [SecurityMonitoringApi.ListScannedAssetsMetadata] +// - [SecurityMonitoringApi.ListSecurityFilterVersions] // - [SecurityMonitoringApi.ListSecurityFilters] // - [SecurityMonitoringApi.ListSecurityFindings] // - [SecurityMonitoringApi.ListSecurityMonitoringCriticalAssets] // - [SecurityMonitoringApi.ListSecurityMonitoringHistsignals] +// - [SecurityMonitoringApi.ListSecurityMonitoringIntegrationConfigs] // - [SecurityMonitoringApi.ListSecurityMonitoringRules] // - [SecurityMonitoringApi.ListSecurityMonitoringSignals] // - [SecurityMonitoringApi.ListSecurityMonitoringSuppressions] @@ -836,8 +939,11 @@ // - [SecurityMonitoringApi.UpdateResourceEvaluationFilters] // - [SecurityMonitoringApi.UpdateSecurityFilter] // - [SecurityMonitoringApi.UpdateSecurityMonitoringCriticalAsset] +// - [SecurityMonitoringApi.UpdateSecurityMonitoringIntegrationConfig] // - [SecurityMonitoringApi.UpdateSecurityMonitoringRule] // - [SecurityMonitoringApi.UpdateSecurityMonitoringSuppression] +// - [SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationConfig] +// - [SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationCredentials] // - [SecurityMonitoringApi.ValidateSecurityMonitoringRule] // - [SecurityMonitoringApi.ValidateSecurityMonitoringSuppression] // - [SensitiveDataScannerApi.CreateScanningGroup] @@ -1000,6 +1106,7 @@ // - [TeamsApi.UpdateTeamMembership] // - [TeamsApi.UpdateTeamNotificationRule] // - [TeamsApi.UpdateTeamPermissionSetting] +// - [TestExamplesApi.ListTestExamples] // - [TestOptimizationApi.DeleteTestOptimizationServiceSettings] // - [TestOptimizationApi.GetFlakyTestsManagementPolicies] // - [TestOptimizationApi.GetTestOptimizationServiceSettings] diff --git a/api/datadogV2/model_app_builder_list_tags_response.go b/api/datadogV2/model_app_builder_list_tags_response.go new file mode 100644 index 00000000000..fe897c02e86 --- /dev/null +++ b/api/datadogV2/model_app_builder_list_tags_response.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderListTagsResponse The response for listing tags associated with apps. +type AppBuilderListTagsResponse struct { + // An array of tags. + Data []TagData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppBuilderListTagsResponse instantiates a new AppBuilderListTagsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppBuilderListTagsResponse() *AppBuilderListTagsResponse { + this := AppBuilderListTagsResponse{} + return &this +} + +// NewAppBuilderListTagsResponseWithDefaults instantiates a new AppBuilderListTagsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppBuilderListTagsResponseWithDefaults() *AppBuilderListTagsResponse { + this := AppBuilderListTagsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *AppBuilderListTagsResponse) GetData() []TagData { + if o == nil || o.Data == nil { + var ret []TagData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderListTagsResponse) GetDataOk() (*[]TagData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *AppBuilderListTagsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []TagData and assigns it to the Data field. +func (o *AppBuilderListTagsResponse) SetData(v []TagData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppBuilderListTagsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppBuilderListTagsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []TagData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_app_favorite_type.go b/api/datadogV2/model_app_favorite_type.go new file mode 100644 index 00000000000..5fcdda9eb72 --- /dev/null +++ b/api/datadogV2/model_app_favorite_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppFavoriteType The favorite resource type. +type AppFavoriteType string + +// List of AppFavoriteType. +const ( + APPFAVORITETYPE_FAVORITES AppFavoriteType = "favorites" +) + +var allowedAppFavoriteTypeEnumValues = []AppFavoriteType{ + APPFAVORITETYPE_FAVORITES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppFavoriteType) GetAllowedValues() []AppFavoriteType { + return allowedAppFavoriteTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppFavoriteType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppFavoriteType(value) + return nil +} + +// NewAppFavoriteTypeFromValue returns a pointer to a valid AppFavoriteType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppFavoriteTypeFromValue(v string) (*AppFavoriteType, error) { + ev := AppFavoriteType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppFavoriteType: valid values are %v", v, allowedAppFavoriteTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppFavoriteType) IsValid() bool { + for _, existing := range allowedAppFavoriteTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppFavoriteType value. +func (v AppFavoriteType) Ptr() *AppFavoriteType { + return &v +} diff --git a/api/datadogV2/model_app_protection_level.go b/api/datadogV2/model_app_protection_level.go new file mode 100644 index 00000000000..f2e2e35f725 --- /dev/null +++ b/api/datadogV2/model_app_protection_level.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppProtectionLevel The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. +type AppProtectionLevel string + +// List of AppProtectionLevel. +const ( + APPPROTECTIONLEVEL_DIRECT_PUBLISH AppProtectionLevel = "direct_publish" + APPPROTECTIONLEVEL_APPROVAL_REQUIRED AppProtectionLevel = "approval_required" +) + +var allowedAppProtectionLevelEnumValues = []AppProtectionLevel{ + APPPROTECTIONLEVEL_DIRECT_PUBLISH, + APPPROTECTIONLEVEL_APPROVAL_REQUIRED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppProtectionLevel) GetAllowedValues() []AppProtectionLevel { + return allowedAppProtectionLevelEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppProtectionLevel) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppProtectionLevel(value) + return nil +} + +// NewAppProtectionLevelFromValue returns a pointer to a valid AppProtectionLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppProtectionLevelFromValue(v string) (*AppProtectionLevel, error) { + ev := AppProtectionLevel(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppProtectionLevel: valid values are %v", v, allowedAppProtectionLevelEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppProtectionLevel) IsValid() bool { + for _, existing := range allowedAppProtectionLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppProtectionLevel value. +func (v AppProtectionLevel) Ptr() *AppProtectionLevel { + return &v +} diff --git a/api/datadogV2/model_app_protection_level_type.go b/api/datadogV2/model_app_protection_level_type.go new file mode 100644 index 00000000000..68c5f0a42dd --- /dev/null +++ b/api/datadogV2/model_app_protection_level_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppProtectionLevelType The protection-level resource type. +type AppProtectionLevelType string + +// List of AppProtectionLevelType. +const ( + APPPROTECTIONLEVELTYPE_PROTECTIONLEVEL AppProtectionLevelType = "protectionLevel" +) + +var allowedAppProtectionLevelTypeEnumValues = []AppProtectionLevelType{ + APPPROTECTIONLEVELTYPE_PROTECTIONLEVEL, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppProtectionLevelType) GetAllowedValues() []AppProtectionLevelType { + return allowedAppProtectionLevelTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppProtectionLevelType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppProtectionLevelType(value) + return nil +} + +// NewAppProtectionLevelTypeFromValue returns a pointer to a valid AppProtectionLevelType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppProtectionLevelTypeFromValue(v string) (*AppProtectionLevelType, error) { + ev := AppProtectionLevelType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppProtectionLevelType: valid values are %v", v, allowedAppProtectionLevelTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppProtectionLevelType) IsValid() bool { + for _, existing := range allowedAppProtectionLevelTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppProtectionLevelType value. +func (v AppProtectionLevelType) Ptr() *AppProtectionLevelType { + return &v +} diff --git a/api/datadogV2/model_app_self_service_type.go b/api/datadogV2/model_app_self_service_type.go new file mode 100644 index 00000000000..8a5a91c7773 --- /dev/null +++ b/api/datadogV2/model_app_self_service_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppSelfServiceType The self-service resource type. +type AppSelfServiceType string + +// List of AppSelfServiceType. +const ( + APPSELFSERVICETYPE_SELFSERVICE AppSelfServiceType = "selfService" +) + +var allowedAppSelfServiceTypeEnumValues = []AppSelfServiceType{ + APPSELFSERVICETYPE_SELFSERVICE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppSelfServiceType) GetAllowedValues() []AppSelfServiceType { + return allowedAppSelfServiceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppSelfServiceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppSelfServiceType(value) + return nil +} + +// NewAppSelfServiceTypeFromValue returns a pointer to a valid AppSelfServiceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppSelfServiceTypeFromValue(v string) (*AppSelfServiceType, error) { + ev := AppSelfServiceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppSelfServiceType: valid values are %v", v, allowedAppSelfServiceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppSelfServiceType) IsValid() bool { + for _, existing := range allowedAppSelfServiceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppSelfServiceType value. +func (v AppSelfServiceType) Ptr() *AppSelfServiceType { + return &v +} diff --git a/api/datadogV2/model_app_tags_type.go b/api/datadogV2/model_app_tags_type.go new file mode 100644 index 00000000000..2442982759b --- /dev/null +++ b/api/datadogV2/model_app_tags_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppTagsType The tags resource type. +type AppTagsType string + +// List of AppTagsType. +const ( + APPTAGSTYPE_TAGS AppTagsType = "tags" +) + +var allowedAppTagsTypeEnumValues = []AppTagsType{ + APPTAGSTYPE_TAGS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppTagsType) GetAllowedValues() []AppTagsType { + return allowedAppTagsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppTagsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppTagsType(value) + return nil +} + +// NewAppTagsTypeFromValue returns a pointer to a valid AppTagsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppTagsTypeFromValue(v string) (*AppTagsType, error) { + ev := AppTagsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppTagsType: valid values are %v", v, allowedAppTagsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppTagsType) IsValid() bool { + for _, existing := range allowedAppTagsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppTagsType value. +func (v AppTagsType) Ptr() *AppTagsType { + return &v +} diff --git a/api/datadogV2/model_app_version.go b/api/datadogV2/model_app_version.go new file mode 100644 index 00000000000..91593c7aa58 --- /dev/null +++ b/api/datadogV2/model_app_version.go @@ -0,0 +1,191 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppVersion A version of an app. +type AppVersion struct { + // Attributes describing an app version. + Attributes *AppVersionAttributes `json:"attributes,omitempty"` + // The ID of the app version. + Id *uuid.UUID `json:"id,omitempty"` + // The app-version resource type. + Type *AppVersionType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppVersion instantiates a new AppVersion object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppVersion() *AppVersion { + this := AppVersion{} + var typeVar AppVersionType = APPVERSIONTYPE_APPVERSIONS + this.Type = &typeVar + return &this +} + +// NewAppVersionWithDefaults instantiates a new AppVersion object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppVersionWithDefaults() *AppVersion { + this := AppVersion{} + var typeVar AppVersionType = APPVERSIONTYPE_APPVERSIONS + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *AppVersion) GetAttributes() AppVersionAttributes { + if o == nil || o.Attributes == nil { + var ret AppVersionAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersion) GetAttributesOk() (*AppVersionAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *AppVersion) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given AppVersionAttributes and assigns it to the Attributes field. +func (o *AppVersion) SetAttributes(v AppVersionAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AppVersion) GetId() uuid.UUID { + if o == nil || o.Id == nil { + var ret uuid.UUID + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersion) GetIdOk() (*uuid.UUID, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AppVersion) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *AppVersion) SetId(v uuid.UUID) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *AppVersion) GetType() AppVersionType { + if o == nil || o.Type == nil { + var ret AppVersionType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersion) GetTypeOk() (*AppVersionType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *AppVersion) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppVersionType and assigns it to the Type field. +func (o *AppVersion) SetType(v AppVersionType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppVersion) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppVersion) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *AppVersionAttributes `json:"attributes,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Type *AppVersionType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_app_version_attributes.go b/api/datadogV2/model_app_version_attributes.go new file mode 100644 index 00000000000..0764f6c0067 --- /dev/null +++ b/api/datadogV2/model_app_version_attributes.go @@ -0,0 +1,394 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "time" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppVersionAttributes Attributes describing an app version. +type AppVersionAttributes struct { + // The ID of the app this version belongs to. + AppId *uuid.UUID `json:"app_id,omitempty"` + // Timestamp of when the version was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Whether this version has ever been published. + HasEverBeenPublished *bool `json:"has_ever_been_published,omitempty"` + // The optional human-readable name of the version. + Name *string `json:"name,omitempty"` + // Timestamp of when the version was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // The ID of the user who created the version. + UserId *int64 `json:"user_id,omitempty"` + // The name (or email) of the user who created the version. + UserName *string `json:"user_name,omitempty"` + // The UUID of the user who created the version. + UserUuid *uuid.UUID `json:"user_uuid,omitempty"` + // The version number of the app, starting at 1. + Version *int64 `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppVersionAttributes instantiates a new AppVersionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppVersionAttributes() *AppVersionAttributes { + this := AppVersionAttributes{} + return &this +} + +// NewAppVersionAttributesWithDefaults instantiates a new AppVersionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppVersionAttributesWithDefaults() *AppVersionAttributes { + this := AppVersionAttributes{} + return &this +} + +// GetAppId returns the AppId field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetAppId() uuid.UUID { + if o == nil || o.AppId == nil { + var ret uuid.UUID + return ret + } + return *o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetAppIdOk() (*uuid.UUID, bool) { + if o == nil || o.AppId == nil { + return nil, false + } + return o.AppId, true +} + +// HasAppId returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasAppId() bool { + return o != nil && o.AppId != nil +} + +// SetAppId gets a reference to the given uuid.UUID and assigns it to the AppId field. +func (o *AppVersionAttributes) SetAppId(v uuid.UUID) { + o.AppId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AppVersionAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetHasEverBeenPublished returns the HasEverBeenPublished field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetHasEverBeenPublished() bool { + if o == nil || o.HasEverBeenPublished == nil { + var ret bool + return ret + } + return *o.HasEverBeenPublished +} + +// GetHasEverBeenPublishedOk returns a tuple with the HasEverBeenPublished field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetHasEverBeenPublishedOk() (*bool, bool) { + if o == nil || o.HasEverBeenPublished == nil { + return nil, false + } + return o.HasEverBeenPublished, true +} + +// HasHasEverBeenPublished returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasHasEverBeenPublished() bool { + return o != nil && o.HasEverBeenPublished != nil +} + +// SetHasEverBeenPublished gets a reference to the given bool and assigns it to the HasEverBeenPublished field. +func (o *AppVersionAttributes) SetHasEverBeenPublished(v bool) { + o.HasEverBeenPublished = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AppVersionAttributes) SetName(v string) { + o.Name = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt == nil { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || o.UpdatedAt == nil { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasUpdatedAt() bool { + return o != nil && o.UpdatedAt != nil +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AppVersionAttributes) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetUserId() int64 { + if o == nil || o.UserId == nil { + var ret int64 + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetUserIdOk() (*int64, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasUserId() bool { + return o != nil && o.UserId != nil +} + +// SetUserId gets a reference to the given int64 and assigns it to the UserId field. +func (o *AppVersionAttributes) SetUserId(v int64) { + o.UserId = &v +} + +// GetUserName returns the UserName field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetUserName() string { + if o == nil || o.UserName == nil { + var ret string + return ret + } + return *o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetUserNameOk() (*string, bool) { + if o == nil || o.UserName == nil { + return nil, false + } + return o.UserName, true +} + +// HasUserName returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasUserName() bool { + return o != nil && o.UserName != nil +} + +// SetUserName gets a reference to the given string and assigns it to the UserName field. +func (o *AppVersionAttributes) SetUserName(v string) { + o.UserName = &v +} + +// GetUserUuid returns the UserUuid field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetUserUuid() uuid.UUID { + if o == nil || o.UserUuid == nil { + var ret uuid.UUID + return ret + } + return *o.UserUuid +} + +// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetUserUuidOk() (*uuid.UUID, bool) { + if o == nil || o.UserUuid == nil { + return nil, false + } + return o.UserUuid, true +} + +// HasUserUuid returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasUserUuid() bool { + return o != nil && o.UserUuid != nil +} + +// SetUserUuid gets a reference to the given uuid.UUID and assigns it to the UserUuid field. +func (o *AppVersionAttributes) SetUserUuid(v uuid.UUID) { + o.UserUuid = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *AppVersionAttributes) GetVersion() int64 { + if o == nil || o.Version == nil { + var ret int64 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppVersionAttributes) GetVersionOk() (*int64, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *AppVersionAttributes) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given int64 and assigns it to the Version field. +func (o *AppVersionAttributes) SetVersion(v int64) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppVersionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AppId != nil { + toSerialize["app_id"] = o.AppId + } + if o.CreatedAt != nil { + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.HasEverBeenPublished != nil { + toSerialize["has_ever_been_published"] = o.HasEverBeenPublished + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.UpdatedAt != nil { + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.UserName != nil { + toSerialize["user_name"] = o.UserName + } + if o.UserUuid != nil { + toSerialize["user_uuid"] = o.UserUuid + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppVersionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AppId *uuid.UUID `json:"app_id,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + HasEverBeenPublished *bool `json:"has_ever_been_published,omitempty"` + Name *string `json:"name,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + UserId *int64 `json:"user_id,omitempty"` + UserName *string `json:"user_name,omitempty"` + UserUuid *uuid.UUID `json:"user_uuid,omitempty"` + Version *int64 `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"app_id", "created_at", "has_ever_been_published", "name", "updated_at", "user_id", "user_name", "user_uuid", "version"}) + } else { + return err + } + o.AppId = all.AppId + o.CreatedAt = all.CreatedAt + o.HasEverBeenPublished = all.HasEverBeenPublished + o.Name = all.Name + o.UpdatedAt = all.UpdatedAt + o.UserId = all.UserId + o.UserName = all.UserName + o.UserUuid = all.UserUuid + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_app_version_name_type.go b/api/datadogV2/model_app_version_name_type.go new file mode 100644 index 00000000000..7dc52bde5cd --- /dev/null +++ b/api/datadogV2/model_app_version_name_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppVersionNameType The version-name resource type. +type AppVersionNameType string + +// List of AppVersionNameType. +const ( + APPVERSIONNAMETYPE_VERSIONNAMES AppVersionNameType = "versionNames" +) + +var allowedAppVersionNameTypeEnumValues = []AppVersionNameType{ + APPVERSIONNAMETYPE_VERSIONNAMES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppVersionNameType) GetAllowedValues() []AppVersionNameType { + return allowedAppVersionNameTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppVersionNameType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppVersionNameType(value) + return nil +} + +// NewAppVersionNameTypeFromValue returns a pointer to a valid AppVersionNameType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppVersionNameTypeFromValue(v string) (*AppVersionNameType, error) { + ev := AppVersionNameType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppVersionNameType: valid values are %v", v, allowedAppVersionNameTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppVersionNameType) IsValid() bool { + for _, existing := range allowedAppVersionNameTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppVersionNameType value. +func (v AppVersionNameType) Ptr() *AppVersionNameType { + return &v +} diff --git a/api/datadogV2/model_app_version_type.go b/api/datadogV2/model_app_version_type.go new file mode 100644 index 00000000000..098d0868645 --- /dev/null +++ b/api/datadogV2/model_app_version_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppVersionType The app-version resource type. +type AppVersionType string + +// List of AppVersionType. +const ( + APPVERSIONTYPE_APPVERSIONS AppVersionType = "appVersions" +) + +var allowedAppVersionTypeEnumValues = []AppVersionType{ + APPVERSIONTYPE_APPVERSIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppVersionType) GetAllowedValues() []AppVersionType { + return allowedAppVersionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppVersionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppVersionType(value) + return nil +} + +// NewAppVersionTypeFromValue returns a pointer to a valid AppVersionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppVersionTypeFromValue(v string) (*AppVersionType, error) { + ev := AppVersionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppVersionType: valid values are %v", v, allowedAppVersionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppVersionType) IsValid() bool { + for _, existing := range allowedAppVersionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppVersionType value. +func (v AppVersionType) Ptr() *AppVersionType { + return &v +} diff --git a/api/datadogV2/model_automation_rule.go b/api/datadogV2/model_automation_rule.go new file mode 100644 index 00000000000..d07e950f603 --- /dev/null +++ b/api/datadogV2/model_automation_rule.go @@ -0,0 +1,218 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRule An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project. +type AutomationRule struct { + // Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. + Attributes AutomationRuleAttributes `json:"attributes"` + // Automation rule identifier. + Id string `json:"id"` + // Related resources for the automation rule, including the users who created and last modified it. + Relationships *AutomationRuleRelationships `json:"relationships,omitempty"` + // JSON:API resource type for case automation rules. + Type CaseAutomationRuleResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRule instantiates a new AutomationRule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRule(attributes AutomationRuleAttributes, id string, typeVar CaseAutomationRuleResourceType) *AutomationRule { + this := AutomationRule{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewAutomationRuleWithDefaults instantiates a new AutomationRule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleWithDefaults() *AutomationRule { + this := AutomationRule{} + var typeVar CaseAutomationRuleResourceType = CASEAUTOMATIONRULERESOURCETYPE_RULE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *AutomationRule) GetAttributes() AutomationRuleAttributes { + if o == nil { + var ret AutomationRuleAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *AutomationRule) GetAttributesOk() (*AutomationRuleAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *AutomationRule) SetAttributes(v AutomationRuleAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *AutomationRule) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *AutomationRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *AutomationRule) SetId(v string) { + o.Id = v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *AutomationRule) GetRelationships() AutomationRuleRelationships { + if o == nil || o.Relationships == nil { + var ret AutomationRuleRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRule) GetRelationshipsOk() (*AutomationRuleRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *AutomationRule) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given AutomationRuleRelationships and assigns it to the Relationships field. +func (o *AutomationRule) SetRelationships(v AutomationRuleRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value. +func (o *AutomationRule) GetType() CaseAutomationRuleResourceType { + if o == nil { + var ret CaseAutomationRuleResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AutomationRule) GetTypeOk() (*CaseAutomationRuleResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *AutomationRule) SetType(v CaseAutomationRuleResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *AutomationRuleAttributes `json:"attributes"` + Id *string `json:"id"` + Relationships *AutomationRuleRelationships `json:"relationships,omitempty"` + Type *CaseAutomationRuleResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_action.go b/api/datadogV2/model_automation_rule_action.go new file mode 100644 index 00000000000..33f6fb3a616 --- /dev/null +++ b/api/datadogV2/model_automation_rule_action.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleAction Defines what happens when the rule triggers. Combines an action type with action-specific configuration data. +type AutomationRuleAction struct { + // Configuration for the action to execute, dependent on the action type. + Data AutomationRuleActionData `json:"data"` + // The type of automated action to perform when the rule triggers. `execute_workflow` runs a Datadog workflow; `assign_agent` assigns an AI agent to the case. + Type AutomationRuleActionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleAction instantiates a new AutomationRuleAction object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleAction(data AutomationRuleActionData, typeVar AutomationRuleActionType) *AutomationRuleAction { + this := AutomationRuleAction{} + this.Data = data + this.Type = typeVar + return &this +} + +// NewAutomationRuleActionWithDefaults instantiates a new AutomationRuleAction object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleActionWithDefaults() *AutomationRuleAction { + this := AutomationRuleAction{} + return &this +} + +// GetData returns the Data field value. +func (o *AutomationRuleAction) GetData() AutomationRuleActionData { + if o == nil { + var ret AutomationRuleActionData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAction) GetDataOk() (*AutomationRuleActionData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *AutomationRuleAction) SetData(v AutomationRuleActionData) { + o.Data = v +} + +// GetType returns the Type field value. +func (o *AutomationRuleAction) GetType() AutomationRuleActionType { + if o == nil { + var ret AutomationRuleActionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAction) GetTypeOk() (*AutomationRuleActionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *AutomationRuleAction) SetType(v AutomationRuleActionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleAction) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleAction) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *AutomationRuleActionData `json:"data"` + Type *AutomationRuleActionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_action_data.go b/api/datadogV2/model_automation_rule_action_data.go new file mode 100644 index 00000000000..a97a00cca8a --- /dev/null +++ b/api/datadogV2/model_automation_rule_action_data.go @@ -0,0 +1,172 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleActionData Configuration for the action to execute, dependent on the action type. +type AutomationRuleActionData struct { + // The type of AI agent to assign. Required when the action type is `assign_agent`. + AgentType *string `json:"agent_type,omitempty"` + // The identifier of the AI agent to assign to the case. Required when the action type is `assign_agent`. + AssignedAgentId *string `json:"assigned_agent_id,omitempty"` + // The handle of the Datadog workflow to execute. Required when the action type is `execute_workflow`. + Handle *string `json:"handle,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleActionData instantiates a new AutomationRuleActionData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleActionData() *AutomationRuleActionData { + this := AutomationRuleActionData{} + return &this +} + +// NewAutomationRuleActionDataWithDefaults instantiates a new AutomationRuleActionData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleActionDataWithDefaults() *AutomationRuleActionData { + this := AutomationRuleActionData{} + return &this +} + +// GetAgentType returns the AgentType field value if set, zero value otherwise. +func (o *AutomationRuleActionData) GetAgentType() string { + if o == nil || o.AgentType == nil { + var ret string + return ret + } + return *o.AgentType +} + +// GetAgentTypeOk returns a tuple with the AgentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleActionData) GetAgentTypeOk() (*string, bool) { + if o == nil || o.AgentType == nil { + return nil, false + } + return o.AgentType, true +} + +// HasAgentType returns a boolean if a field has been set. +func (o *AutomationRuleActionData) HasAgentType() bool { + return o != nil && o.AgentType != nil +} + +// SetAgentType gets a reference to the given string and assigns it to the AgentType field. +func (o *AutomationRuleActionData) SetAgentType(v string) { + o.AgentType = &v +} + +// GetAssignedAgentId returns the AssignedAgentId field value if set, zero value otherwise. +func (o *AutomationRuleActionData) GetAssignedAgentId() string { + if o == nil || o.AssignedAgentId == nil { + var ret string + return ret + } + return *o.AssignedAgentId +} + +// GetAssignedAgentIdOk returns a tuple with the AssignedAgentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleActionData) GetAssignedAgentIdOk() (*string, bool) { + if o == nil || o.AssignedAgentId == nil { + return nil, false + } + return o.AssignedAgentId, true +} + +// HasAssignedAgentId returns a boolean if a field has been set. +func (o *AutomationRuleActionData) HasAssignedAgentId() bool { + return o != nil && o.AssignedAgentId != nil +} + +// SetAssignedAgentId gets a reference to the given string and assigns it to the AssignedAgentId field. +func (o *AutomationRuleActionData) SetAssignedAgentId(v string) { + o.AssignedAgentId = &v +} + +// GetHandle returns the Handle field value if set, zero value otherwise. +func (o *AutomationRuleActionData) GetHandle() string { + if o == nil || o.Handle == nil { + var ret string + return ret + } + return *o.Handle +} + +// GetHandleOk returns a tuple with the Handle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleActionData) GetHandleOk() (*string, bool) { + if o == nil || o.Handle == nil { + return nil, false + } + return o.Handle, true +} + +// HasHandle returns a boolean if a field has been set. +func (o *AutomationRuleActionData) HasHandle() bool { + return o != nil && o.Handle != nil +} + +// SetHandle gets a reference to the given string and assigns it to the Handle field. +func (o *AutomationRuleActionData) SetHandle(v string) { + o.Handle = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleActionData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AgentType != nil { + toSerialize["agent_type"] = o.AgentType + } + if o.AssignedAgentId != nil { + toSerialize["assigned_agent_id"] = o.AssignedAgentId + } + if o.Handle != nil { + toSerialize["handle"] = o.Handle + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleActionData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AgentType *string `json:"agent_type,omitempty"` + AssignedAgentId *string `json:"assigned_agent_id,omitempty"` + Handle *string `json:"handle,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"agent_type", "assigned_agent_id", "handle"}) + } else { + return err + } + o.AgentType = all.AgentType + o.AssignedAgentId = all.AssignedAgentId + o.Handle = all.Handle + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_action_type.go b/api/datadogV2/model_automation_rule_action_type.go new file mode 100644 index 00000000000..87a2c048d99 --- /dev/null +++ b/api/datadogV2/model_automation_rule_action_type.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleActionType The type of automated action to perform when the rule triggers. `execute_workflow` runs a Datadog workflow; `assign_agent` assigns an AI agent to the case. +type AutomationRuleActionType string + +// List of AutomationRuleActionType. +const ( + AUTOMATIONRULEACTIONTYPE_EXECUTE_WORKFLOW AutomationRuleActionType = "execute_workflow" + AUTOMATIONRULEACTIONTYPE_ASSIGN_AGENT AutomationRuleActionType = "assign_agent" +) + +var allowedAutomationRuleActionTypeEnumValues = []AutomationRuleActionType{ + AUTOMATIONRULEACTIONTYPE_EXECUTE_WORKFLOW, + AUTOMATIONRULEACTIONTYPE_ASSIGN_AGENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AutomationRuleActionType) GetAllowedValues() []AutomationRuleActionType { + return allowedAutomationRuleActionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AutomationRuleActionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AutomationRuleActionType(value) + return nil +} + +// NewAutomationRuleActionTypeFromValue returns a pointer to a valid AutomationRuleActionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAutomationRuleActionTypeFromValue(v string) (*AutomationRuleActionType, error) { + ev := AutomationRuleActionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AutomationRuleActionType: valid values are %v", v, allowedAutomationRuleActionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AutomationRuleActionType) IsValid() bool { + for _, existing := range allowedAutomationRuleActionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AutomationRuleActionType value. +func (v AutomationRuleActionType) Ptr() *AutomationRuleActionType { + return &v +} diff --git a/api/datadogV2/model_automation_rule_attributes.go b/api/datadogV2/model_automation_rule_attributes.go new file mode 100644 index 00000000000..95840f521d1 --- /dev/null +++ b/api/datadogV2/model_automation_rule_attributes.go @@ -0,0 +1,289 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleAttributes Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. +type AutomationRuleAttributes struct { + // Defines what happens when the rule triggers. Combines an action type with action-specific configuration data. + Action AutomationRuleAction `json:"action"` + // Timestamp when the automation rule was created. + CreatedAt time.Time `json:"created_at"` + // Timestamp when the automation rule was last modified. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // A human-readable name for the automation rule, used to identify the rule in the UI and API responses. + Name string `json:"name"` + // Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. + State CaseAutomationRuleState `json:"state"` + // Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). + Trigger AutomationRuleTrigger `json:"trigger"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleAttributes instantiates a new AutomationRuleAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleAttributes(action AutomationRuleAction, createdAt time.Time, name string, state CaseAutomationRuleState, trigger AutomationRuleTrigger) *AutomationRuleAttributes { + this := AutomationRuleAttributes{} + this.Action = action + this.CreatedAt = createdAt + this.Name = name + this.State = state + this.Trigger = trigger + return &this +} + +// NewAutomationRuleAttributesWithDefaults instantiates a new AutomationRuleAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleAttributesWithDefaults() *AutomationRuleAttributes { + this := AutomationRuleAttributes{} + return &this +} + +// GetAction returns the Action field value. +func (o *AutomationRuleAttributes) GetAction() AutomationRuleAction { + if o == nil { + var ret AutomationRuleAction + return ret + } + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetActionOk() (*AutomationRuleAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value. +func (o *AutomationRuleAttributes) SetAction(v AutomationRuleAction) { + o.Action = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *AutomationRuleAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *AutomationRuleAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise. +func (o *AutomationRuleAttributes) GetModifiedAt() time.Time { + if o == nil || o.ModifiedAt == nil { + var ret time.Time + return ret + } + return *o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetModifiedAtOk() (*time.Time, bool) { + if o == nil || o.ModifiedAt == nil { + return nil, false + } + return o.ModifiedAt, true +} + +// HasModifiedAt returns a boolean if a field has been set. +func (o *AutomationRuleAttributes) HasModifiedAt() bool { + return o != nil && o.ModifiedAt != nil +} + +// SetModifiedAt gets a reference to the given time.Time and assigns it to the ModifiedAt field. +func (o *AutomationRuleAttributes) SetModifiedAt(v time.Time) { + o.ModifiedAt = &v +} + +// GetName returns the Name field value. +func (o *AutomationRuleAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *AutomationRuleAttributes) SetName(v string) { + o.Name = v +} + +// GetState returns the State field value. +func (o *AutomationRuleAttributes) GetState() CaseAutomationRuleState { + if o == nil { + var ret CaseAutomationRuleState + return ret + } + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetStateOk() (*CaseAutomationRuleState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value. +func (o *AutomationRuleAttributes) SetState(v CaseAutomationRuleState) { + o.State = v +} + +// GetTrigger returns the Trigger field value. +func (o *AutomationRuleAttributes) GetTrigger() AutomationRuleTrigger { + if o == nil { + var ret AutomationRuleTrigger + return ret + } + return o.Trigger +} + +// GetTriggerOk returns a tuple with the Trigger field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleAttributes) GetTriggerOk() (*AutomationRuleTrigger, bool) { + if o == nil { + return nil, false + } + return &o.Trigger, true +} + +// SetTrigger sets field value. +func (o *AutomationRuleAttributes) SetTrigger(v AutomationRuleTrigger) { + o.Trigger = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["action"] = o.Action + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.ModifiedAt != nil { + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + toSerialize["name"] = o.Name + toSerialize["state"] = o.State + toSerialize["trigger"] = o.Trigger + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Action *AutomationRuleAction `json:"action"` + CreatedAt *time.Time `json:"created_at"` + ModifiedAt *time.Time `json:"modified_at,omitempty"` + Name *string `json:"name"` + State *CaseAutomationRuleState `json:"state"` + Trigger *AutomationRuleTrigger `json:"trigger"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Action == nil { + return fmt.Errorf("required field action missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.State == nil { + return fmt.Errorf("required field state missing") + } + if all.Trigger == nil { + return fmt.Errorf("required field trigger missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"action", "created_at", "modified_at", "name", "state", "trigger"}) + } else { + return err + } + + hasInvalidField := false + if all.Action.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Action = *all.Action + o.CreatedAt = *all.CreatedAt + o.ModifiedAt = all.ModifiedAt + o.Name = *all.Name + if !all.State.IsValid() { + hasInvalidField = true + } else { + o.State = *all.State + } + if all.Trigger.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Trigger = *all.Trigger + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_create.go b/api/datadogV2/model_automation_rule_create.go new file mode 100644 index 00000000000..b7c11720852 --- /dev/null +++ b/api/datadogV2/model_automation_rule_create.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleCreate Data object for creating an automation rule. +type AutomationRuleCreate struct { + // Attributes required to create an automation rule. + Attributes AutomationRuleCreateAttributes `json:"attributes"` + // JSON:API resource type for case automation rules. + Type CaseAutomationRuleResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleCreate instantiates a new AutomationRuleCreate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleCreate(attributes AutomationRuleCreateAttributes, typeVar CaseAutomationRuleResourceType) *AutomationRuleCreate { + this := AutomationRuleCreate{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewAutomationRuleCreateWithDefaults instantiates a new AutomationRuleCreate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleCreateWithDefaults() *AutomationRuleCreate { + this := AutomationRuleCreate{} + var typeVar CaseAutomationRuleResourceType = CASEAUTOMATIONRULERESOURCETYPE_RULE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *AutomationRuleCreate) GetAttributes() AutomationRuleCreateAttributes { + if o == nil { + var ret AutomationRuleCreateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreate) GetAttributesOk() (*AutomationRuleCreateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *AutomationRuleCreate) SetAttributes(v AutomationRuleCreateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *AutomationRuleCreate) GetType() CaseAutomationRuleResourceType { + if o == nil { + var ret CaseAutomationRuleResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreate) GetTypeOk() (*CaseAutomationRuleResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *AutomationRuleCreate) SetType(v CaseAutomationRuleResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleCreate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleCreate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *AutomationRuleCreateAttributes `json:"attributes"` + Type *CaseAutomationRuleResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_create_attributes.go b/api/datadogV2/model_automation_rule_create_attributes.go new file mode 100644 index 00000000000..841db797333 --- /dev/null +++ b/api/datadogV2/model_automation_rule_create_attributes.go @@ -0,0 +1,216 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleCreateAttributes Attributes required to create an automation rule. +type AutomationRuleCreateAttributes struct { + // Defines what happens when the rule triggers. Combines an action type with action-specific configuration data. + Action AutomationRuleAction `json:"action"` + // Name of the automation rule. + Name string `json:"name"` + // Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. + State *CaseAutomationRuleState `json:"state,omitempty"` + // Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). + Trigger AutomationRuleTrigger `json:"trigger"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleCreateAttributes instantiates a new AutomationRuleCreateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleCreateAttributes(action AutomationRuleAction, name string, trigger AutomationRuleTrigger) *AutomationRuleCreateAttributes { + this := AutomationRuleCreateAttributes{} + this.Action = action + this.Name = name + this.Trigger = trigger + return &this +} + +// NewAutomationRuleCreateAttributesWithDefaults instantiates a new AutomationRuleCreateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleCreateAttributesWithDefaults() *AutomationRuleCreateAttributes { + this := AutomationRuleCreateAttributes{} + return &this +} + +// GetAction returns the Action field value. +func (o *AutomationRuleCreateAttributes) GetAction() AutomationRuleAction { + if o == nil { + var ret AutomationRuleAction + return ret + } + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreateAttributes) GetActionOk() (*AutomationRuleAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value. +func (o *AutomationRuleCreateAttributes) SetAction(v AutomationRuleAction) { + o.Action = v +} + +// GetName returns the Name field value. +func (o *AutomationRuleCreateAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreateAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *AutomationRuleCreateAttributes) SetName(v string) { + o.Name = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *AutomationRuleCreateAttributes) GetState() CaseAutomationRuleState { + if o == nil || o.State == nil { + var ret CaseAutomationRuleState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreateAttributes) GetStateOk() (*CaseAutomationRuleState, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *AutomationRuleCreateAttributes) HasState() bool { + return o != nil && o.State != nil +} + +// SetState gets a reference to the given CaseAutomationRuleState and assigns it to the State field. +func (o *AutomationRuleCreateAttributes) SetState(v CaseAutomationRuleState) { + o.State = &v +} + +// GetTrigger returns the Trigger field value. +func (o *AutomationRuleCreateAttributes) GetTrigger() AutomationRuleTrigger { + if o == nil { + var ret AutomationRuleTrigger + return ret + } + return o.Trigger +} + +// GetTriggerOk returns a tuple with the Trigger field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreateAttributes) GetTriggerOk() (*AutomationRuleTrigger, bool) { + if o == nil { + return nil, false + } + return &o.Trigger, true +} + +// SetTrigger sets field value. +func (o *AutomationRuleCreateAttributes) SetTrigger(v AutomationRuleTrigger) { + o.Trigger = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleCreateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["action"] = o.Action + toSerialize["name"] = o.Name + if o.State != nil { + toSerialize["state"] = o.State + } + toSerialize["trigger"] = o.Trigger + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Action *AutomationRuleAction `json:"action"` + Name *string `json:"name"` + State *CaseAutomationRuleState `json:"state,omitempty"` + Trigger *AutomationRuleTrigger `json:"trigger"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Action == nil { + return fmt.Errorf("required field action missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Trigger == nil { + return fmt.Errorf("required field trigger missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"action", "name", "state", "trigger"}) + } else { + return err + } + + hasInvalidField := false + if all.Action.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Action = *all.Action + o.Name = *all.Name + if all.State != nil && !all.State.IsValid() { + hasInvalidField = true + } else { + o.State = all.State + } + if all.Trigger.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Trigger = *all.Trigger + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_create_request.go b/api/datadogV2/model_automation_rule_create_request.go new file mode 100644 index 00000000000..0db0c860646 --- /dev/null +++ b/api/datadogV2/model_automation_rule_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleCreateRequest Request payload for creating an automation rule. +type AutomationRuleCreateRequest struct { + // Data object for creating an automation rule. + Data AutomationRuleCreate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleCreateRequest instantiates a new AutomationRuleCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleCreateRequest(data AutomationRuleCreate) *AutomationRuleCreateRequest { + this := AutomationRuleCreateRequest{} + this.Data = data + return &this +} + +// NewAutomationRuleCreateRequestWithDefaults instantiates a new AutomationRuleCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleCreateRequestWithDefaults() *AutomationRuleCreateRequest { + this := AutomationRuleCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *AutomationRuleCreateRequest) GetData() AutomationRuleCreate { + if o == nil { + var ret AutomationRuleCreate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleCreateRequest) GetDataOk() (*AutomationRuleCreate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *AutomationRuleCreateRequest) SetData(v AutomationRuleCreate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *AutomationRuleCreate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_relationships.go b/api/datadogV2/model_automation_rule_relationships.go new file mode 100644 index 00000000000..b3a49b22b1d --- /dev/null +++ b/api/datadogV2/model_automation_rule_relationships.go @@ -0,0 +1,159 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleRelationships Related resources for the automation rule, including the users who created and last modified it. +type AutomationRuleRelationships struct { + // Relationship to user. + CreatedBy NullableNullableUserRelationship `json:"created_by,omitempty"` + // Relationship to user. + ModifiedBy NullableNullableUserRelationship `json:"modified_by,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleRelationships instantiates a new AutomationRuleRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleRelationships() *AutomationRuleRelationships { + this := AutomationRuleRelationships{} + return &this +} + +// NewAutomationRuleRelationshipsWithDefaults instantiates a new AutomationRuleRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleRelationshipsWithDefaults() *AutomationRuleRelationships { + this := AutomationRuleRelationships{} + return &this +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationRuleRelationships) GetCreatedBy() NullableUserRelationship { + if o == nil || o.CreatedBy.Get() == nil { + var ret NullableUserRelationship + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *AutomationRuleRelationships) GetCreatedByOk() (*NullableUserRelationship, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *AutomationRuleRelationships) HasCreatedBy() bool { + return o != nil && o.CreatedBy.IsSet() +} + +// SetCreatedBy gets a reference to the given NullableNullableUserRelationship and assigns it to the CreatedBy field. +func (o *AutomationRuleRelationships) SetCreatedBy(v NullableUserRelationship) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil. +func (o *AutomationRuleRelationships) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil. +func (o *AutomationRuleRelationships) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetModifiedBy returns the ModifiedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationRuleRelationships) GetModifiedBy() NullableUserRelationship { + if o == nil || o.ModifiedBy.Get() == nil { + var ret NullableUserRelationship + return ret + } + return *o.ModifiedBy.Get() +} + +// GetModifiedByOk returns a tuple with the ModifiedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *AutomationRuleRelationships) GetModifiedByOk() (*NullableUserRelationship, bool) { + if o == nil { + return nil, false + } + return o.ModifiedBy.Get(), o.ModifiedBy.IsSet() +} + +// HasModifiedBy returns a boolean if a field has been set. +func (o *AutomationRuleRelationships) HasModifiedBy() bool { + return o != nil && o.ModifiedBy.IsSet() +} + +// SetModifiedBy gets a reference to the given NullableNullableUserRelationship and assigns it to the ModifiedBy field. +func (o *AutomationRuleRelationships) SetModifiedBy(v NullableUserRelationship) { + o.ModifiedBy.Set(&v) +} + +// SetModifiedByNil sets the value for ModifiedBy to be an explicit nil. +func (o *AutomationRuleRelationships) SetModifiedByNil() { + o.ModifiedBy.Set(nil) +} + +// UnsetModifiedBy ensures that no value is present for ModifiedBy, not even an explicit nil. +func (o *AutomationRuleRelationships) UnsetModifiedBy() { + o.ModifiedBy.Unset() +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if o.ModifiedBy.IsSet() { + toSerialize["modified_by"] = o.ModifiedBy.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedBy NullableNullableUserRelationship `json:"created_by,omitempty"` + ModifiedBy NullableNullableUserRelationship `json:"modified_by,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_by", "modified_by"}) + } else { + return err + } + o.CreatedBy = all.CreatedBy + o.ModifiedBy = all.ModifiedBy + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_response.go b/api/datadogV2/model_automation_rule_response.go new file mode 100644 index 00000000000..434f6793aee --- /dev/null +++ b/api/datadogV2/model_automation_rule_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleResponse Response containing a single automation rule. +type AutomationRuleResponse struct { + // An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project. + Data AutomationRule `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleResponse instantiates a new AutomationRuleResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleResponse(data AutomationRule) *AutomationRuleResponse { + this := AutomationRuleResponse{} + this.Data = data + return &this +} + +// NewAutomationRuleResponseWithDefaults instantiates a new AutomationRuleResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleResponseWithDefaults() *AutomationRuleResponse { + this := AutomationRuleResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *AutomationRuleResponse) GetData() AutomationRule { + if o == nil { + var ret AutomationRule + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleResponse) GetDataOk() (*AutomationRule, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *AutomationRuleResponse) SetData(v AutomationRule) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *AutomationRule `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_trigger.go b/api/datadogV2/model_automation_rule_trigger.go new file mode 100644 index 00000000000..1d1c2563fe6 --- /dev/null +++ b/api/datadogV2/model_automation_rule_trigger.go @@ -0,0 +1,149 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleTrigger Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). +type AutomationRuleTrigger struct { + // Additional configuration for the trigger, dependent on the trigger type. For `status_transitioned` triggers, specify `from_status_name` and `to_status_name`. For `attribute_value_changed` triggers, specify `field` and `change_type`. + Data *AutomationRuleTriggerData `json:"data,omitempty"` + // The case event that activates the automation rule. + Type AutomationRuleTriggerType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleTrigger instantiates a new AutomationRuleTrigger object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleTrigger(typeVar AutomationRuleTriggerType) *AutomationRuleTrigger { + this := AutomationRuleTrigger{} + this.Type = typeVar + return &this +} + +// NewAutomationRuleTriggerWithDefaults instantiates a new AutomationRuleTrigger object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleTriggerWithDefaults() *AutomationRuleTrigger { + this := AutomationRuleTrigger{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *AutomationRuleTrigger) GetData() AutomationRuleTriggerData { + if o == nil || o.Data == nil { + var ret AutomationRuleTriggerData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTrigger) GetDataOk() (*AutomationRuleTriggerData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *AutomationRuleTrigger) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given AutomationRuleTriggerData and assigns it to the Data field. +func (o *AutomationRuleTrigger) SetData(v AutomationRuleTriggerData) { + o.Data = &v +} + +// GetType returns the Type field value. +func (o *AutomationRuleTrigger) GetType() AutomationRuleTriggerType { + if o == nil { + var ret AutomationRuleTriggerType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleTrigger) GetTypeOk() (*AutomationRuleTriggerType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *AutomationRuleTrigger) SetType(v AutomationRuleTriggerType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleTrigger) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleTrigger) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *AutomationRuleTriggerData `json:"data,omitempty"` + Type *AutomationRuleTriggerType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_trigger_data.go b/api/datadogV2/model_automation_rule_trigger_data.go new file mode 100644 index 00000000000..94afee4d314 --- /dev/null +++ b/api/datadogV2/model_automation_rule_trigger_data.go @@ -0,0 +1,242 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleTriggerData Additional configuration for the trigger, dependent on the trigger type. For `status_transitioned` triggers, specify `from_status_name` and `to_status_name`. For `attribute_value_changed` triggers, specify `field` and `change_type`. +type AutomationRuleTriggerData struct { + // The approval outcome to match. Used with `case_review_approved` triggers. + ApprovalType *string `json:"approval_type,omitempty"` + // The kind of attribute change to match. Allowed values: `VALUE_ADDED`, `VALUE_DELETED`, `ANY_CHANGES`. Used with `attribute_value_changed` triggers. + ChangeType *string `json:"change_type,omitempty"` + // The case attribute field name to monitor for changes. Used with `attribute_value_changed` triggers. + Field *string `json:"field,omitempty"` + // The originating status name. Used with `status_transitioned` triggers to match transitions from this status. + FromStatusName *string `json:"from_status_name,omitempty"` + // The destination status name. Used with `status_transitioned` triggers to match transitions to this status. + ToStatusName *string `json:"to_status_name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleTriggerData instantiates a new AutomationRuleTriggerData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleTriggerData() *AutomationRuleTriggerData { + this := AutomationRuleTriggerData{} + return &this +} + +// NewAutomationRuleTriggerDataWithDefaults instantiates a new AutomationRuleTriggerData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleTriggerDataWithDefaults() *AutomationRuleTriggerData { + this := AutomationRuleTriggerData{} + return &this +} + +// GetApprovalType returns the ApprovalType field value if set, zero value otherwise. +func (o *AutomationRuleTriggerData) GetApprovalType() string { + if o == nil || o.ApprovalType == nil { + var ret string + return ret + } + return *o.ApprovalType +} + +// GetApprovalTypeOk returns a tuple with the ApprovalType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTriggerData) GetApprovalTypeOk() (*string, bool) { + if o == nil || o.ApprovalType == nil { + return nil, false + } + return o.ApprovalType, true +} + +// HasApprovalType returns a boolean if a field has been set. +func (o *AutomationRuleTriggerData) HasApprovalType() bool { + return o != nil && o.ApprovalType != nil +} + +// SetApprovalType gets a reference to the given string and assigns it to the ApprovalType field. +func (o *AutomationRuleTriggerData) SetApprovalType(v string) { + o.ApprovalType = &v +} + +// GetChangeType returns the ChangeType field value if set, zero value otherwise. +func (o *AutomationRuleTriggerData) GetChangeType() string { + if o == nil || o.ChangeType == nil { + var ret string + return ret + } + return *o.ChangeType +} + +// GetChangeTypeOk returns a tuple with the ChangeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTriggerData) GetChangeTypeOk() (*string, bool) { + if o == nil || o.ChangeType == nil { + return nil, false + } + return o.ChangeType, true +} + +// HasChangeType returns a boolean if a field has been set. +func (o *AutomationRuleTriggerData) HasChangeType() bool { + return o != nil && o.ChangeType != nil +} + +// SetChangeType gets a reference to the given string and assigns it to the ChangeType field. +func (o *AutomationRuleTriggerData) SetChangeType(v string) { + o.ChangeType = &v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *AutomationRuleTriggerData) GetField() string { + if o == nil || o.Field == nil { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTriggerData) GetFieldOk() (*string, bool) { + if o == nil || o.Field == nil { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *AutomationRuleTriggerData) HasField() bool { + return o != nil && o.Field != nil +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *AutomationRuleTriggerData) SetField(v string) { + o.Field = &v +} + +// GetFromStatusName returns the FromStatusName field value if set, zero value otherwise. +func (o *AutomationRuleTriggerData) GetFromStatusName() string { + if o == nil || o.FromStatusName == nil { + var ret string + return ret + } + return *o.FromStatusName +} + +// GetFromStatusNameOk returns a tuple with the FromStatusName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTriggerData) GetFromStatusNameOk() (*string, bool) { + if o == nil || o.FromStatusName == nil { + return nil, false + } + return o.FromStatusName, true +} + +// HasFromStatusName returns a boolean if a field has been set. +func (o *AutomationRuleTriggerData) HasFromStatusName() bool { + return o != nil && o.FromStatusName != nil +} + +// SetFromStatusName gets a reference to the given string and assigns it to the FromStatusName field. +func (o *AutomationRuleTriggerData) SetFromStatusName(v string) { + o.FromStatusName = &v +} + +// GetToStatusName returns the ToStatusName field value if set, zero value otherwise. +func (o *AutomationRuleTriggerData) GetToStatusName() string { + if o == nil || o.ToStatusName == nil { + var ret string + return ret + } + return *o.ToStatusName +} + +// GetToStatusNameOk returns a tuple with the ToStatusName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleTriggerData) GetToStatusNameOk() (*string, bool) { + if o == nil || o.ToStatusName == nil { + return nil, false + } + return o.ToStatusName, true +} + +// HasToStatusName returns a boolean if a field has been set. +func (o *AutomationRuleTriggerData) HasToStatusName() bool { + return o != nil && o.ToStatusName != nil +} + +// SetToStatusName gets a reference to the given string and assigns it to the ToStatusName field. +func (o *AutomationRuleTriggerData) SetToStatusName(v string) { + o.ToStatusName = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleTriggerData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ApprovalType != nil { + toSerialize["approval_type"] = o.ApprovalType + } + if o.ChangeType != nil { + toSerialize["change_type"] = o.ChangeType + } + if o.Field != nil { + toSerialize["field"] = o.Field + } + if o.FromStatusName != nil { + toSerialize["from_status_name"] = o.FromStatusName + } + if o.ToStatusName != nil { + toSerialize["to_status_name"] = o.ToStatusName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleTriggerData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ApprovalType *string `json:"approval_type,omitempty"` + ChangeType *string `json:"change_type,omitempty"` + Field *string `json:"field,omitempty"` + FromStatusName *string `json:"from_status_name,omitempty"` + ToStatusName *string `json:"to_status_name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"approval_type", "change_type", "field", "from_status_name", "to_status_name"}) + } else { + return err + } + o.ApprovalType = all.ApprovalType + o.ChangeType = all.ChangeType + o.Field = all.Field + o.FromStatusName = all.FromStatusName + o.ToStatusName = all.ToStatusName + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_trigger_type.go b/api/datadogV2/model_automation_rule_trigger_type.go new file mode 100644 index 00000000000..a79a3a994c7 --- /dev/null +++ b/api/datadogV2/model_automation_rule_trigger_type.go @@ -0,0 +1,74 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleTriggerType The case event that activates the automation rule. +type AutomationRuleTriggerType string + +// List of AutomationRuleTriggerType. +const ( + AUTOMATIONRULETRIGGERTYPE_CASE_CREATED AutomationRuleTriggerType = "case_created" + AUTOMATIONRULETRIGGERTYPE_STATUS_TRANSITIONED AutomationRuleTriggerType = "status_transitioned" + AUTOMATIONRULETRIGGERTYPE_ATTRIBUTE_VALUE_CHANGED AutomationRuleTriggerType = "attribute_value_changed" + AUTOMATIONRULETRIGGERTYPE_EVENT_CORRELATION_SIGNAL_CORRELATED AutomationRuleTriggerType = "event_correlation_signal_correlated" + AUTOMATIONRULETRIGGERTYPE_CASE_REVIEW_APPROVED AutomationRuleTriggerType = "case_review_approved" + AUTOMATIONRULETRIGGERTYPE_COMMENT_ADDED AutomationRuleTriggerType = "comment_added" +) + +var allowedAutomationRuleTriggerTypeEnumValues = []AutomationRuleTriggerType{ + AUTOMATIONRULETRIGGERTYPE_CASE_CREATED, + AUTOMATIONRULETRIGGERTYPE_STATUS_TRANSITIONED, + AUTOMATIONRULETRIGGERTYPE_ATTRIBUTE_VALUE_CHANGED, + AUTOMATIONRULETRIGGERTYPE_EVENT_CORRELATION_SIGNAL_CORRELATED, + AUTOMATIONRULETRIGGERTYPE_CASE_REVIEW_APPROVED, + AUTOMATIONRULETRIGGERTYPE_COMMENT_ADDED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AutomationRuleTriggerType) GetAllowedValues() []AutomationRuleTriggerType { + return allowedAutomationRuleTriggerTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AutomationRuleTriggerType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AutomationRuleTriggerType(value) + return nil +} + +// NewAutomationRuleTriggerTypeFromValue returns a pointer to a valid AutomationRuleTriggerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAutomationRuleTriggerTypeFromValue(v string) (*AutomationRuleTriggerType, error) { + ev := AutomationRuleTriggerType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AutomationRuleTriggerType: valid values are %v", v, allowedAutomationRuleTriggerTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AutomationRuleTriggerType) IsValid() bool { + for _, existing := range allowedAutomationRuleTriggerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AutomationRuleTriggerType value. +func (v AutomationRuleTriggerType) Ptr() *AutomationRuleTriggerType { + return &v +} diff --git a/api/datadogV2/model_automation_rule_update.go b/api/datadogV2/model_automation_rule_update.go new file mode 100644 index 00000000000..48a3666a40a --- /dev/null +++ b/api/datadogV2/model_automation_rule_update.go @@ -0,0 +1,151 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleUpdate Data object for updating an automation rule. +type AutomationRuleUpdate struct { + // Attributes required to create an automation rule. + Attributes *AutomationRuleCreateAttributes `json:"attributes,omitempty"` + // JSON:API resource type for case automation rules. + Type CaseAutomationRuleResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleUpdate instantiates a new AutomationRuleUpdate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleUpdate(typeVar CaseAutomationRuleResourceType) *AutomationRuleUpdate { + this := AutomationRuleUpdate{} + this.Type = typeVar + return &this +} + +// NewAutomationRuleUpdateWithDefaults instantiates a new AutomationRuleUpdate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleUpdateWithDefaults() *AutomationRuleUpdate { + this := AutomationRuleUpdate{} + var typeVar CaseAutomationRuleResourceType = CASEAUTOMATIONRULERESOURCETYPE_RULE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *AutomationRuleUpdate) GetAttributes() AutomationRuleCreateAttributes { + if o == nil || o.Attributes == nil { + var ret AutomationRuleCreateAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationRuleUpdate) GetAttributesOk() (*AutomationRuleCreateAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *AutomationRuleUpdate) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given AutomationRuleCreateAttributes and assigns it to the Attributes field. +func (o *AutomationRuleUpdate) SetAttributes(v AutomationRuleCreateAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value. +func (o *AutomationRuleUpdate) GetType() CaseAutomationRuleResourceType { + if o == nil { + var ret CaseAutomationRuleResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleUpdate) GetTypeOk() (*CaseAutomationRuleResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *AutomationRuleUpdate) SetType(v CaseAutomationRuleResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleUpdate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *AutomationRuleCreateAttributes `json:"attributes,omitempty"` + Type *CaseAutomationRuleResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rule_update_request.go b/api/datadogV2/model_automation_rule_update_request.go new file mode 100644 index 00000000000..ab77e834133 --- /dev/null +++ b/api/datadogV2/model_automation_rule_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRuleUpdateRequest Request payload for updating an automation rule. +type AutomationRuleUpdateRequest struct { + // Data object for updating an automation rule. + Data AutomationRuleUpdate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRuleUpdateRequest instantiates a new AutomationRuleUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRuleUpdateRequest(data AutomationRuleUpdate) *AutomationRuleUpdateRequest { + this := AutomationRuleUpdateRequest{} + this.Data = data + return &this +} + +// NewAutomationRuleUpdateRequestWithDefaults instantiates a new AutomationRuleUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRuleUpdateRequestWithDefaults() *AutomationRuleUpdateRequest { + this := AutomationRuleUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *AutomationRuleUpdateRequest) GetData() AutomationRuleUpdate { + if o == nil { + var ret AutomationRuleUpdate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AutomationRuleUpdateRequest) GetDataOk() (*AutomationRuleUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *AutomationRuleUpdateRequest) SetData(v AutomationRuleUpdate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRuleUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRuleUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *AutomationRuleUpdate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_automation_rules_response.go b/api/datadogV2/model_automation_rules_response.go new file mode 100644 index 00000000000..30782c4a9ce --- /dev/null +++ b/api/datadogV2/model_automation_rules_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AutomationRulesResponse Response containing a list of automation rules for a project. +type AutomationRulesResponse struct { + // List of automation rules. + Data []AutomationRule `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAutomationRulesResponse instantiates a new AutomationRulesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAutomationRulesResponse(data []AutomationRule) *AutomationRulesResponse { + this := AutomationRulesResponse{} + this.Data = data + return &this +} + +// NewAutomationRulesResponseWithDefaults instantiates a new AutomationRulesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAutomationRulesResponseWithDefaults() *AutomationRulesResponse { + this := AutomationRulesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *AutomationRulesResponse) GetData() []AutomationRule { + if o == nil { + var ret []AutomationRule + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AutomationRulesResponse) GetDataOk() (*[]AutomationRule, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *AutomationRulesResponse) SetData(v []AutomationRule) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AutomationRulesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AutomationRulesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]AutomationRule `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_blueprint_attributes.go b/api/datadogV2/model_blueprint_attributes.go new file mode 100644 index 00000000000..2c38368214d --- /dev/null +++ b/api/datadogV2/model_blueprint_attributes.go @@ -0,0 +1,562 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// BlueprintAttributes The attributes of a blueprint resource. +type BlueprintAttributes struct { + // The timestamp when the blueprint was created. + CreatedAt time.Time `json:"created_at"` + // The app definition type. + Definition AppDefinitionType `json:"definition"` + // A description of what the blueprint does. + Description string `json:"description"` + // Embedded datastore blueprints. + EmbeddedDatastoreBlueprints map[string]interface{} `json:"embedded_datastore_blueprints,omitempty"` + // Embedded native actions. + EmbeddedNativeActions []map[string]interface{} `json:"embedded_native_actions,omitempty"` + // Embedded workflow blueprints. + EmbeddedWorkflowBlueprints map[string]interface{} `json:"embedded_workflow_blueprints,omitempty"` + // The integration ID associated with the blueprint. + IntegrationId *string `json:"integration_id,omitempty"` + // Mocked outputs for testing the blueprint. + MockedOutputs map[string]interface{} `json:"mocked_outputs,omitempty"` + // The human-readable name of the blueprint. + Name string `json:"name"` + // The unique slug identifier of the blueprint. + Slug string `json:"slug"` + // Tags associated with the blueprint. + Tags []string `json:"tags,omitempty"` + // The background style of the blueprint tile. + TileBackground *string `json:"tile_background,omitempty"` + // The fully qualified name of the action used as the tile icon. + TileIconActionFqn *string `json:"tile_icon_action_fqn,omitempty"` + // The timestamp when the blueprint was last updated. + UpdatedAt time.Time `json:"updated_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewBlueprintAttributes instantiates a new BlueprintAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewBlueprintAttributes(createdAt time.Time, definition AppDefinitionType, description string, name string, slug string, updatedAt time.Time) *BlueprintAttributes { + this := BlueprintAttributes{} + this.CreatedAt = createdAt + this.Definition = definition + this.Description = description + this.Name = name + this.Slug = slug + this.UpdatedAt = updatedAt + return &this +} + +// NewBlueprintAttributesWithDefaults instantiates a new BlueprintAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewBlueprintAttributesWithDefaults() *BlueprintAttributes { + this := BlueprintAttributes{} + var definition AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS + this.Definition = definition + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *BlueprintAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *BlueprintAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDefinition returns the Definition field value. +func (o *BlueprintAttributes) GetDefinition() AppDefinitionType { + if o == nil { + var ret AppDefinitionType + return ret + } + return o.Definition +} + +// GetDefinitionOk returns a tuple with the Definition field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetDefinitionOk() (*AppDefinitionType, bool) { + if o == nil { + return nil, false + } + return &o.Definition, true +} + +// SetDefinition sets field value. +func (o *BlueprintAttributes) SetDefinition(v AppDefinitionType) { + o.Definition = v +} + +// GetDescription returns the Description field value. +func (o *BlueprintAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *BlueprintAttributes) SetDescription(v string) { + o.Description = v +} + +// GetEmbeddedDatastoreBlueprints returns the EmbeddedDatastoreBlueprints field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetEmbeddedDatastoreBlueprints() map[string]interface{} { + if o == nil || o.EmbeddedDatastoreBlueprints == nil { + var ret map[string]interface{} + return ret + } + return o.EmbeddedDatastoreBlueprints +} + +// GetEmbeddedDatastoreBlueprintsOk returns a tuple with the EmbeddedDatastoreBlueprints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetEmbeddedDatastoreBlueprintsOk() (*map[string]interface{}, bool) { + if o == nil || o.EmbeddedDatastoreBlueprints == nil { + return nil, false + } + return &o.EmbeddedDatastoreBlueprints, true +} + +// HasEmbeddedDatastoreBlueprints returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasEmbeddedDatastoreBlueprints() bool { + return o != nil && o.EmbeddedDatastoreBlueprints != nil +} + +// SetEmbeddedDatastoreBlueprints gets a reference to the given map[string]interface{} and assigns it to the EmbeddedDatastoreBlueprints field. +func (o *BlueprintAttributes) SetEmbeddedDatastoreBlueprints(v map[string]interface{}) { + o.EmbeddedDatastoreBlueprints = v +} + +// GetEmbeddedNativeActions returns the EmbeddedNativeActions field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetEmbeddedNativeActions() []map[string]interface{} { + if o == nil || o.EmbeddedNativeActions == nil { + var ret []map[string]interface{} + return ret + } + return o.EmbeddedNativeActions +} + +// GetEmbeddedNativeActionsOk returns a tuple with the EmbeddedNativeActions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetEmbeddedNativeActionsOk() (*[]map[string]interface{}, bool) { + if o == nil || o.EmbeddedNativeActions == nil { + return nil, false + } + return &o.EmbeddedNativeActions, true +} + +// HasEmbeddedNativeActions returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasEmbeddedNativeActions() bool { + return o != nil && o.EmbeddedNativeActions != nil +} + +// SetEmbeddedNativeActions gets a reference to the given []map[string]interface{} and assigns it to the EmbeddedNativeActions field. +func (o *BlueprintAttributes) SetEmbeddedNativeActions(v []map[string]interface{}) { + o.EmbeddedNativeActions = v +} + +// GetEmbeddedWorkflowBlueprints returns the EmbeddedWorkflowBlueprints field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetEmbeddedWorkflowBlueprints() map[string]interface{} { + if o == nil || o.EmbeddedWorkflowBlueprints == nil { + var ret map[string]interface{} + return ret + } + return o.EmbeddedWorkflowBlueprints +} + +// GetEmbeddedWorkflowBlueprintsOk returns a tuple with the EmbeddedWorkflowBlueprints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetEmbeddedWorkflowBlueprintsOk() (*map[string]interface{}, bool) { + if o == nil || o.EmbeddedWorkflowBlueprints == nil { + return nil, false + } + return &o.EmbeddedWorkflowBlueprints, true +} + +// HasEmbeddedWorkflowBlueprints returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasEmbeddedWorkflowBlueprints() bool { + return o != nil && o.EmbeddedWorkflowBlueprints != nil +} + +// SetEmbeddedWorkflowBlueprints gets a reference to the given map[string]interface{} and assigns it to the EmbeddedWorkflowBlueprints field. +func (o *BlueprintAttributes) SetEmbeddedWorkflowBlueprints(v map[string]interface{}) { + o.EmbeddedWorkflowBlueprints = v +} + +// GetIntegrationId returns the IntegrationId field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetIntegrationId() string { + if o == nil || o.IntegrationId == nil { + var ret string + return ret + } + return *o.IntegrationId +} + +// GetIntegrationIdOk returns a tuple with the IntegrationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetIntegrationIdOk() (*string, bool) { + if o == nil || o.IntegrationId == nil { + return nil, false + } + return o.IntegrationId, true +} + +// HasIntegrationId returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasIntegrationId() bool { + return o != nil && o.IntegrationId != nil +} + +// SetIntegrationId gets a reference to the given string and assigns it to the IntegrationId field. +func (o *BlueprintAttributes) SetIntegrationId(v string) { + o.IntegrationId = &v +} + +// GetMockedOutputs returns the MockedOutputs field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetMockedOutputs() map[string]interface{} { + if o == nil || o.MockedOutputs == nil { + var ret map[string]interface{} + return ret + } + return o.MockedOutputs +} + +// GetMockedOutputsOk returns a tuple with the MockedOutputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetMockedOutputsOk() (*map[string]interface{}, bool) { + if o == nil || o.MockedOutputs == nil { + return nil, false + } + return &o.MockedOutputs, true +} + +// HasMockedOutputs returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasMockedOutputs() bool { + return o != nil && o.MockedOutputs != nil +} + +// SetMockedOutputs gets a reference to the given map[string]interface{} and assigns it to the MockedOutputs field. +func (o *BlueprintAttributes) SetMockedOutputs(v map[string]interface{}) { + o.MockedOutputs = v +} + +// GetName returns the Name field value. +func (o *BlueprintAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *BlueprintAttributes) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value. +func (o *BlueprintAttributes) GetSlug() string { + if o == nil { + var ret string + return ret + } + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value. +func (o *BlueprintAttributes) SetSlug(v string) { + o.Slug = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *BlueprintAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetTileBackground returns the TileBackground field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetTileBackground() string { + if o == nil || o.TileBackground == nil { + var ret string + return ret + } + return *o.TileBackground +} + +// GetTileBackgroundOk returns a tuple with the TileBackground field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetTileBackgroundOk() (*string, bool) { + if o == nil || o.TileBackground == nil { + return nil, false + } + return o.TileBackground, true +} + +// HasTileBackground returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasTileBackground() bool { + return o != nil && o.TileBackground != nil +} + +// SetTileBackground gets a reference to the given string and assigns it to the TileBackground field. +func (o *BlueprintAttributes) SetTileBackground(v string) { + o.TileBackground = &v +} + +// GetTileIconActionFqn returns the TileIconActionFqn field value if set, zero value otherwise. +func (o *BlueprintAttributes) GetTileIconActionFqn() string { + if o == nil || o.TileIconActionFqn == nil { + var ret string + return ret + } + return *o.TileIconActionFqn +} + +// GetTileIconActionFqnOk returns a tuple with the TileIconActionFqn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetTileIconActionFqnOk() (*string, bool) { + if o == nil || o.TileIconActionFqn == nil { + return nil, false + } + return o.TileIconActionFqn, true +} + +// HasTileIconActionFqn returns a boolean if a field has been set. +func (o *BlueprintAttributes) HasTileIconActionFqn() bool { + return o != nil && o.TileIconActionFqn != nil +} + +// SetTileIconActionFqn gets a reference to the given string and assigns it to the TileIconActionFqn field. +func (o *BlueprintAttributes) SetTileIconActionFqn(v string) { + o.TileIconActionFqn = &v +} + +// GetUpdatedAt returns the UpdatedAt field value. +func (o *BlueprintAttributes) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *BlueprintAttributes) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value. +func (o *BlueprintAttributes) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o BlueprintAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["definition"] = o.Definition + toSerialize["description"] = o.Description + if o.EmbeddedDatastoreBlueprints != nil { + toSerialize["embedded_datastore_blueprints"] = o.EmbeddedDatastoreBlueprints + } + if o.EmbeddedNativeActions != nil { + toSerialize["embedded_native_actions"] = o.EmbeddedNativeActions + } + if o.EmbeddedWorkflowBlueprints != nil { + toSerialize["embedded_workflow_blueprints"] = o.EmbeddedWorkflowBlueprints + } + if o.IntegrationId != nil { + toSerialize["integration_id"] = o.IntegrationId + } + if o.MockedOutputs != nil { + toSerialize["mocked_outputs"] = o.MockedOutputs + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.TileBackground != nil { + toSerialize["tile_background"] = o.TileBackground + } + if o.TileIconActionFqn != nil { + toSerialize["tile_icon_action_fqn"] = o.TileIconActionFqn + } + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *BlueprintAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + Definition *AppDefinitionType `json:"definition"` + Description *string `json:"description"` + EmbeddedDatastoreBlueprints map[string]interface{} `json:"embedded_datastore_blueprints,omitempty"` + EmbeddedNativeActions []map[string]interface{} `json:"embedded_native_actions,omitempty"` + EmbeddedWorkflowBlueprints map[string]interface{} `json:"embedded_workflow_blueprints,omitempty"` + IntegrationId *string `json:"integration_id,omitempty"` + MockedOutputs map[string]interface{} `json:"mocked_outputs,omitempty"` + Name *string `json:"name"` + Slug *string `json:"slug"` + Tags []string `json:"tags,omitempty"` + TileBackground *string `json:"tile_background,omitempty"` + TileIconActionFqn *string `json:"tile_icon_action_fqn,omitempty"` + UpdatedAt *time.Time `json:"updated_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Definition == nil { + return fmt.Errorf("required field definition missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Slug == nil { + return fmt.Errorf("required field slug missing") + } + if all.UpdatedAt == nil { + return fmt.Errorf("required field updated_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "definition", "description", "embedded_datastore_blueprints", "embedded_native_actions", "embedded_workflow_blueprints", "integration_id", "mocked_outputs", "name", "slug", "tags", "tile_background", "tile_icon_action_fqn", "updated_at"}) + } else { + return err + } + + hasInvalidField := false + o.CreatedAt = *all.CreatedAt + if !all.Definition.IsValid() { + hasInvalidField = true + } else { + o.Definition = *all.Definition + } + o.Description = *all.Description + o.EmbeddedDatastoreBlueprints = all.EmbeddedDatastoreBlueprints + o.EmbeddedNativeActions = all.EmbeddedNativeActions + o.EmbeddedWorkflowBlueprints = all.EmbeddedWorkflowBlueprints + o.IntegrationId = all.IntegrationId + o.MockedOutputs = all.MockedOutputs + o.Name = *all.Name + o.Slug = *all.Slug + o.Tags = all.Tags + o.TileBackground = all.TileBackground + o.TileIconActionFqn = all.TileIconActionFqn + o.UpdatedAt = *all.UpdatedAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_blueprint_data.go b/api/datadogV2/model_blueprint_data.go new file mode 100644 index 00000000000..df58a74a094 --- /dev/null +++ b/api/datadogV2/model_blueprint_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// BlueprintData A blueprint resource. +type BlueprintData struct { + // The attributes of a blueprint resource. + Attributes BlueprintAttributes `json:"attributes"` + // The ID of the blueprint. + Id uuid.UUID `json:"id"` + // The resource type for a blueprint. + Type BlueprintDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewBlueprintData instantiates a new BlueprintData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewBlueprintData(attributes BlueprintAttributes, id uuid.UUID, typeVar BlueprintDataType) *BlueprintData { + this := BlueprintData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewBlueprintDataWithDefaults instantiates a new BlueprintData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewBlueprintDataWithDefaults() *BlueprintData { + this := BlueprintData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *BlueprintData) GetAttributes() BlueprintAttributes { + if o == nil { + var ret BlueprintAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *BlueprintData) GetAttributesOk() (*BlueprintAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *BlueprintData) SetAttributes(v BlueprintAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *BlueprintData) GetId() uuid.UUID { + if o == nil { + var ret uuid.UUID + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BlueprintData) GetIdOk() (*uuid.UUID, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *BlueprintData) SetId(v uuid.UUID) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *BlueprintData) GetType() BlueprintDataType { + if o == nil { + var ret BlueprintDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BlueprintData) GetTypeOk() (*BlueprintDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *BlueprintData) SetType(v BlueprintDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o BlueprintData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *BlueprintData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *BlueprintAttributes `json:"attributes"` + Id *uuid.UUID `json:"id"` + Type *BlueprintDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_blueprint_data_type.go b/api/datadogV2/model_blueprint_data_type.go new file mode 100644 index 00000000000..3218074ec2a --- /dev/null +++ b/api/datadogV2/model_blueprint_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// BlueprintDataType The resource type for a blueprint. +type BlueprintDataType string + +// List of BlueprintDataType. +const ( + BLUEPRINTDATATYPE_BLUEPRINT BlueprintDataType = "blueprint" +) + +var allowedBlueprintDataTypeEnumValues = []BlueprintDataType{ + BLUEPRINTDATATYPE_BLUEPRINT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *BlueprintDataType) GetAllowedValues() []BlueprintDataType { + return allowedBlueprintDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *BlueprintDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = BlueprintDataType(value) + return nil +} + +// NewBlueprintDataTypeFromValue returns a pointer to a valid BlueprintDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewBlueprintDataTypeFromValue(v string) (*BlueprintDataType, error) { + ev := BlueprintDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for BlueprintDataType: valid values are %v", v, allowedBlueprintDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v BlueprintDataType) IsValid() bool { + for _, existing := range allowedBlueprintDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BlueprintDataType value. +func (v BlueprintDataType) Ptr() *BlueprintDataType { + return &v +} diff --git a/api/datadogV2/model_blueprint_metadata_attributes.go b/api/datadogV2/model_blueprint_metadata_attributes.go new file mode 100644 index 00000000000..c1b56574c7e --- /dev/null +++ b/api/datadogV2/model_blueprint_metadata_attributes.go @@ -0,0 +1,343 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// BlueprintMetadataAttributes The attributes of a blueprint metadata resource. +type BlueprintMetadataAttributes struct { + // The timestamp when the blueprint was created. + CreatedAt time.Time `json:"created_at"` + // A description of what the blueprint does. + Description string `json:"description"` + // The human-readable name of the blueprint. + Name string `json:"name"` + // The unique slug identifier of the blueprint. + Slug string `json:"slug"` + // Tags associated with the blueprint. + Tags []string `json:"tags,omitempty"` + // The background style of the blueprint tile. + TileBackground *string `json:"tile_background,omitempty"` + // The fully qualified name of the action used as the tile icon. + TileIconActionFqn *string `json:"tile_icon_action_fqn,omitempty"` + // The timestamp when the blueprint was last updated. + UpdatedAt time.Time `json:"updated_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewBlueprintMetadataAttributes instantiates a new BlueprintMetadataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewBlueprintMetadataAttributes(createdAt time.Time, description string, name string, slug string, updatedAt time.Time) *BlueprintMetadataAttributes { + this := BlueprintMetadataAttributes{} + this.CreatedAt = createdAt + this.Description = description + this.Name = name + this.Slug = slug + this.UpdatedAt = updatedAt + return &this +} + +// NewBlueprintMetadataAttributesWithDefaults instantiates a new BlueprintMetadataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewBlueprintMetadataAttributesWithDefaults() *BlueprintMetadataAttributes { + this := BlueprintMetadataAttributes{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *BlueprintMetadataAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *BlueprintMetadataAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDescription returns the Description field value. +func (o *BlueprintMetadataAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *BlueprintMetadataAttributes) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value. +func (o *BlueprintMetadataAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *BlueprintMetadataAttributes) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value. +func (o *BlueprintMetadataAttributes) GetSlug() string { + if o == nil { + var ret string + return ret + } + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value. +func (o *BlueprintMetadataAttributes) SetSlug(v string) { + o.Slug = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *BlueprintMetadataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *BlueprintMetadataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *BlueprintMetadataAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetTileBackground returns the TileBackground field value if set, zero value otherwise. +func (o *BlueprintMetadataAttributes) GetTileBackground() string { + if o == nil || o.TileBackground == nil { + var ret string + return ret + } + return *o.TileBackground +} + +// GetTileBackgroundOk returns a tuple with the TileBackground field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetTileBackgroundOk() (*string, bool) { + if o == nil || o.TileBackground == nil { + return nil, false + } + return o.TileBackground, true +} + +// HasTileBackground returns a boolean if a field has been set. +func (o *BlueprintMetadataAttributes) HasTileBackground() bool { + return o != nil && o.TileBackground != nil +} + +// SetTileBackground gets a reference to the given string and assigns it to the TileBackground field. +func (o *BlueprintMetadataAttributes) SetTileBackground(v string) { + o.TileBackground = &v +} + +// GetTileIconActionFqn returns the TileIconActionFqn field value if set, zero value otherwise. +func (o *BlueprintMetadataAttributes) GetTileIconActionFqn() string { + if o == nil || o.TileIconActionFqn == nil { + var ret string + return ret + } + return *o.TileIconActionFqn +} + +// GetTileIconActionFqnOk returns a tuple with the TileIconActionFqn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetTileIconActionFqnOk() (*string, bool) { + if o == nil || o.TileIconActionFqn == nil { + return nil, false + } + return o.TileIconActionFqn, true +} + +// HasTileIconActionFqn returns a boolean if a field has been set. +func (o *BlueprintMetadataAttributes) HasTileIconActionFqn() bool { + return o != nil && o.TileIconActionFqn != nil +} + +// SetTileIconActionFqn gets a reference to the given string and assigns it to the TileIconActionFqn field. +func (o *BlueprintMetadataAttributes) SetTileIconActionFqn(v string) { + o.TileIconActionFqn = &v +} + +// GetUpdatedAt returns the UpdatedAt field value. +func (o *BlueprintMetadataAttributes) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataAttributes) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value. +func (o *BlueprintMetadataAttributes) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o BlueprintMetadataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.TileBackground != nil { + toSerialize["tile_background"] = o.TileBackground + } + if o.TileIconActionFqn != nil { + toSerialize["tile_icon_action_fqn"] = o.TileIconActionFqn + } + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *BlueprintMetadataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + Description *string `json:"description"` + Name *string `json:"name"` + Slug *string `json:"slug"` + Tags []string `json:"tags,omitempty"` + TileBackground *string `json:"tile_background,omitempty"` + TileIconActionFqn *string `json:"tile_icon_action_fqn,omitempty"` + UpdatedAt *time.Time `json:"updated_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Slug == nil { + return fmt.Errorf("required field slug missing") + } + if all.UpdatedAt == nil { + return fmt.Errorf("required field updated_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "description", "name", "slug", "tags", "tile_background", "tile_icon_action_fqn", "updated_at"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.Description = *all.Description + o.Name = *all.Name + o.Slug = *all.Slug + o.Tags = all.Tags + o.TileBackground = all.TileBackground + o.TileIconActionFqn = all.TileIconActionFqn + o.UpdatedAt = *all.UpdatedAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_blueprint_metadata_data.go b/api/datadogV2/model_blueprint_metadata_data.go new file mode 100644 index 00000000000..af9df006372 --- /dev/null +++ b/api/datadogV2/model_blueprint_metadata_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// BlueprintMetadataData A blueprint metadata resource. +type BlueprintMetadataData struct { + // The attributes of a blueprint metadata resource. + Attributes BlueprintMetadataAttributes `json:"attributes"` + // The ID of the blueprint. + Id uuid.UUID `json:"id"` + // The resource type for a blueprint. + Type BlueprintDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewBlueprintMetadataData instantiates a new BlueprintMetadataData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewBlueprintMetadataData(attributes BlueprintMetadataAttributes, id uuid.UUID, typeVar BlueprintDataType) *BlueprintMetadataData { + this := BlueprintMetadataData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewBlueprintMetadataDataWithDefaults instantiates a new BlueprintMetadataData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewBlueprintMetadataDataWithDefaults() *BlueprintMetadataData { + this := BlueprintMetadataData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *BlueprintMetadataData) GetAttributes() BlueprintMetadataAttributes { + if o == nil { + var ret BlueprintMetadataAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataData) GetAttributesOk() (*BlueprintMetadataAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *BlueprintMetadataData) SetAttributes(v BlueprintMetadataAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *BlueprintMetadataData) GetId() uuid.UUID { + if o == nil { + var ret uuid.UUID + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataData) GetIdOk() (*uuid.UUID, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *BlueprintMetadataData) SetId(v uuid.UUID) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *BlueprintMetadataData) GetType() BlueprintDataType { + if o == nil { + var ret BlueprintDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BlueprintMetadataData) GetTypeOk() (*BlueprintDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *BlueprintMetadataData) SetType(v BlueprintDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o BlueprintMetadataData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *BlueprintMetadataData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *BlueprintMetadataAttributes `json:"attributes"` + Id *uuid.UUID `json:"id"` + Type *BlueprintDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case.go b/api/datadogV2/model_case.go index a8dfd6df2c4..53691becf66 100644 --- a/api/datadogV2/model_case.go +++ b/api/datadogV2/model_case.go @@ -18,7 +18,7 @@ type Case struct { Id string `json:"id"` // Resources related to a case Relationships *CaseRelationships `json:"relationships,omitempty"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_aggregate_group.go b/api/datadogV2/model_case_aggregate_group.go new file mode 100644 index 00000000000..455ffbb4313 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_group.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateGroup A single group within the aggregation results, containing the group key and its associated count values. +type CaseAggregateGroup struct { + // The value of the field being grouped on (for example, `OPEN` when grouping by status). + Group string `json:"group"` + // The count of cases in this group. + Value []float64 `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateGroup instantiates a new CaseAggregateGroup object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateGroup(group string, value []float64) *CaseAggregateGroup { + this := CaseAggregateGroup{} + this.Group = group + this.Value = value + return &this +} + +// NewCaseAggregateGroupWithDefaults instantiates a new CaseAggregateGroup object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateGroupWithDefaults() *CaseAggregateGroup { + this := CaseAggregateGroup{} + return &this +} + +// GetGroup returns the Group field value. +func (o *CaseAggregateGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value. +func (o *CaseAggregateGroup) SetGroup(v string) { + o.Group = v +} + +// GetValue returns the Value field value. +func (o *CaseAggregateGroup) GetValue() []float64 { + if o == nil { + var ret []float64 + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateGroup) GetValueOk() (*[]float64, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *CaseAggregateGroup) SetValue(v []float64) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateGroup) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["group"] = o.Group + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateGroup) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Group *string `json:"group"` + Value *[]float64 `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Group == nil { + return fmt.Errorf("required field group missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"group", "value"}) + } else { + return err + } + o.Group = *all.Group + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_group_by.go b/api/datadogV2/model_case_aggregate_group_by.go new file mode 100644 index 00000000000..397ab733128 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_group_by.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateGroupBy Configuration for grouping aggregated results by one or more case fields. +type CaseAggregateGroupBy struct { + // Fields to group by. + Groups []string `json:"groups"` + // Maximum number of groups to return. + Limit int32 `json:"limit"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateGroupBy instantiates a new CaseAggregateGroupBy object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateGroupBy(groups []string, limit int32) *CaseAggregateGroupBy { + this := CaseAggregateGroupBy{} + this.Groups = groups + this.Limit = limit + return &this +} + +// NewCaseAggregateGroupByWithDefaults instantiates a new CaseAggregateGroupBy object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateGroupByWithDefaults() *CaseAggregateGroupBy { + this := CaseAggregateGroupBy{} + return &this +} + +// GetGroups returns the Groups field value. +func (o *CaseAggregateGroupBy) GetGroups() []string { + if o == nil { + var ret []string + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateGroupBy) GetGroupsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Groups, true +} + +// SetGroups sets field value. +func (o *CaseAggregateGroupBy) SetGroups(v []string) { + o.Groups = v +} + +// GetLimit returns the Limit field value. +func (o *CaseAggregateGroupBy) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateGroupBy) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value. +func (o *CaseAggregateGroupBy) SetLimit(v int32) { + o.Limit = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateGroupBy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["groups"] = o.Groups + toSerialize["limit"] = o.Limit + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateGroupBy) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Groups *[]string `json:"groups"` + Limit *int32 `json:"limit"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Groups == nil { + return fmt.Errorf("required field groups missing") + } + if all.Limit == nil { + return fmt.Errorf("required field limit missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"groups", "limit"}) + } else { + return err + } + o.Groups = *all.Groups + o.Limit = *all.Limit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_request.go b/api/datadogV2/model_case_aggregate_request.go new file mode 100644 index 00000000000..ea8a52644ae --- /dev/null +++ b/api/datadogV2/model_case_aggregate_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateRequest Request payload for aggregating case counts with grouping. Use this to get faceted breakdowns of cases (for example, count of cases grouped by priority and status). +type CaseAggregateRequest struct { + // Data object wrapping the aggregation query type and attributes. + Data CaseAggregateRequestData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateRequest instantiates a new CaseAggregateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateRequest(data CaseAggregateRequestData) *CaseAggregateRequest { + this := CaseAggregateRequest{} + this.Data = data + return &this +} + +// NewCaseAggregateRequestWithDefaults instantiates a new CaseAggregateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateRequestWithDefaults() *CaseAggregateRequest { + this := CaseAggregateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseAggregateRequest) GetData() CaseAggregateRequestData { + if o == nil { + var ret CaseAggregateRequestData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateRequest) GetDataOk() (*CaseAggregateRequestData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseAggregateRequest) SetData(v CaseAggregateRequestData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseAggregateRequestData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_request_attributes.go b/api/datadogV2/model_case_aggregate_request_attributes.go new file mode 100644 index 00000000000..f1449d838f1 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_request_attributes.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateRequestAttributes Attributes for the aggregation request, including the search query and grouping configuration. +type CaseAggregateRequestAttributes struct { + // Configuration for grouping aggregated results by one or more case fields. + GroupBy CaseAggregateGroupBy `json:"group_by"` + // A search query to filter which cases are included in the aggregation. Uses the same syntax as the Case Management search bar. + QueryFilter string `json:"query_filter"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateRequestAttributes instantiates a new CaseAggregateRequestAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateRequestAttributes(groupBy CaseAggregateGroupBy, queryFilter string) *CaseAggregateRequestAttributes { + this := CaseAggregateRequestAttributes{} + this.GroupBy = groupBy + this.QueryFilter = queryFilter + return &this +} + +// NewCaseAggregateRequestAttributesWithDefaults instantiates a new CaseAggregateRequestAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateRequestAttributesWithDefaults() *CaseAggregateRequestAttributes { + this := CaseAggregateRequestAttributes{} + return &this +} + +// GetGroupBy returns the GroupBy field value. +func (o *CaseAggregateRequestAttributes) GetGroupBy() CaseAggregateGroupBy { + if o == nil { + var ret CaseAggregateGroupBy + return ret + } + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateRequestAttributes) GetGroupByOk() (*CaseAggregateGroupBy, bool) { + if o == nil { + return nil, false + } + return &o.GroupBy, true +} + +// SetGroupBy sets field value. +func (o *CaseAggregateRequestAttributes) SetGroupBy(v CaseAggregateGroupBy) { + o.GroupBy = v +} + +// GetQueryFilter returns the QueryFilter field value. +func (o *CaseAggregateRequestAttributes) GetQueryFilter() string { + if o == nil { + var ret string + return ret + } + return o.QueryFilter +} + +// GetQueryFilterOk returns a tuple with the QueryFilter field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateRequestAttributes) GetQueryFilterOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.QueryFilter, true +} + +// SetQueryFilter sets field value. +func (o *CaseAggregateRequestAttributes) SetQueryFilter(v string) { + o.QueryFilter = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["group_by"] = o.GroupBy + toSerialize["query_filter"] = o.QueryFilter + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + GroupBy *CaseAggregateGroupBy `json:"group_by"` + QueryFilter *string `json:"query_filter"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.GroupBy == nil { + return fmt.Errorf("required field group_by missing") + } + if all.QueryFilter == nil { + return fmt.Errorf("required field query_filter missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"group_by", "query_filter"}) + } else { + return err + } + + hasInvalidField := false + if all.GroupBy.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.GroupBy = *all.GroupBy + o.QueryFilter = *all.QueryFilter + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_request_data.go b/api/datadogV2/model_case_aggregate_request_data.go new file mode 100644 index 00000000000..0d0d41e36e2 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_request_data.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateRequestData Data object wrapping the aggregation query type and attributes. +type CaseAggregateRequestData struct { + // Attributes for the aggregation request, including the search query and grouping configuration. + Attributes CaseAggregateRequestAttributes `json:"attributes"` + // JSON:API resource type for case aggregation requests. + Type CaseAggregateResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateRequestData instantiates a new CaseAggregateRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateRequestData(attributes CaseAggregateRequestAttributes, typeVar CaseAggregateResourceType) *CaseAggregateRequestData { + this := CaseAggregateRequestData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseAggregateRequestDataWithDefaults instantiates a new CaseAggregateRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateRequestDataWithDefaults() *CaseAggregateRequestData { + this := CaseAggregateRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseAggregateRequestData) GetAttributes() CaseAggregateRequestAttributes { + if o == nil { + var ret CaseAggregateRequestAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateRequestData) GetAttributesOk() (*CaseAggregateRequestAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseAggregateRequestData) SetAttributes(v CaseAggregateRequestAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseAggregateRequestData) GetType() CaseAggregateResourceType { + if o == nil { + var ret CaseAggregateResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateRequestData) GetTypeOk() (*CaseAggregateResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseAggregateRequestData) SetType(v CaseAggregateResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseAggregateRequestAttributes `json:"attributes"` + Type *CaseAggregateResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_resource_type.go b/api/datadogV2/model_case_aggregate_resource_type.go new file mode 100644 index 00000000000..6f48f7ec21e --- /dev/null +++ b/api/datadogV2/model_case_aggregate_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateResourceType JSON:API resource type for case aggregation requests. +type CaseAggregateResourceType string + +// List of CaseAggregateResourceType. +const ( + CASEAGGREGATERESOURCETYPE_AGGREGATE CaseAggregateResourceType = "aggregate" +) + +var allowedCaseAggregateResourceTypeEnumValues = []CaseAggregateResourceType{ + CASEAGGREGATERESOURCETYPE_AGGREGATE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseAggregateResourceType) GetAllowedValues() []CaseAggregateResourceType { + return allowedCaseAggregateResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseAggregateResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseAggregateResourceType(value) + return nil +} + +// NewCaseAggregateResourceTypeFromValue returns a pointer to a valid CaseAggregateResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseAggregateResourceTypeFromValue(v string) (*CaseAggregateResourceType, error) { + ev := CaseAggregateResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseAggregateResourceType: valid values are %v", v, allowedCaseAggregateResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseAggregateResourceType) IsValid() bool { + for _, existing := range allowedCaseAggregateResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseAggregateResourceType value. +func (v CaseAggregateResourceType) Ptr() *CaseAggregateResourceType { + return &v +} diff --git a/api/datadogV2/model_case_aggregate_response.go b/api/datadogV2/model_case_aggregate_response.go new file mode 100644 index 00000000000..e4a2af91f64 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateResponse Response containing aggregated case counts grouped by the requested fields. +type CaseAggregateResponse struct { + // Data object containing the aggregation results, including total count and per-group breakdowns. + Data CaseAggregateResponseData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateResponse instantiates a new CaseAggregateResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateResponse(data CaseAggregateResponseData) *CaseAggregateResponse { + this := CaseAggregateResponse{} + this.Data = data + return &this +} + +// NewCaseAggregateResponseWithDefaults instantiates a new CaseAggregateResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateResponseWithDefaults() *CaseAggregateResponse { + this := CaseAggregateResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseAggregateResponse) GetData() CaseAggregateResponseData { + if o == nil { + var ret CaseAggregateResponseData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponse) GetDataOk() (*CaseAggregateResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseAggregateResponse) SetData(v CaseAggregateResponseData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseAggregateResponseData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_response_attributes.go b/api/datadogV2/model_case_aggregate_response_attributes.go new file mode 100644 index 00000000000..6245e6fe9d7 --- /dev/null +++ b/api/datadogV2/model_case_aggregate_response_attributes.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateResponseAttributes Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns. +type CaseAggregateResponseAttributes struct { + // Aggregated groups. + Groups []CaseAggregateGroup `json:"groups"` + // Total count of aggregated cases. + Total float64 `json:"total"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateResponseAttributes instantiates a new CaseAggregateResponseAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateResponseAttributes(groups []CaseAggregateGroup, total float64) *CaseAggregateResponseAttributes { + this := CaseAggregateResponseAttributes{} + this.Groups = groups + this.Total = total + return &this +} + +// NewCaseAggregateResponseAttributesWithDefaults instantiates a new CaseAggregateResponseAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateResponseAttributesWithDefaults() *CaseAggregateResponseAttributes { + this := CaseAggregateResponseAttributes{} + return &this +} + +// GetGroups returns the Groups field value. +func (o *CaseAggregateResponseAttributes) GetGroups() []CaseAggregateGroup { + if o == nil { + var ret []CaseAggregateGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponseAttributes) GetGroupsOk() (*[]CaseAggregateGroup, bool) { + if o == nil { + return nil, false + } + return &o.Groups, true +} + +// SetGroups sets field value. +func (o *CaseAggregateResponseAttributes) SetGroups(v []CaseAggregateGroup) { + o.Groups = v +} + +// GetTotal returns the Total field value. +func (o *CaseAggregateResponseAttributes) GetTotal() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponseAttributes) GetTotalOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value. +func (o *CaseAggregateResponseAttributes) SetTotal(v float64) { + o.Total = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateResponseAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["groups"] = o.Groups + toSerialize["total"] = o.Total + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Groups *[]CaseAggregateGroup `json:"groups"` + Total *float64 `json:"total"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Groups == nil { + return fmt.Errorf("required field groups missing") + } + if all.Total == nil { + return fmt.Errorf("required field total missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"groups", "total"}) + } else { + return err + } + o.Groups = *all.Groups + o.Total = *all.Total + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_aggregate_response_data.go b/api/datadogV2/model_case_aggregate_response_data.go new file mode 100644 index 00000000000..96c0ded369a --- /dev/null +++ b/api/datadogV2/model_case_aggregate_response_data.go @@ -0,0 +1,174 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAggregateResponseData Data object containing the aggregation results, including total count and per-group breakdowns. +type CaseAggregateResponseData struct { + // Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns. + Attributes CaseAggregateResponseAttributes `json:"attributes"` + // Aggregate response identifier. + Id string `json:"id"` + // Aggregate resource type. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseAggregateResponseData instantiates a new CaseAggregateResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseAggregateResponseData(attributes CaseAggregateResponseAttributes, id string, typeVar string) *CaseAggregateResponseData { + this := CaseAggregateResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCaseAggregateResponseDataWithDefaults instantiates a new CaseAggregateResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseAggregateResponseDataWithDefaults() *CaseAggregateResponseData { + this := CaseAggregateResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseAggregateResponseData) GetAttributes() CaseAggregateResponseAttributes { + if o == nil { + var ret CaseAggregateResponseAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponseData) GetAttributesOk() (*CaseAggregateResponseAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseAggregateResponseData) SetAttributes(v CaseAggregateResponseAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CaseAggregateResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CaseAggregateResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CaseAggregateResponseData) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseAggregateResponseData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseAggregateResponseData) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseAggregateResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseAggregateResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseAggregateResponseAttributes `json:"attributes"` + Id *string `json:"id"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_assign.go b/api/datadogV2/model_case_assign.go index eceb3e9b744..ac1906b2984 100644 --- a/api/datadogV2/model_case_assign.go +++ b/api/datadogV2/model_case_assign.go @@ -14,7 +14,7 @@ import ( type CaseAssign struct { // Case assign attributes Attributes CaseAssignAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_attributes.go b/api/datadogV2/model_case_attributes.go index 763cd7b5a35..415f7c62a2d 100644 --- a/api/datadogV2/model_case_attributes.go +++ b/api/datadogV2/model_case_attributes.go @@ -14,7 +14,7 @@ import ( type CaseAttributes struct { // Timestamp of when the case was archived ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"` - // The definition of `CaseObjectAttributes` object. + // Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags. Attributes map[string][]string `json:"attributes,omitempty"` // Timestamp of when the case was closed ClosedAt datadog.NullableTime `json:"closed_at,omitempty"` diff --git a/api/datadogV2/model_case_automation_rule_resource_type.go b/api/datadogV2/model_case_automation_rule_resource_type.go new file mode 100644 index 00000000000..c656ebc0d05 --- /dev/null +++ b/api/datadogV2/model_case_automation_rule_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAutomationRuleResourceType JSON:API resource type for case automation rules. +type CaseAutomationRuleResourceType string + +// List of CaseAutomationRuleResourceType. +const ( + CASEAUTOMATIONRULERESOURCETYPE_RULE CaseAutomationRuleResourceType = "rule" +) + +var allowedCaseAutomationRuleResourceTypeEnumValues = []CaseAutomationRuleResourceType{ + CASEAUTOMATIONRULERESOURCETYPE_RULE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseAutomationRuleResourceType) GetAllowedValues() []CaseAutomationRuleResourceType { + return allowedCaseAutomationRuleResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseAutomationRuleResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseAutomationRuleResourceType(value) + return nil +} + +// NewCaseAutomationRuleResourceTypeFromValue returns a pointer to a valid CaseAutomationRuleResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseAutomationRuleResourceTypeFromValue(v string) (*CaseAutomationRuleResourceType, error) { + ev := CaseAutomationRuleResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseAutomationRuleResourceType: valid values are %v", v, allowedCaseAutomationRuleResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseAutomationRuleResourceType) IsValid() bool { + for _, existing := range allowedCaseAutomationRuleResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseAutomationRuleResourceType value. +func (v CaseAutomationRuleResourceType) Ptr() *CaseAutomationRuleResourceType { + return &v +} diff --git a/api/datadogV2/model_case_automation_rule_state.go b/api/datadogV2/model_case_automation_rule_state.go new file mode 100644 index 00000000000..b6d5cfdfe99 --- /dev/null +++ b/api/datadogV2/model_case_automation_rule_state.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseAutomationRuleState Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. +type CaseAutomationRuleState string + +// List of CaseAutomationRuleState. +const ( + CASEAUTOMATIONRULESTATE_ENABLED CaseAutomationRuleState = "ENABLED" + CASEAUTOMATIONRULESTATE_DISABLED CaseAutomationRuleState = "DISABLED" +) + +var allowedCaseAutomationRuleStateEnumValues = []CaseAutomationRuleState{ + CASEAUTOMATIONRULESTATE_ENABLED, + CASEAUTOMATIONRULESTATE_DISABLED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseAutomationRuleState) GetAllowedValues() []CaseAutomationRuleState { + return allowedCaseAutomationRuleStateEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseAutomationRuleState) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseAutomationRuleState(value) + return nil +} + +// NewCaseAutomationRuleStateFromValue returns a pointer to a valid CaseAutomationRuleState +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseAutomationRuleStateFromValue(v string) (*CaseAutomationRuleState, error) { + ev := CaseAutomationRuleState(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseAutomationRuleState: valid values are %v", v, allowedCaseAutomationRuleStateEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseAutomationRuleState) IsValid() bool { + for _, existing := range allowedCaseAutomationRuleStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseAutomationRuleState value. +func (v CaseAutomationRuleState) Ptr() *CaseAutomationRuleState { + return &v +} diff --git a/api/datadogV2/model_case_bulk_action_type.go b/api/datadogV2/model_case_bulk_action_type.go new file mode 100644 index 00000000000..d62df063265 --- /dev/null +++ b/api/datadogV2/model_case_bulk_action_type.go @@ -0,0 +1,82 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseBulkActionType The type of action to apply in a bulk update. Allowed values are `priority`, `status`, `assign`, `unassign`, `archive`, `unarchive`, `jira`, `servicenow`, `linear`, `update_project`. +type CaseBulkActionType string + +// List of CaseBulkActionType. +const ( + CASEBULKACTIONTYPE_PRIORITY CaseBulkActionType = "priority" + CASEBULKACTIONTYPE_STATUS CaseBulkActionType = "status" + CASEBULKACTIONTYPE_ASSIGN CaseBulkActionType = "assign" + CASEBULKACTIONTYPE_UNASSIGN CaseBulkActionType = "unassign" + CASEBULKACTIONTYPE_ARCHIVE CaseBulkActionType = "archive" + CASEBULKACTIONTYPE_UNARCHIVE CaseBulkActionType = "unarchive" + CASEBULKACTIONTYPE_JIRA CaseBulkActionType = "jira" + CASEBULKACTIONTYPE_SERVICENOW CaseBulkActionType = "servicenow" + CASEBULKACTIONTYPE_LINEAR CaseBulkActionType = "linear" + CASEBULKACTIONTYPE_UPDATE_PROJECT CaseBulkActionType = "update_project" +) + +var allowedCaseBulkActionTypeEnumValues = []CaseBulkActionType{ + CASEBULKACTIONTYPE_PRIORITY, + CASEBULKACTIONTYPE_STATUS, + CASEBULKACTIONTYPE_ASSIGN, + CASEBULKACTIONTYPE_UNASSIGN, + CASEBULKACTIONTYPE_ARCHIVE, + CASEBULKACTIONTYPE_UNARCHIVE, + CASEBULKACTIONTYPE_JIRA, + CASEBULKACTIONTYPE_SERVICENOW, + CASEBULKACTIONTYPE_LINEAR, + CASEBULKACTIONTYPE_UPDATE_PROJECT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseBulkActionType) GetAllowedValues() []CaseBulkActionType { + return allowedCaseBulkActionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseBulkActionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseBulkActionType(value) + return nil +} + +// NewCaseBulkActionTypeFromValue returns a pointer to a valid CaseBulkActionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseBulkActionTypeFromValue(v string) (*CaseBulkActionType, error) { + ev := CaseBulkActionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseBulkActionType: valid values are %v", v, allowedCaseBulkActionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseBulkActionType) IsValid() bool { + for _, existing := range allowedCaseBulkActionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseBulkActionType value. +func (v CaseBulkActionType) Ptr() *CaseBulkActionType { + return &v +} diff --git a/api/datadogV2/model_case_bulk_resource_type.go b/api/datadogV2/model_case_bulk_resource_type.go new file mode 100644 index 00000000000..8c138cde05e --- /dev/null +++ b/api/datadogV2/model_case_bulk_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseBulkResourceType JSON:API resource type for bulk case operations. +type CaseBulkResourceType string + +// List of CaseBulkResourceType. +const ( + CASEBULKRESOURCETYPE_BULK CaseBulkResourceType = "bulk" +) + +var allowedCaseBulkResourceTypeEnumValues = []CaseBulkResourceType{ + CASEBULKRESOURCETYPE_BULK, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseBulkResourceType) GetAllowedValues() []CaseBulkResourceType { + return allowedCaseBulkResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseBulkResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseBulkResourceType(value) + return nil +} + +// NewCaseBulkResourceTypeFromValue returns a pointer to a valid CaseBulkResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseBulkResourceTypeFromValue(v string) (*CaseBulkResourceType, error) { + ev := CaseBulkResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseBulkResourceType: valid values are %v", v, allowedCaseBulkResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseBulkResourceType) IsValid() bool { + for _, existing := range allowedCaseBulkResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseBulkResourceType value. +func (v CaseBulkResourceType) Ptr() *CaseBulkResourceType { + return &v +} diff --git a/api/datadogV2/model_case_bulk_update_request.go b/api/datadogV2/model_case_bulk_update_request.go new file mode 100644 index 00000000000..c8c9b8e925b --- /dev/null +++ b/api/datadogV2/model_case_bulk_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseBulkUpdateRequest Request payload for applying a single action (such as changing priority, status, or assignment) to multiple cases at once. +type CaseBulkUpdateRequest struct { + // Data object wrapping the bulk update type and attributes. + Data CaseBulkUpdateRequestData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseBulkUpdateRequest instantiates a new CaseBulkUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseBulkUpdateRequest(data CaseBulkUpdateRequestData) *CaseBulkUpdateRequest { + this := CaseBulkUpdateRequest{} + this.Data = data + return &this +} + +// NewCaseBulkUpdateRequestWithDefaults instantiates a new CaseBulkUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseBulkUpdateRequestWithDefaults() *CaseBulkUpdateRequest { + this := CaseBulkUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseBulkUpdateRequest) GetData() CaseBulkUpdateRequestData { + if o == nil { + var ret CaseBulkUpdateRequestData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequest) GetDataOk() (*CaseBulkUpdateRequestData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseBulkUpdateRequest) SetData(v CaseBulkUpdateRequestData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseBulkUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseBulkUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseBulkUpdateRequestData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_bulk_update_request_attributes.go b/api/datadogV2/model_case_bulk_update_request_attributes.go new file mode 100644 index 00000000000..ea766f598ae --- /dev/null +++ b/api/datadogV2/model_case_bulk_update_request_attributes.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseBulkUpdateRequestAttributes Attributes for the bulk update, specifying which cases to update and the action to apply. +type CaseBulkUpdateRequestAttributes struct { + // An array of case identifiers to apply the bulk action to. + CaseIds []string `json:"case_ids"` + // A key-value map of action-specific parameters. The required keys depend on the action type (for example, `priority` for the priority action, `assignee_id` for assign). + Payload map[string]string `json:"payload,omitempty"` + // The type of action to apply in a bulk update. Allowed values are `priority`, `status`, `assign`, `unassign`, `archive`, `unarchive`, `jira`, `servicenow`, `linear`, `update_project`. + Type CaseBulkActionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseBulkUpdateRequestAttributes instantiates a new CaseBulkUpdateRequestAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseBulkUpdateRequestAttributes(caseIds []string, typeVar CaseBulkActionType) *CaseBulkUpdateRequestAttributes { + this := CaseBulkUpdateRequestAttributes{} + this.CaseIds = caseIds + this.Type = typeVar + return &this +} + +// NewCaseBulkUpdateRequestAttributesWithDefaults instantiates a new CaseBulkUpdateRequestAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseBulkUpdateRequestAttributesWithDefaults() *CaseBulkUpdateRequestAttributes { + this := CaseBulkUpdateRequestAttributes{} + return &this +} + +// GetCaseIds returns the CaseIds field value. +func (o *CaseBulkUpdateRequestAttributes) GetCaseIds() []string { + if o == nil { + var ret []string + return ret + } + return o.CaseIds +} + +// GetCaseIdsOk returns a tuple with the CaseIds field value +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequestAttributes) GetCaseIdsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.CaseIds, true +} + +// SetCaseIds sets field value. +func (o *CaseBulkUpdateRequestAttributes) SetCaseIds(v []string) { + o.CaseIds = v +} + +// GetPayload returns the Payload field value if set, zero value otherwise. +func (o *CaseBulkUpdateRequestAttributes) GetPayload() map[string]string { + if o == nil || o.Payload == nil { + var ret map[string]string + return ret + } + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequestAttributes) GetPayloadOk() (*map[string]string, bool) { + if o == nil || o.Payload == nil { + return nil, false + } + return &o.Payload, true +} + +// HasPayload returns a boolean if a field has been set. +func (o *CaseBulkUpdateRequestAttributes) HasPayload() bool { + return o != nil && o.Payload != nil +} + +// SetPayload gets a reference to the given map[string]string and assigns it to the Payload field. +func (o *CaseBulkUpdateRequestAttributes) SetPayload(v map[string]string) { + o.Payload = v +} + +// GetType returns the Type field value. +func (o *CaseBulkUpdateRequestAttributes) GetType() CaseBulkActionType { + if o == nil { + var ret CaseBulkActionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequestAttributes) GetTypeOk() (*CaseBulkActionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseBulkUpdateRequestAttributes) SetType(v CaseBulkActionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseBulkUpdateRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["case_ids"] = o.CaseIds + if o.Payload != nil { + toSerialize["payload"] = o.Payload + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseBulkUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CaseIds *[]string `json:"case_ids"` + Payload map[string]string `json:"payload,omitempty"` + Type *CaseBulkActionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CaseIds == nil { + return fmt.Errorf("required field case_ids missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"case_ids", "payload", "type"}) + } else { + return err + } + + hasInvalidField := false + o.CaseIds = *all.CaseIds + o.Payload = all.Payload + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_bulk_update_request_data.go b/api/datadogV2/model_case_bulk_update_request_data.go new file mode 100644 index 00000000000..f4a574bc0f9 --- /dev/null +++ b/api/datadogV2/model_case_bulk_update_request_data.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseBulkUpdateRequestData Data object wrapping the bulk update type and attributes. +type CaseBulkUpdateRequestData struct { + // Attributes for the bulk update, specifying which cases to update and the action to apply. + Attributes CaseBulkUpdateRequestAttributes `json:"attributes"` + // JSON:API resource type for bulk case operations. + Type CaseBulkResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseBulkUpdateRequestData instantiates a new CaseBulkUpdateRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseBulkUpdateRequestData(attributes CaseBulkUpdateRequestAttributes, typeVar CaseBulkResourceType) *CaseBulkUpdateRequestData { + this := CaseBulkUpdateRequestData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseBulkUpdateRequestDataWithDefaults instantiates a new CaseBulkUpdateRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseBulkUpdateRequestDataWithDefaults() *CaseBulkUpdateRequestData { + this := CaseBulkUpdateRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseBulkUpdateRequestData) GetAttributes() CaseBulkUpdateRequestAttributes { + if o == nil { + var ret CaseBulkUpdateRequestAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequestData) GetAttributesOk() (*CaseBulkUpdateRequestAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseBulkUpdateRequestData) SetAttributes(v CaseBulkUpdateRequestAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseBulkUpdateRequestData) GetType() CaseBulkResourceType { + if o == nil { + var ret CaseBulkResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseBulkUpdateRequestData) GetTypeOk() (*CaseBulkResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseBulkUpdateRequestData) SetType(v CaseBulkResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseBulkUpdateRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseBulkUpdateRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseBulkUpdateRequestAttributes `json:"attributes"` + Type *CaseBulkResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_comment.go b/api/datadogV2/model_case_comment.go index 25fb4016742..2df3e047794 100644 --- a/api/datadogV2/model_case_comment.go +++ b/api/datadogV2/model_case_comment.go @@ -14,7 +14,7 @@ import ( type CaseComment struct { // Case comment attributes Attributes CaseCommentAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_count_group.go b/api/datadogV2/model_case_count_group.go new file mode 100644 index 00000000000..70a976dcd02 --- /dev/null +++ b/api/datadogV2/model_case_count_group.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseCountGroup A facet group containing counts broken down by the distinct values of a case field (for example, status or priority). +type CaseCountGroup struct { + // The name of the field being grouped on (for example, `status` or `priority`). + Group string `json:"group"` + // Values within this group. + GroupValues []CaseCountGroupValue `json:"group_values"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseCountGroup instantiates a new CaseCountGroup object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseCountGroup(group string, groupValues []CaseCountGroupValue) *CaseCountGroup { + this := CaseCountGroup{} + this.Group = group + this.GroupValues = groupValues + return &this +} + +// NewCaseCountGroupWithDefaults instantiates a new CaseCountGroup object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseCountGroupWithDefaults() *CaseCountGroup { + this := CaseCountGroup{} + return &this +} + +// GetGroup returns the Group field value. +func (o *CaseCountGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *CaseCountGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value. +func (o *CaseCountGroup) SetGroup(v string) { + o.Group = v +} + +// GetGroupValues returns the GroupValues field value. +func (o *CaseCountGroup) GetGroupValues() []CaseCountGroupValue { + if o == nil { + var ret []CaseCountGroupValue + return ret + } + return o.GroupValues +} + +// GetGroupValuesOk returns a tuple with the GroupValues field value +// and a boolean to check if the value has been set. +func (o *CaseCountGroup) GetGroupValuesOk() (*[]CaseCountGroupValue, bool) { + if o == nil { + return nil, false + } + return &o.GroupValues, true +} + +// SetGroupValues sets field value. +func (o *CaseCountGroup) SetGroupValues(v []CaseCountGroupValue) { + o.GroupValues = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseCountGroup) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["group"] = o.Group + toSerialize["group_values"] = o.GroupValues + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseCountGroup) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Group *string `json:"group"` + GroupValues *[]CaseCountGroupValue `json:"group_values"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Group == nil { + return fmt.Errorf("required field group missing") + } + if all.GroupValues == nil { + return fmt.Errorf("required field group_values missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"group", "group_values"}) + } else { + return err + } + o.Group = *all.Group + o.GroupValues = *all.GroupValues + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_count_group_value.go b/api/datadogV2/model_case_count_group_value.go new file mode 100644 index 00000000000..6f51deafd42 --- /dev/null +++ b/api/datadogV2/model_case_count_group_value.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseCountGroupValue A single value within a count group, representing the number of cases with that specific field value. +type CaseCountGroupValue struct { + // Count of cases for this value. + Count int64 `json:"count"` + // The group value. + Value string `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseCountGroupValue instantiates a new CaseCountGroupValue object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseCountGroupValue(count int64, value string) *CaseCountGroupValue { + this := CaseCountGroupValue{} + this.Count = count + this.Value = value + return &this +} + +// NewCaseCountGroupValueWithDefaults instantiates a new CaseCountGroupValue object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseCountGroupValueWithDefaults() *CaseCountGroupValue { + this := CaseCountGroupValue{} + return &this +} + +// GetCount returns the Count field value. +func (o *CaseCountGroupValue) GetCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *CaseCountGroupValue) GetCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value. +func (o *CaseCountGroupValue) SetCount(v int64) { + o.Count = v +} + +// GetValue returns the Value field value. +func (o *CaseCountGroupValue) GetValue() string { + if o == nil { + var ret string + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CaseCountGroupValue) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *CaseCountGroupValue) SetValue(v string) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseCountGroupValue) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["count"] = o.Count + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseCountGroupValue) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Count *int64 `json:"count"` + Value *string `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Count == nil { + return fmt.Errorf("required field count missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"count", "value"}) + } else { + return err + } + o.Count = *all.Count + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_count_response.go b/api/datadogV2/model_case_count_response.go new file mode 100644 index 00000000000..6665d14d3c5 --- /dev/null +++ b/api/datadogV2/model_case_count_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseCountResponse Response containing the total number of cases matching a query, optionally grouped by specified fields. +type CaseCountResponse struct { + // Data object containing the count results, including per-field group breakdowns. + Data CaseCountResponseData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseCountResponse instantiates a new CaseCountResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseCountResponse(data CaseCountResponseData) *CaseCountResponse { + this := CaseCountResponse{} + this.Data = data + return &this +} + +// NewCaseCountResponseWithDefaults instantiates a new CaseCountResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseCountResponseWithDefaults() *CaseCountResponse { + this := CaseCountResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseCountResponse) GetData() CaseCountResponseData { + if o == nil { + var ret CaseCountResponseData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseCountResponse) GetDataOk() (*CaseCountResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseCountResponse) SetData(v CaseCountResponseData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseCountResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseCountResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseCountResponseData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_count_response_attributes.go b/api/datadogV2/model_case_count_response_attributes.go new file mode 100644 index 00000000000..88d7e7cbeea --- /dev/null +++ b/api/datadogV2/model_case_count_response_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseCountResponseAttributes Attributes for the count response, including the total count and optional facet breakdowns. +type CaseCountResponseAttributes struct { + // List of facet groups, one per field specified in `group_bys`. + Groups []CaseCountGroup `json:"groups"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseCountResponseAttributes instantiates a new CaseCountResponseAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseCountResponseAttributes(groups []CaseCountGroup) *CaseCountResponseAttributes { + this := CaseCountResponseAttributes{} + this.Groups = groups + return &this +} + +// NewCaseCountResponseAttributesWithDefaults instantiates a new CaseCountResponseAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseCountResponseAttributesWithDefaults() *CaseCountResponseAttributes { + this := CaseCountResponseAttributes{} + return &this +} + +// GetGroups returns the Groups field value. +func (o *CaseCountResponseAttributes) GetGroups() []CaseCountGroup { + if o == nil { + var ret []CaseCountGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *CaseCountResponseAttributes) GetGroupsOk() (*[]CaseCountGroup, bool) { + if o == nil { + return nil, false + } + return &o.Groups, true +} + +// SetGroups sets field value. +func (o *CaseCountResponseAttributes) SetGroups(v []CaseCountGroup) { + o.Groups = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseCountResponseAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["groups"] = o.Groups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseCountResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Groups *[]CaseCountGroup `json:"groups"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Groups == nil { + return fmt.Errorf("required field groups missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"groups"}) + } else { + return err + } + o.Groups = *all.Groups + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_count_response_data.go b/api/datadogV2/model_case_count_response_data.go new file mode 100644 index 00000000000..34bdd9ed1b8 --- /dev/null +++ b/api/datadogV2/model_case_count_response_data.go @@ -0,0 +1,174 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseCountResponseData Data object containing the count results, including per-field group breakdowns. +type CaseCountResponseData struct { + // Attributes for the count response, including the total count and optional facet breakdowns. + Attributes CaseCountResponseAttributes `json:"attributes"` + // Count response identifier. + Id string `json:"id"` + // Count resource type. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseCountResponseData instantiates a new CaseCountResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseCountResponseData(attributes CaseCountResponseAttributes, id string, typeVar string) *CaseCountResponseData { + this := CaseCountResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCaseCountResponseDataWithDefaults instantiates a new CaseCountResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseCountResponseDataWithDefaults() *CaseCountResponseData { + this := CaseCountResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseCountResponseData) GetAttributes() CaseCountResponseAttributes { + if o == nil { + var ret CaseCountResponseAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseCountResponseData) GetAttributesOk() (*CaseCountResponseAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseCountResponseData) SetAttributes(v CaseCountResponseAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CaseCountResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CaseCountResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CaseCountResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CaseCountResponseData) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseCountResponseData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseCountResponseData) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseCountResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseCountResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseCountResponseAttributes `json:"attributes"` + Id *string `json:"id"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_create.go b/api/datadogV2/model_case_create.go index 05cceaaa131..1834d074ae9 100644 --- a/api/datadogV2/model_case_create.go +++ b/api/datadogV2/model_case_create.go @@ -16,7 +16,7 @@ type CaseCreate struct { Attributes CaseCreateAttributes `json:"attributes"` // Relationships formed with the case on creation Relationships *CaseCreateRelationships `json:"relationships,omitempty"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_empty.go b/api/datadogV2/model_case_empty.go index dbdd48c18df..7514c6785c9 100644 --- a/api/datadogV2/model_case_empty.go +++ b/api/datadogV2/model_case_empty.go @@ -12,7 +12,7 @@ import ( // CaseEmpty Case empty request data type CaseEmpty struct { - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_insight.go b/api/datadogV2/model_case_insight.go new file mode 100644 index 00000000000..d1fa544074d --- /dev/null +++ b/api/datadogV2/model_case_insight.go @@ -0,0 +1,175 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseInsight A reference to an external Datadog resource that provides investigative context for a case, such as a security signal, monitor alert, error tracking issue, or incident. +type CaseInsight struct { + // The URL path or deep link to the insight resource within Datadog (for example, `/monitors/12345?q=total`). + Ref string `json:"ref"` + // The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID). + ResourceId string `json:"resource_id"` + // The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). + Type CaseInsightType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseInsight instantiates a new CaseInsight object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseInsight(ref string, resourceId string, typeVar CaseInsightType) *CaseInsight { + this := CaseInsight{} + this.Ref = ref + this.ResourceId = resourceId + this.Type = typeVar + return &this +} + +// NewCaseInsightWithDefaults instantiates a new CaseInsight object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseInsightWithDefaults() *CaseInsight { + this := CaseInsight{} + return &this +} + +// GetRef returns the Ref field value. +func (o *CaseInsight) GetRef() string { + if o == nil { + var ret string + return ret + } + return o.Ref +} + +// GetRefOk returns a tuple with the Ref field value +// and a boolean to check if the value has been set. +func (o *CaseInsight) GetRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Ref, true +} + +// SetRef sets field value. +func (o *CaseInsight) SetRef(v string) { + o.Ref = v +} + +// GetResourceId returns the ResourceId field value. +func (o *CaseInsight) GetResourceId() string { + if o == nil { + var ret string + return ret + } + return o.ResourceId +} + +// GetResourceIdOk returns a tuple with the ResourceId field value +// and a boolean to check if the value has been set. +func (o *CaseInsight) GetResourceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceId, true +} + +// SetResourceId sets field value. +func (o *CaseInsight) SetResourceId(v string) { + o.ResourceId = v +} + +// GetType returns the Type field value. +func (o *CaseInsight) GetType() CaseInsightType { + if o == nil { + var ret CaseInsightType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseInsight) GetTypeOk() (*CaseInsightType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseInsight) SetType(v CaseInsightType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseInsight) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["ref"] = o.Ref + toSerialize["resource_id"] = o.ResourceId + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseInsight) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Ref *string `json:"ref"` + ResourceId *string `json:"resource_id"` + Type *CaseInsightType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Ref == nil { + return fmt.Errorf("required field ref missing") + } + if all.ResourceId == nil { + return fmt.Errorf("required field resource_id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"ref", "resource_id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Ref = *all.Ref + o.ResourceId = *all.ResourceId + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_insight_type.go b/api/datadogV2/model_case_insight_type.go new file mode 100644 index 00000000000..23f57927972 --- /dev/null +++ b/api/datadogV2/model_case_insight_type.go @@ -0,0 +1,94 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseInsightType The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). +type CaseInsightType string + +// List of CaseInsightType. +const ( + CASEINSIGHTTYPE_SECURITY_SIGNAL CaseInsightType = "SECURITY_SIGNAL" + CASEINSIGHTTYPE_MONITOR CaseInsightType = "MONITOR" + CASEINSIGHTTYPE_EVENT_CORRELATION CaseInsightType = "EVENT_CORRELATION" + CASEINSIGHTTYPE_ERROR_TRACKING CaseInsightType = "ERROR_TRACKING" + CASEINSIGHTTYPE_CLOUD_COST_RECOMMENDATION CaseInsightType = "CLOUD_COST_RECOMMENDATION" + CASEINSIGHTTYPE_INCIDENT CaseInsightType = "INCIDENT" + CASEINSIGHTTYPE_SENSITIVE_DATA_SCANNER_ISSUE CaseInsightType = "SENSITIVE_DATA_SCANNER_ISSUE" + CASEINSIGHTTYPE_EVENT CaseInsightType = "EVENT" + CASEINSIGHTTYPE_WATCHDOG_STORY CaseInsightType = "WATCHDOG_STORY" + CASEINSIGHTTYPE_WIDGET CaseInsightType = "WIDGET" + CASEINSIGHTTYPE_SECURITY_FINDING CaseInsightType = "SECURITY_FINDING" + CASEINSIGHTTYPE_INSIGHT_SCORECARD_CAMPAIGN CaseInsightType = "INSIGHT_SCORECARD_CAMPAIGN" + CASEINSIGHTTYPE_RESOURCE_POLICY CaseInsightType = "RESOURCE_POLICY" + CASEINSIGHTTYPE_APM_RECOMMENDATION CaseInsightType = "APM_RECOMMENDATION" + CASEINSIGHTTYPE_SCM_URL CaseInsightType = "SCM_URL" + CASEINSIGHTTYPE_PROFILING_DOWNSIZING_EXPERIMENT CaseInsightType = "PROFILING_DOWNSIZING_EXPERIMENT" +) + +var allowedCaseInsightTypeEnumValues = []CaseInsightType{ + CASEINSIGHTTYPE_SECURITY_SIGNAL, + CASEINSIGHTTYPE_MONITOR, + CASEINSIGHTTYPE_EVENT_CORRELATION, + CASEINSIGHTTYPE_ERROR_TRACKING, + CASEINSIGHTTYPE_CLOUD_COST_RECOMMENDATION, + CASEINSIGHTTYPE_INCIDENT, + CASEINSIGHTTYPE_SENSITIVE_DATA_SCANNER_ISSUE, + CASEINSIGHTTYPE_EVENT, + CASEINSIGHTTYPE_WATCHDOG_STORY, + CASEINSIGHTTYPE_WIDGET, + CASEINSIGHTTYPE_SECURITY_FINDING, + CASEINSIGHTTYPE_INSIGHT_SCORECARD_CAMPAIGN, + CASEINSIGHTTYPE_RESOURCE_POLICY, + CASEINSIGHTTYPE_APM_RECOMMENDATION, + CASEINSIGHTTYPE_SCM_URL, + CASEINSIGHTTYPE_PROFILING_DOWNSIZING_EXPERIMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseInsightType) GetAllowedValues() []CaseInsightType { + return allowedCaseInsightTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseInsightType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseInsightType(value) + return nil +} + +// NewCaseInsightTypeFromValue returns a pointer to a valid CaseInsightType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseInsightTypeFromValue(v string) (*CaseInsightType, error) { + ev := CaseInsightType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseInsightType: valid values are %v", v, allowedCaseInsightTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseInsightType) IsValid() bool { + for _, existing := range allowedCaseInsightTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseInsightType value. +func (v CaseInsightType) Ptr() *CaseInsightType { + return &v +} diff --git a/api/datadogV2/model_case_insights_attributes.go b/api/datadogV2/model_case_insights_attributes.go new file mode 100644 index 00000000000..8bff4e8724c --- /dev/null +++ b/api/datadogV2/model_case_insights_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseInsightsAttributes Attributes for adding or removing insights from a case. +type CaseInsightsAttributes struct { + // Array of insights to add to or remove from a case. + Insights []CaseInsight `json:"insights"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseInsightsAttributes instantiates a new CaseInsightsAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseInsightsAttributes(insights []CaseInsight) *CaseInsightsAttributes { + this := CaseInsightsAttributes{} + this.Insights = insights + return &this +} + +// NewCaseInsightsAttributesWithDefaults instantiates a new CaseInsightsAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseInsightsAttributesWithDefaults() *CaseInsightsAttributes { + this := CaseInsightsAttributes{} + return &this +} + +// GetInsights returns the Insights field value. +func (o *CaseInsightsAttributes) GetInsights() []CaseInsight { + if o == nil { + var ret []CaseInsight + return ret + } + return o.Insights +} + +// GetInsightsOk returns a tuple with the Insights field value +// and a boolean to check if the value has been set. +func (o *CaseInsightsAttributes) GetInsightsOk() (*[]CaseInsight, bool) { + if o == nil { + return nil, false + } + return &o.Insights, true +} + +// SetInsights sets field value. +func (o *CaseInsightsAttributes) SetInsights(v []CaseInsight) { + o.Insights = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseInsightsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["insights"] = o.Insights + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseInsightsAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Insights *[]CaseInsight `json:"insights"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Insights == nil { + return fmt.Errorf("required field insights missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"insights"}) + } else { + return err + } + o.Insights = *all.Insights + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_insights_data.go b/api/datadogV2/model_case_insights_data.go new file mode 100644 index 00000000000..8c03cbc0eb1 --- /dev/null +++ b/api/datadogV2/model_case_insights_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseInsightsData Data object containing the insights to add or remove. +type CaseInsightsData struct { + // Attributes for adding or removing insights from a case. + Attributes CaseInsightsAttributes `json:"attributes"` + // JSON:API resource type for cases. + Type CaseResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseInsightsData instantiates a new CaseInsightsData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseInsightsData(attributes CaseInsightsAttributes, typeVar CaseResourceType) *CaseInsightsData { + this := CaseInsightsData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseInsightsDataWithDefaults instantiates a new CaseInsightsData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseInsightsDataWithDefaults() *CaseInsightsData { + this := CaseInsightsData{} + var typeVar CaseResourceType = CASERESOURCETYPE_CASE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseInsightsData) GetAttributes() CaseInsightsAttributes { + if o == nil { + var ret CaseInsightsAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseInsightsData) GetAttributesOk() (*CaseInsightsAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseInsightsData) SetAttributes(v CaseInsightsAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseInsightsData) GetType() CaseResourceType { + if o == nil { + var ret CaseResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseInsightsData) GetTypeOk() (*CaseResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseInsightsData) SetType(v CaseResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseInsightsData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseInsightsData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseInsightsAttributes `json:"attributes"` + Type *CaseResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_insights_request.go b/api/datadogV2/model_case_insights_request.go new file mode 100644 index 00000000000..8960cebf273 --- /dev/null +++ b/api/datadogV2/model_case_insights_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseInsightsRequest Request payload for adding or removing case insights. +type CaseInsightsRequest struct { + // Data object containing the insights to add or remove. + Data CaseInsightsData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseInsightsRequest instantiates a new CaseInsightsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseInsightsRequest(data CaseInsightsData) *CaseInsightsRequest { + this := CaseInsightsRequest{} + this.Data = data + return &this +} + +// NewCaseInsightsRequestWithDefaults instantiates a new CaseInsightsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseInsightsRequestWithDefaults() *CaseInsightsRequest { + this := CaseInsightsRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseInsightsRequest) GetData() CaseInsightsData { + if o == nil { + var ret CaseInsightsData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseInsightsRequest) GetDataOk() (*CaseInsightsData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseInsightsRequest) SetData(v CaseInsightsData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseInsightsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseInsightsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseInsightsData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_link.go b/api/datadogV2/model_case_link.go new file mode 100644 index 00000000000..927cf4eb983 --- /dev/null +++ b/api/datadogV2/model_case_link.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLink A directional link representing a relationship between two entities. At least one entity must be a case. +type CaseLink struct { + // Attributes describing a directional relationship between two entities (cases, incidents, or pages). + Attributes CaseLinkAttributes `json:"attributes"` + // The case link identifier. + Id string `json:"id"` + // JSON:API resource type for case links. + Type CaseLinkResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLink instantiates a new CaseLink object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLink(attributes CaseLinkAttributes, id string, typeVar CaseLinkResourceType) *CaseLink { + this := CaseLink{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCaseLinkWithDefaults instantiates a new CaseLink object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinkWithDefaults() *CaseLink { + this := CaseLink{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseLink) GetAttributes() CaseLinkAttributes { + if o == nil { + var ret CaseLinkAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseLink) GetAttributesOk() (*CaseLinkAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseLink) SetAttributes(v CaseLinkAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CaseLink) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CaseLink) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CaseLink) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CaseLink) GetType() CaseLinkResourceType { + if o == nil { + var ret CaseLinkResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseLink) GetTypeOk() (*CaseLinkResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseLink) SetType(v CaseLinkResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLink) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLink) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseLinkAttributes `json:"attributes"` + Id *string `json:"id"` + Type *CaseLinkResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_link_attributes.go b/api/datadogV2/model_case_link_attributes.go new file mode 100644 index 00000000000..81a969eaf16 --- /dev/null +++ b/api/datadogV2/model_case_link_attributes.go @@ -0,0 +1,229 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinkAttributes Attributes describing a directional relationship between two entities (cases, incidents, or pages). +type CaseLinkAttributes struct { + // The UUID of the child (target) entity in the relationship. + ChildEntityId string `json:"child_entity_id"` + // The type of the child entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`. + ChildEntityType string `json:"child_entity_type"` + // The UUID of the parent (source) entity in the relationship. + ParentEntityId string `json:"parent_entity_id"` + // The type of the parent entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`. + ParentEntityType string `json:"parent_entity_type"` + // The type of directional relationship. Allowed values: `RELATES_TO` (bidirectional association), `CAUSES` (parent causes child), `BLOCKS` (parent blocks child), `DUPLICATES` (parent duplicates child), `PARENT_OF` (hierarchical), `SUCCESSOR_OF` (sequence), `ESCALATES_TO` (priority escalation). + Relationship string `json:"relationship"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLinkAttributes instantiates a new CaseLinkAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLinkAttributes(childEntityId string, childEntityType string, parentEntityId string, parentEntityType string, relationship string) *CaseLinkAttributes { + this := CaseLinkAttributes{} + this.ChildEntityId = childEntityId + this.ChildEntityType = childEntityType + this.ParentEntityId = parentEntityId + this.ParentEntityType = parentEntityType + this.Relationship = relationship + return &this +} + +// NewCaseLinkAttributesWithDefaults instantiates a new CaseLinkAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinkAttributesWithDefaults() *CaseLinkAttributes { + this := CaseLinkAttributes{} + return &this +} + +// GetChildEntityId returns the ChildEntityId field value. +func (o *CaseLinkAttributes) GetChildEntityId() string { + if o == nil { + var ret string + return ret + } + return o.ChildEntityId +} + +// GetChildEntityIdOk returns a tuple with the ChildEntityId field value +// and a boolean to check if the value has been set. +func (o *CaseLinkAttributes) GetChildEntityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChildEntityId, true +} + +// SetChildEntityId sets field value. +func (o *CaseLinkAttributes) SetChildEntityId(v string) { + o.ChildEntityId = v +} + +// GetChildEntityType returns the ChildEntityType field value. +func (o *CaseLinkAttributes) GetChildEntityType() string { + if o == nil { + var ret string + return ret + } + return o.ChildEntityType +} + +// GetChildEntityTypeOk returns a tuple with the ChildEntityType field value +// and a boolean to check if the value has been set. +func (o *CaseLinkAttributes) GetChildEntityTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChildEntityType, true +} + +// SetChildEntityType sets field value. +func (o *CaseLinkAttributes) SetChildEntityType(v string) { + o.ChildEntityType = v +} + +// GetParentEntityId returns the ParentEntityId field value. +func (o *CaseLinkAttributes) GetParentEntityId() string { + if o == nil { + var ret string + return ret + } + return o.ParentEntityId +} + +// GetParentEntityIdOk returns a tuple with the ParentEntityId field value +// and a boolean to check if the value has been set. +func (o *CaseLinkAttributes) GetParentEntityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentEntityId, true +} + +// SetParentEntityId sets field value. +func (o *CaseLinkAttributes) SetParentEntityId(v string) { + o.ParentEntityId = v +} + +// GetParentEntityType returns the ParentEntityType field value. +func (o *CaseLinkAttributes) GetParentEntityType() string { + if o == nil { + var ret string + return ret + } + return o.ParentEntityType +} + +// GetParentEntityTypeOk returns a tuple with the ParentEntityType field value +// and a boolean to check if the value has been set. +func (o *CaseLinkAttributes) GetParentEntityTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentEntityType, true +} + +// SetParentEntityType sets field value. +func (o *CaseLinkAttributes) SetParentEntityType(v string) { + o.ParentEntityType = v +} + +// GetRelationship returns the Relationship field value. +func (o *CaseLinkAttributes) GetRelationship() string { + if o == nil { + var ret string + return ret + } + return o.Relationship +} + +// GetRelationshipOk returns a tuple with the Relationship field value +// and a boolean to check if the value has been set. +func (o *CaseLinkAttributes) GetRelationshipOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Relationship, true +} + +// SetRelationship sets field value. +func (o *CaseLinkAttributes) SetRelationship(v string) { + o.Relationship = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLinkAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["child_entity_id"] = o.ChildEntityId + toSerialize["child_entity_type"] = o.ChildEntityType + toSerialize["parent_entity_id"] = o.ParentEntityId + toSerialize["parent_entity_type"] = o.ParentEntityType + toSerialize["relationship"] = o.Relationship + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLinkAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ChildEntityId *string `json:"child_entity_id"` + ChildEntityType *string `json:"child_entity_type"` + ParentEntityId *string `json:"parent_entity_id"` + ParentEntityType *string `json:"parent_entity_type"` + Relationship *string `json:"relationship"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ChildEntityId == nil { + return fmt.Errorf("required field child_entity_id missing") + } + if all.ChildEntityType == nil { + return fmt.Errorf("required field child_entity_type missing") + } + if all.ParentEntityId == nil { + return fmt.Errorf("required field parent_entity_id missing") + } + if all.ParentEntityType == nil { + return fmt.Errorf("required field parent_entity_type missing") + } + if all.Relationship == nil { + return fmt.Errorf("required field relationship missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"child_entity_id", "child_entity_type", "parent_entity_id", "parent_entity_type", "relationship"}) + } else { + return err + } + o.ChildEntityId = *all.ChildEntityId + o.ChildEntityType = *all.ChildEntityType + o.ParentEntityId = *all.ParentEntityId + o.ParentEntityType = *all.ParentEntityType + o.Relationship = *all.Relationship + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_link_create.go b/api/datadogV2/model_case_link_create.go new file mode 100644 index 00000000000..93b5f714f13 --- /dev/null +++ b/api/datadogV2/model_case_link_create.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinkCreate Data object for creating a case link. +type CaseLinkCreate struct { + // Attributes describing a directional relationship between two entities (cases, incidents, or pages). + Attributes CaseLinkAttributes `json:"attributes"` + // JSON:API resource type for case links. + Type CaseLinkResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLinkCreate instantiates a new CaseLinkCreate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLinkCreate(attributes CaseLinkAttributes, typeVar CaseLinkResourceType) *CaseLinkCreate { + this := CaseLinkCreate{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseLinkCreateWithDefaults instantiates a new CaseLinkCreate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinkCreateWithDefaults() *CaseLinkCreate { + this := CaseLinkCreate{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseLinkCreate) GetAttributes() CaseLinkAttributes { + if o == nil { + var ret CaseLinkAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseLinkCreate) GetAttributesOk() (*CaseLinkAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseLinkCreate) SetAttributes(v CaseLinkAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseLinkCreate) GetType() CaseLinkResourceType { + if o == nil { + var ret CaseLinkResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseLinkCreate) GetTypeOk() (*CaseLinkResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseLinkCreate) SetType(v CaseLinkResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLinkCreate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLinkCreate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseLinkAttributes `json:"attributes"` + Type *CaseLinkResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_link_create_request.go b/api/datadogV2/model_case_link_create_request.go new file mode 100644 index 00000000000..9369f8f1556 --- /dev/null +++ b/api/datadogV2/model_case_link_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinkCreateRequest Request payload for creating a link between two entities. +type CaseLinkCreateRequest struct { + // Data object for creating a case link. + Data CaseLinkCreate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLinkCreateRequest instantiates a new CaseLinkCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLinkCreateRequest(data CaseLinkCreate) *CaseLinkCreateRequest { + this := CaseLinkCreateRequest{} + this.Data = data + return &this +} + +// NewCaseLinkCreateRequestWithDefaults instantiates a new CaseLinkCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinkCreateRequestWithDefaults() *CaseLinkCreateRequest { + this := CaseLinkCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseLinkCreateRequest) GetData() CaseLinkCreate { + if o == nil { + var ret CaseLinkCreate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseLinkCreateRequest) GetDataOk() (*CaseLinkCreate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseLinkCreateRequest) SetData(v CaseLinkCreate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLinkCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLinkCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseLinkCreate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_link_resource_type.go b/api/datadogV2/model_case_link_resource_type.go new file mode 100644 index 00000000000..913c9d75045 --- /dev/null +++ b/api/datadogV2/model_case_link_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinkResourceType JSON:API resource type for case links. +type CaseLinkResourceType string + +// List of CaseLinkResourceType. +const ( + CASELINKRESOURCETYPE_LINK CaseLinkResourceType = "link" +) + +var allowedCaseLinkResourceTypeEnumValues = []CaseLinkResourceType{ + CASELINKRESOURCETYPE_LINK, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseLinkResourceType) GetAllowedValues() []CaseLinkResourceType { + return allowedCaseLinkResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseLinkResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseLinkResourceType(value) + return nil +} + +// NewCaseLinkResourceTypeFromValue returns a pointer to a valid CaseLinkResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseLinkResourceTypeFromValue(v string) (*CaseLinkResourceType, error) { + ev := CaseLinkResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseLinkResourceType: valid values are %v", v, allowedCaseLinkResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseLinkResourceType) IsValid() bool { + for _, existing := range allowedCaseLinkResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseLinkResourceType value. +func (v CaseLinkResourceType) Ptr() *CaseLinkResourceType { + return &v +} diff --git a/api/datadogV2/model_case_link_response.go b/api/datadogV2/model_case_link_response.go new file mode 100644 index 00000000000..2ea7a488883 --- /dev/null +++ b/api/datadogV2/model_case_link_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinkResponse Response containing a single case link. +type CaseLinkResponse struct { + // A directional link representing a relationship between two entities. At least one entity must be a case. + Data CaseLink `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLinkResponse instantiates a new CaseLinkResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLinkResponse(data CaseLink) *CaseLinkResponse { + this := CaseLinkResponse{} + this.Data = data + return &this +} + +// NewCaseLinkResponseWithDefaults instantiates a new CaseLinkResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinkResponseWithDefaults() *CaseLinkResponse { + this := CaseLinkResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseLinkResponse) GetData() CaseLink { + if o == nil { + var ret CaseLink + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseLinkResponse) GetDataOk() (*CaseLink, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseLinkResponse) SetData(v CaseLink) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLinkResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLinkResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseLink `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_links_response.go b/api/datadogV2/model_case_links_response.go new file mode 100644 index 00000000000..c3bdaaff3fc --- /dev/null +++ b/api/datadogV2/model_case_links_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseLinksResponse Response containing a list of case links. +type CaseLinksResponse struct { + // A list of case links. + Data []CaseLink `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseLinksResponse instantiates a new CaseLinksResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseLinksResponse(data []CaseLink) *CaseLinksResponse { + this := CaseLinksResponse{} + this.Data = data + return &this +} + +// NewCaseLinksResponseWithDefaults instantiates a new CaseLinksResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseLinksResponseWithDefaults() *CaseLinksResponse { + this := CaseLinksResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseLinksResponse) GetData() []CaseLink { + if o == nil { + var ret []CaseLink + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseLinksResponse) GetDataOk() (*[]CaseLink, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseLinksResponse) SetData(v []CaseLink) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseLinksResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseLinksResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CaseLink `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_resource_type.go b/api/datadogV2/model_case_resource_type.go index 248ca99ad18..ae6a864c82c 100644 --- a/api/datadogV2/model_case_resource_type.go +++ b/api/datadogV2/model_case_resource_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseResourceType Case resource type +// CaseResourceType JSON:API resource type for cases. type CaseResourceType string // List of CaseResourceType. diff --git a/api/datadogV2/model_case_type_create.go b/api/datadogV2/model_case_type_create.go index 2ea4255c566..a0955860d8b 100644 --- a/api/datadogV2/model_case_type_create.go +++ b/api/datadogV2/model_case_type_create.go @@ -10,11 +10,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeCreate Case type +// CaseTypeCreate Data object for creating a case type. type CaseTypeCreate struct { - // Case Type resource attributes + // Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request). Attributes CaseTypeResourceAttributes `json:"attributes"` - // Case type resource type + // JSON:API resource type for case types. Type CaseTypeResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_type_create_request.go b/api/datadogV2/model_case_type_create_request.go index b4a12afe5bb..53ccc6ec05f 100644 --- a/api/datadogV2/model_case_type_create_request.go +++ b/api/datadogV2/model_case_type_create_request.go @@ -10,9 +10,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeCreateRequest Case type create request +// CaseTypeCreateRequest Request payload for creating a case type. type CaseTypeCreateRequest struct { - // Case type + // Data object for creating a case type. Data CaseTypeCreate `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_type_resource.go b/api/datadogV2/model_case_type_resource.go index a76c9e0375a..6a14ecfb0b7 100644 --- a/api/datadogV2/model_case_type_resource.go +++ b/api/datadogV2/model_case_type_resource.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeResource The definition of `CaseType` object. +// CaseTypeResource A case type that defines a classification category for cases. Each case type can have its own custom attributes, statuses, and automation rules. type CaseTypeResource struct { - // Case Type resource attributes + // Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request). Attributes *CaseTypeResourceAttributes `json:"attributes,omitempty"` // Case type's identifier Id *string `json:"id,omitempty"` - // Case type resource type + // JSON:API resource type for case types. Type *CaseTypeResourceType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_type_resource_attributes.go b/api/datadogV2/model_case_type_resource_attributes.go index 39fe30d15b3..67304a0fa9c 100644 --- a/api/datadogV2/model_case_type_resource_attributes.go +++ b/api/datadogV2/model_case_type_resource_attributes.go @@ -11,15 +11,15 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeResourceAttributes Case Type resource attributes +// CaseTypeResourceAttributes Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request). type CaseTypeResourceAttributes struct { - // Timestamp of when the case type was deleted + // Timestamp when the case type was marked as deleted. A null value indicates the case type is active. DeletedAt datadog.NullableTime `json:"deleted_at,omitempty"` - // Case type description. + // A detailed description explaining when this case type should be used. Description *string `json:"description,omitempty"` - // Case type emoji. + // An emoji icon representing the case type in the UI. Emoji *string `json:"emoji,omitempty"` - // Case type name. + // The display name of the case type, shown in the Case Management UI when creating or viewing cases. Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_type_resource_type.go b/api/datadogV2/model_case_type_resource_type.go index 5455669e98e..414c78b9c65 100644 --- a/api/datadogV2/model_case_type_resource_type.go +++ b/api/datadogV2/model_case_type_resource_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeResourceType Case type resource type +// CaseTypeResourceType JSON:API resource type for case types. type CaseTypeResourceType string // List of CaseTypeResourceType. diff --git a/api/datadogV2/model_case_type_response.go b/api/datadogV2/model_case_type_response.go index fea3b12aacb..13fb75179ae 100644 --- a/api/datadogV2/model_case_type_response.go +++ b/api/datadogV2/model_case_type_response.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypeResponse Case type response +// CaseTypeResponse Response containing a single case type. type CaseTypeResponse struct { - // The definition of `CaseType` object. + // A case type that defines a classification category for cases. Each case type can have its own custom attributes, statuses, and automation rules. Data *CaseTypeResource `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_type_update.go b/api/datadogV2/model_case_type_update.go new file mode 100644 index 00000000000..4fe4931038a --- /dev/null +++ b/api/datadogV2/model_case_type_update.go @@ -0,0 +1,151 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseTypeUpdate Data object for updating a case type. +type CaseTypeUpdate struct { + // Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request). + Attributes *CaseTypeResourceAttributes `json:"attributes,omitempty"` + // JSON:API resource type for case types. + Type CaseTypeResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseTypeUpdate instantiates a new CaseTypeUpdate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseTypeUpdate(typeVar CaseTypeResourceType) *CaseTypeUpdate { + this := CaseTypeUpdate{} + this.Type = typeVar + return &this +} + +// NewCaseTypeUpdateWithDefaults instantiates a new CaseTypeUpdate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseTypeUpdateWithDefaults() *CaseTypeUpdate { + this := CaseTypeUpdate{} + var typeVar CaseTypeResourceType = CASETYPERESOURCETYPE_CASE_TYPE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CaseTypeUpdate) GetAttributes() CaseTypeResourceAttributes { + if o == nil || o.Attributes == nil { + var ret CaseTypeResourceAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseTypeUpdate) GetAttributesOk() (*CaseTypeResourceAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CaseTypeUpdate) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CaseTypeResourceAttributes and assigns it to the Attributes field. +func (o *CaseTypeUpdate) SetAttributes(v CaseTypeResourceAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value. +func (o *CaseTypeUpdate) GetType() CaseTypeResourceType { + if o == nil { + var ret CaseTypeResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseTypeUpdate) GetTypeOk() (*CaseTypeResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseTypeUpdate) SetType(v CaseTypeResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseTypeUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseTypeUpdate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseTypeResourceAttributes `json:"attributes,omitempty"` + Type *CaseTypeResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_type_update_request.go b/api/datadogV2/model_case_type_update_request.go new file mode 100644 index 00000000000..7465430b993 --- /dev/null +++ b/api/datadogV2/model_case_type_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseTypeUpdateRequest Request payload for updating a case type. +type CaseTypeUpdateRequest struct { + // Data object for updating a case type. + Data CaseTypeUpdate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseTypeUpdateRequest instantiates a new CaseTypeUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseTypeUpdateRequest(data CaseTypeUpdate) *CaseTypeUpdateRequest { + this := CaseTypeUpdateRequest{} + this.Data = data + return &this +} + +// NewCaseTypeUpdateRequestWithDefaults instantiates a new CaseTypeUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseTypeUpdateRequestWithDefaults() *CaseTypeUpdateRequest { + this := CaseTypeUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseTypeUpdateRequest) GetData() CaseTypeUpdate { + if o == nil { + var ret CaseTypeUpdate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseTypeUpdateRequest) GetDataOk() (*CaseTypeUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseTypeUpdateRequest) SetData(v CaseTypeUpdate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseTypeUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseTypeUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseTypeUpdate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_types_response.go b/api/datadogV2/model_case_types_response.go index 1db792b91d3..fb532629cf0 100644 --- a/api/datadogV2/model_case_types_response.go +++ b/api/datadogV2/model_case_types_response.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseTypesResponse Case types response. +// CaseTypesResponse Response containing a list of case types. type CaseTypesResponse struct { // List of case types Data []CaseTypeResource `json:"data,omitempty"` diff --git a/api/datadogV2/model_case_update_attributes.go b/api/datadogV2/model_case_update_attributes.go index 219d6484f54..32cbe7e6862 100644 --- a/api/datadogV2/model_case_update_attributes.go +++ b/api/datadogV2/model_case_update_attributes.go @@ -14,7 +14,7 @@ import ( type CaseUpdateAttributes struct { // Case update attributes attributes Attributes CaseUpdateAttributesAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_attributes_attributes.go b/api/datadogV2/model_case_update_attributes_attributes.go index b559b19bf51..acff92f6175 100644 --- a/api/datadogV2/model_case_update_attributes_attributes.go +++ b/api/datadogV2/model_case_update_attributes_attributes.go @@ -12,7 +12,7 @@ import ( // CaseUpdateAttributesAttributes Case update attributes attributes type CaseUpdateAttributesAttributes struct { - // The definition of `CaseObjectAttributes` object. + // Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags. Attributes map[string][]string `json:"attributes"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_comment.go b/api/datadogV2/model_case_update_comment.go new file mode 100644 index 00000000000..7e12fc4baa7 --- /dev/null +++ b/api/datadogV2/model_case_update_comment.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateComment Data object for updating a case comment. +type CaseUpdateComment struct { + // Attributes for updating a comment. + Attributes CaseUpdateCommentAttributes `json:"attributes"` + // JSON:API resource type for cases. + Type CaseResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateComment instantiates a new CaseUpdateComment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateComment(attributes CaseUpdateCommentAttributes, typeVar CaseResourceType) *CaseUpdateComment { + this := CaseUpdateComment{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseUpdateCommentWithDefaults instantiates a new CaseUpdateComment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateCommentWithDefaults() *CaseUpdateComment { + this := CaseUpdateComment{} + var typeVar CaseResourceType = CASERESOURCETYPE_CASE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseUpdateComment) GetAttributes() CaseUpdateCommentAttributes { + if o == nil { + var ret CaseUpdateCommentAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateComment) GetAttributesOk() (*CaseUpdateCommentAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseUpdateComment) SetAttributes(v CaseUpdateCommentAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseUpdateComment) GetType() CaseResourceType { + if o == nil { + var ret CaseResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateComment) GetTypeOk() (*CaseResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseUpdateComment) SetType(v CaseResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateComment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateComment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseUpdateCommentAttributes `json:"attributes"` + Type *CaseResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_comment_attributes.go b/api/datadogV2/model_case_update_comment_attributes.go new file mode 100644 index 00000000000..9d12f7ce3d5 --- /dev/null +++ b/api/datadogV2/model_case_update_comment_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateCommentAttributes Attributes for updating a comment. +type CaseUpdateCommentAttributes struct { + // The updated comment message. + Comment string `json:"comment"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateCommentAttributes instantiates a new CaseUpdateCommentAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateCommentAttributes(comment string) *CaseUpdateCommentAttributes { + this := CaseUpdateCommentAttributes{} + this.Comment = comment + return &this +} + +// NewCaseUpdateCommentAttributesWithDefaults instantiates a new CaseUpdateCommentAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateCommentAttributesWithDefaults() *CaseUpdateCommentAttributes { + this := CaseUpdateCommentAttributes{} + return &this +} + +// GetComment returns the Comment field value. +func (o *CaseUpdateCommentAttributes) GetComment() string { + if o == nil { + var ret string + return ret + } + return o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateCommentAttributes) GetCommentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Comment, true +} + +// SetComment sets field value. +func (o *CaseUpdateCommentAttributes) SetComment(v string) { + o.Comment = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateCommentAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["comment"] = o.Comment + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateCommentAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Comment *string `json:"comment"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Comment == nil { + return fmt.Errorf("required field comment missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"comment"}) + } else { + return err + } + o.Comment = *all.Comment + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_update_comment_request.go b/api/datadogV2/model_case_update_comment_request.go new file mode 100644 index 00000000000..b8eb7208e83 --- /dev/null +++ b/api/datadogV2/model_case_update_comment_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateCommentRequest Request payload for updating a comment on a case timeline. +type CaseUpdateCommentRequest struct { + // Data object for updating a case comment. + Data CaseUpdateComment `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateCommentRequest instantiates a new CaseUpdateCommentRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateCommentRequest(data CaseUpdateComment) *CaseUpdateCommentRequest { + this := CaseUpdateCommentRequest{} + this.Data = data + return &this +} + +// NewCaseUpdateCommentRequestWithDefaults instantiates a new CaseUpdateCommentRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateCommentRequestWithDefaults() *CaseUpdateCommentRequest { + this := CaseUpdateCommentRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseUpdateCommentRequest) GetData() CaseUpdateComment { + if o == nil { + var ret CaseUpdateComment + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateCommentRequest) GetDataOk() (*CaseUpdateComment, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseUpdateCommentRequest) SetData(v CaseUpdateComment) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateCommentRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateCommentRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseUpdateComment `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_custom_attribute.go b/api/datadogV2/model_case_update_custom_attribute.go index 587bc458411..5345ab5b8ea 100644 --- a/api/datadogV2/model_case_update_custom_attribute.go +++ b/api/datadogV2/model_case_update_custom_attribute.go @@ -12,9 +12,9 @@ import ( // CaseUpdateCustomAttribute Case update custom attribute type CaseUpdateCustomAttribute struct { - // Custom attribute values + // A typed value for a custom attribute on a specific case. Attributes CustomAttributeValue `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_description.go b/api/datadogV2/model_case_update_description.go index 84ddabda9c2..84290c0af10 100644 --- a/api/datadogV2/model_case_update_description.go +++ b/api/datadogV2/model_case_update_description.go @@ -14,7 +14,7 @@ import ( type CaseUpdateDescription struct { // Case update description attributes Attributes CaseUpdateDescriptionAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_due_date.go b/api/datadogV2/model_case_update_due_date.go new file mode 100644 index 00000000000..1b3695b485b --- /dev/null +++ b/api/datadogV2/model_case_update_due_date.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateDueDate Data object for updating a case's due date. +type CaseUpdateDueDate struct { + // Attributes for setting or clearing a case's due date. + Attributes CaseUpdateDueDateAttributes `json:"attributes"` + // JSON:API resource type for cases. + Type CaseResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateDueDate instantiates a new CaseUpdateDueDate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateDueDate(attributes CaseUpdateDueDateAttributes, typeVar CaseResourceType) *CaseUpdateDueDate { + this := CaseUpdateDueDate{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseUpdateDueDateWithDefaults instantiates a new CaseUpdateDueDate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateDueDateWithDefaults() *CaseUpdateDueDate { + this := CaseUpdateDueDate{} + var typeVar CaseResourceType = CASERESOURCETYPE_CASE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseUpdateDueDate) GetAttributes() CaseUpdateDueDateAttributes { + if o == nil { + var ret CaseUpdateDueDateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateDueDate) GetAttributesOk() (*CaseUpdateDueDateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseUpdateDueDate) SetAttributes(v CaseUpdateDueDateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseUpdateDueDate) GetType() CaseResourceType { + if o == nil { + var ret CaseResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateDueDate) GetTypeOk() (*CaseResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseUpdateDueDate) SetType(v CaseResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateDueDate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateDueDate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseUpdateDueDateAttributes `json:"attributes"` + Type *CaseResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_due_date_attributes.go b/api/datadogV2/model_case_update_due_date_attributes.go new file mode 100644 index 00000000000..4dc262ed89d --- /dev/null +++ b/api/datadogV2/model_case_update_due_date_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateDueDateAttributes Attributes for setting or clearing a case's due date. +type CaseUpdateDueDateAttributes struct { + // The target resolution date for the case, in `YYYY-MM-DD` format. Set to `null` to clear the due date. + DueDate string `json:"due_date"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateDueDateAttributes instantiates a new CaseUpdateDueDateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateDueDateAttributes(dueDate string) *CaseUpdateDueDateAttributes { + this := CaseUpdateDueDateAttributes{} + this.DueDate = dueDate + return &this +} + +// NewCaseUpdateDueDateAttributesWithDefaults instantiates a new CaseUpdateDueDateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateDueDateAttributesWithDefaults() *CaseUpdateDueDateAttributes { + this := CaseUpdateDueDateAttributes{} + return &this +} + +// GetDueDate returns the DueDate field value. +func (o *CaseUpdateDueDateAttributes) GetDueDate() string { + if o == nil { + var ret string + return ret + } + return o.DueDate +} + +// GetDueDateOk returns a tuple with the DueDate field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateDueDateAttributes) GetDueDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DueDate, true +} + +// SetDueDate sets field value. +func (o *CaseUpdateDueDateAttributes) SetDueDate(v string) { + o.DueDate = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateDueDateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["due_date"] = o.DueDate + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateDueDateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DueDate *string `json:"due_date"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.DueDate == nil { + return fmt.Errorf("required field due_date missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"due_date"}) + } else { + return err + } + o.DueDate = *all.DueDate + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_update_due_date_request.go b/api/datadogV2/model_case_update_due_date_request.go new file mode 100644 index 00000000000..91dbf080e15 --- /dev/null +++ b/api/datadogV2/model_case_update_due_date_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateDueDateRequest Request payload for updating a case's due date. +type CaseUpdateDueDateRequest struct { + // Data object for updating a case's due date. + Data CaseUpdateDueDate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateDueDateRequest instantiates a new CaseUpdateDueDateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateDueDateRequest(data CaseUpdateDueDate) *CaseUpdateDueDateRequest { + this := CaseUpdateDueDateRequest{} + this.Data = data + return &this +} + +// NewCaseUpdateDueDateRequestWithDefaults instantiates a new CaseUpdateDueDateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateDueDateRequestWithDefaults() *CaseUpdateDueDateRequest { + this := CaseUpdateDueDateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseUpdateDueDateRequest) GetData() CaseUpdateDueDate { + if o == nil { + var ret CaseUpdateDueDate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateDueDateRequest) GetDataOk() (*CaseUpdateDueDate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseUpdateDueDateRequest) SetData(v CaseUpdateDueDate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateDueDateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateDueDateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseUpdateDueDate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_priority.go b/api/datadogV2/model_case_update_priority.go index 36f54d35936..d82048c82aa 100644 --- a/api/datadogV2/model_case_update_priority.go +++ b/api/datadogV2/model_case_update_priority.go @@ -14,7 +14,7 @@ import ( type CaseUpdatePriority struct { // Case update priority attributes Attributes CaseUpdatePriorityAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_resolved_reason.go b/api/datadogV2/model_case_update_resolved_reason.go new file mode 100644 index 00000000000..5d9d704ef16 --- /dev/null +++ b/api/datadogV2/model_case_update_resolved_reason.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateResolvedReason Data object for updating a case's resolved reason. +type CaseUpdateResolvedReason struct { + // Attributes for setting the resolution reason on a security case. + Attributes CaseUpdateResolvedReasonAttributes `json:"attributes"` + // JSON:API resource type for cases. + Type CaseResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateResolvedReason instantiates a new CaseUpdateResolvedReason object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateResolvedReason(attributes CaseUpdateResolvedReasonAttributes, typeVar CaseResourceType) *CaseUpdateResolvedReason { + this := CaseUpdateResolvedReason{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseUpdateResolvedReasonWithDefaults instantiates a new CaseUpdateResolvedReason object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateResolvedReasonWithDefaults() *CaseUpdateResolvedReason { + this := CaseUpdateResolvedReason{} + var typeVar CaseResourceType = CASERESOURCETYPE_CASE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseUpdateResolvedReason) GetAttributes() CaseUpdateResolvedReasonAttributes { + if o == nil { + var ret CaseUpdateResolvedReasonAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateResolvedReason) GetAttributesOk() (*CaseUpdateResolvedReasonAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseUpdateResolvedReason) SetAttributes(v CaseUpdateResolvedReasonAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseUpdateResolvedReason) GetType() CaseResourceType { + if o == nil { + var ret CaseResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateResolvedReason) GetTypeOk() (*CaseResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseUpdateResolvedReason) SetType(v CaseResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateResolvedReason) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateResolvedReason) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseUpdateResolvedReasonAttributes `json:"attributes"` + Type *CaseResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_resolved_reason_attributes.go b/api/datadogV2/model_case_update_resolved_reason_attributes.go new file mode 100644 index 00000000000..80cec7bbbb3 --- /dev/null +++ b/api/datadogV2/model_case_update_resolved_reason_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateResolvedReasonAttributes Attributes for setting the resolution reason on a security case. +type CaseUpdateResolvedReasonAttributes struct { + // The reason the security case was resolved (for example, `FALSE_POSITIVE`, `TRUE_POSITIVE`, `BENIGN_POSITIVE`). + SecurityResolvedReason string `json:"security_resolved_reason"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateResolvedReasonAttributes instantiates a new CaseUpdateResolvedReasonAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateResolvedReasonAttributes(securityResolvedReason string) *CaseUpdateResolvedReasonAttributes { + this := CaseUpdateResolvedReasonAttributes{} + this.SecurityResolvedReason = securityResolvedReason + return &this +} + +// NewCaseUpdateResolvedReasonAttributesWithDefaults instantiates a new CaseUpdateResolvedReasonAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateResolvedReasonAttributesWithDefaults() *CaseUpdateResolvedReasonAttributes { + this := CaseUpdateResolvedReasonAttributes{} + return &this +} + +// GetSecurityResolvedReason returns the SecurityResolvedReason field value. +func (o *CaseUpdateResolvedReasonAttributes) GetSecurityResolvedReason() string { + if o == nil { + var ret string + return ret + } + return o.SecurityResolvedReason +} + +// GetSecurityResolvedReasonOk returns a tuple with the SecurityResolvedReason field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateResolvedReasonAttributes) GetSecurityResolvedReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SecurityResolvedReason, true +} + +// SetSecurityResolvedReason sets field value. +func (o *CaseUpdateResolvedReasonAttributes) SetSecurityResolvedReason(v string) { + o.SecurityResolvedReason = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateResolvedReasonAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["security_resolved_reason"] = o.SecurityResolvedReason + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateResolvedReasonAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + SecurityResolvedReason *string `json:"security_resolved_reason"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.SecurityResolvedReason == nil { + return fmt.Errorf("required field security_resolved_reason missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"security_resolved_reason"}) + } else { + return err + } + o.SecurityResolvedReason = *all.SecurityResolvedReason + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_update_resolved_reason_request.go b/api/datadogV2/model_case_update_resolved_reason_request.go new file mode 100644 index 00000000000..7185a10412f --- /dev/null +++ b/api/datadogV2/model_case_update_resolved_reason_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseUpdateResolvedReasonRequest Request payload for updating the resolution reason on a closed security case. +type CaseUpdateResolvedReasonRequest struct { + // Data object for updating a case's resolved reason. + Data CaseUpdateResolvedReason `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseUpdateResolvedReasonRequest instantiates a new CaseUpdateResolvedReasonRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseUpdateResolvedReasonRequest(data CaseUpdateResolvedReason) *CaseUpdateResolvedReasonRequest { + this := CaseUpdateResolvedReasonRequest{} + this.Data = data + return &this +} + +// NewCaseUpdateResolvedReasonRequestWithDefaults instantiates a new CaseUpdateResolvedReasonRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseUpdateResolvedReasonRequestWithDefaults() *CaseUpdateResolvedReasonRequest { + this := CaseUpdateResolvedReasonRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseUpdateResolvedReasonRequest) GetData() CaseUpdateResolvedReason { + if o == nil { + var ret CaseUpdateResolvedReason + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseUpdateResolvedReasonRequest) GetDataOk() (*CaseUpdateResolvedReason, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseUpdateResolvedReasonRequest) SetData(v CaseUpdateResolvedReason) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseUpdateResolvedReasonRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseUpdateResolvedReasonRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseUpdateResolvedReason `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_update_status.go b/api/datadogV2/model_case_update_status.go index 23b834cf0e6..7d49596dcb3 100644 --- a/api/datadogV2/model_case_update_status.go +++ b/api/datadogV2/model_case_update_status.go @@ -14,7 +14,7 @@ import ( type CaseUpdateStatus struct { // Case update status attributes Attributes CaseUpdateStatusAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_update_title.go b/api/datadogV2/model_case_update_title.go index c339083901f..0f96c2d5c08 100644 --- a/api/datadogV2/model_case_update_title.go +++ b/api/datadogV2/model_case_update_title.go @@ -14,7 +14,7 @@ import ( type CaseUpdateTitle struct { // Case update title attributes Attributes CaseUpdateTitleAttributes `json:"attributes"` - // Case resource type + // JSON:API resource type for cases. Type CaseResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_case_view.go b/api/datadogV2/model_case_view.go new file mode 100644 index 00000000000..4352d60e2aa --- /dev/null +++ b/api/datadogV2/model_case_view.go @@ -0,0 +1,218 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseView A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets. +type CaseView struct { + // Attributes of a case view, including the filter query and optional notification rule. + Attributes CaseViewAttributes `json:"attributes"` + // The view's identifier. + Id string `json:"id"` + // Related resources for the case view, including the creator, last modifier, and associated project. + Relationships *CaseViewRelationships `json:"relationships,omitempty"` + // JSON:API resource type for case views. + Type CaseViewResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseView instantiates a new CaseView object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseView(attributes CaseViewAttributes, id string, typeVar CaseViewResourceType) *CaseView { + this := CaseView{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCaseViewWithDefaults instantiates a new CaseView object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewWithDefaults() *CaseView { + this := CaseView{} + var typeVar CaseViewResourceType = CASEVIEWRESOURCETYPE_VIEW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseView) GetAttributes() CaseViewAttributes { + if o == nil { + var ret CaseViewAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseView) GetAttributesOk() (*CaseViewAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseView) SetAttributes(v CaseViewAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CaseView) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CaseView) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CaseView) SetId(v string) { + o.Id = v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *CaseView) GetRelationships() CaseViewRelationships { + if o == nil || o.Relationships == nil { + var ret CaseViewRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseView) GetRelationshipsOk() (*CaseViewRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *CaseView) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given CaseViewRelationships and assigns it to the Relationships field. +func (o *CaseView) SetRelationships(v CaseViewRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value. +func (o *CaseView) GetType() CaseViewResourceType { + if o == nil { + var ret CaseViewResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseView) GetTypeOk() (*CaseViewResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseView) SetType(v CaseViewResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseView) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseView) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseViewAttributes `json:"attributes"` + Id *string `json:"id"` + Relationships *CaseViewRelationships `json:"relationships,omitempty"` + Type *CaseViewResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_view_attributes.go b/api/datadogV2/model_case_view_attributes.go new file mode 100644 index 00000000000..1849a0adf72 --- /dev/null +++ b/api/datadogV2/model_case_view_attributes.go @@ -0,0 +1,244 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewAttributes Attributes of a case view, including the filter query and optional notification rule. +type CaseViewAttributes struct { + // Timestamp when the view was created. + CreatedAt time.Time `json:"created_at"` + // Timestamp when the view was last modified. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // A human-readable name for the view, displayed in the Case Management UI. + Name string `json:"name"` + // The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + NpRuleId *string `json:"np_rule_id,omitempty"` + // The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, `status:open priority:P1`). + Query string `json:"query"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewAttributes instantiates a new CaseViewAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewAttributes(createdAt time.Time, name string, query string) *CaseViewAttributes { + this := CaseViewAttributes{} + this.CreatedAt = createdAt + this.Name = name + this.Query = query + return &this +} + +// NewCaseViewAttributesWithDefaults instantiates a new CaseViewAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewAttributesWithDefaults() *CaseViewAttributes { + this := CaseViewAttributes{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *CaseViewAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *CaseViewAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *CaseViewAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise. +func (o *CaseViewAttributes) GetModifiedAt() time.Time { + if o == nil || o.ModifiedAt == nil { + var ret time.Time + return ret + } + return *o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewAttributes) GetModifiedAtOk() (*time.Time, bool) { + if o == nil || o.ModifiedAt == nil { + return nil, false + } + return o.ModifiedAt, true +} + +// HasModifiedAt returns a boolean if a field has been set. +func (o *CaseViewAttributes) HasModifiedAt() bool { + return o != nil && o.ModifiedAt != nil +} + +// SetModifiedAt gets a reference to the given time.Time and assigns it to the ModifiedAt field. +func (o *CaseViewAttributes) SetModifiedAt(v time.Time) { + o.ModifiedAt = &v +} + +// GetName returns the Name field value. +func (o *CaseViewAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CaseViewAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CaseViewAttributes) SetName(v string) { + o.Name = v +} + +// GetNpRuleId returns the NpRuleId field value if set, zero value otherwise. +func (o *CaseViewAttributes) GetNpRuleId() string { + if o == nil || o.NpRuleId == nil { + var ret string + return ret + } + return *o.NpRuleId +} + +// GetNpRuleIdOk returns a tuple with the NpRuleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewAttributes) GetNpRuleIdOk() (*string, bool) { + if o == nil || o.NpRuleId == nil { + return nil, false + } + return o.NpRuleId, true +} + +// HasNpRuleId returns a boolean if a field has been set. +func (o *CaseViewAttributes) HasNpRuleId() bool { + return o != nil && o.NpRuleId != nil +} + +// SetNpRuleId gets a reference to the given string and assigns it to the NpRuleId field. +func (o *CaseViewAttributes) SetNpRuleId(v string) { + o.NpRuleId = &v +} + +// GetQuery returns the Query field value. +func (o *CaseViewAttributes) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *CaseViewAttributes) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *CaseViewAttributes) SetQuery(v string) { + o.Query = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.ModifiedAt != nil { + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + toSerialize["name"] = o.Name + if o.NpRuleId != nil { + toSerialize["np_rule_id"] = o.NpRuleId + } + toSerialize["query"] = o.Query + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + ModifiedAt *time.Time `json:"modified_at,omitempty"` + Name *string `json:"name"` + NpRuleId *string `json:"np_rule_id,omitempty"` + Query *string `json:"query"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "modified_at", "name", "np_rule_id", "query"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.ModifiedAt = all.ModifiedAt + o.Name = *all.Name + o.NpRuleId = all.NpRuleId + o.Query = *all.Query + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_view_create.go b/api/datadogV2/model_case_view_create.go new file mode 100644 index 00000000000..3aa57b3e999 --- /dev/null +++ b/api/datadogV2/model_case_view_create.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewCreate Data object for creating a case view. +type CaseViewCreate struct { + // Attributes required to create a case view. + Attributes CaseViewCreateAttributes `json:"attributes"` + // JSON:API resource type for case views. + Type CaseViewResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewCreate instantiates a new CaseViewCreate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewCreate(attributes CaseViewCreateAttributes, typeVar CaseViewResourceType) *CaseViewCreate { + this := CaseViewCreate{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewCaseViewCreateWithDefaults instantiates a new CaseViewCreate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewCreateWithDefaults() *CaseViewCreate { + this := CaseViewCreate{} + var typeVar CaseViewResourceType = CASEVIEWRESOURCETYPE_VIEW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CaseViewCreate) GetAttributes() CaseViewCreateAttributes { + if o == nil { + var ret CaseViewCreateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreate) GetAttributesOk() (*CaseViewCreateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CaseViewCreate) SetAttributes(v CaseViewCreateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *CaseViewCreate) GetType() CaseViewResourceType { + if o == nil { + var ret CaseViewResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreate) GetTypeOk() (*CaseViewResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseViewCreate) SetType(v CaseViewResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewCreate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewCreate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CaseViewCreateAttributes `json:"attributes"` + Type *CaseViewResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_view_create_attributes.go b/api/datadogV2/model_case_view_create_attributes.go new file mode 100644 index 00000000000..07b8ed099e7 --- /dev/null +++ b/api/datadogV2/model_case_view_create_attributes.go @@ -0,0 +1,200 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewCreateAttributes Attributes required to create a case view. +type CaseViewCreateAttributes struct { + // The name of the view. + Name string `json:"name"` + // The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + NpRuleId *string `json:"np_rule_id,omitempty"` + // The UUID of the project this view belongs to. Views are scoped to a single project. + ProjectId string `json:"project_id"` + // The query used to filter cases in this view. + Query string `json:"query"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewCreateAttributes instantiates a new CaseViewCreateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewCreateAttributes(name string, projectId string, query string) *CaseViewCreateAttributes { + this := CaseViewCreateAttributes{} + this.Name = name + this.ProjectId = projectId + this.Query = query + return &this +} + +// NewCaseViewCreateAttributesWithDefaults instantiates a new CaseViewCreateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewCreateAttributesWithDefaults() *CaseViewCreateAttributes { + this := CaseViewCreateAttributes{} + return &this +} + +// GetName returns the Name field value. +func (o *CaseViewCreateAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreateAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CaseViewCreateAttributes) SetName(v string) { + o.Name = v +} + +// GetNpRuleId returns the NpRuleId field value if set, zero value otherwise. +func (o *CaseViewCreateAttributes) GetNpRuleId() string { + if o == nil || o.NpRuleId == nil { + var ret string + return ret + } + return *o.NpRuleId +} + +// GetNpRuleIdOk returns a tuple with the NpRuleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewCreateAttributes) GetNpRuleIdOk() (*string, bool) { + if o == nil || o.NpRuleId == nil { + return nil, false + } + return o.NpRuleId, true +} + +// HasNpRuleId returns a boolean if a field has been set. +func (o *CaseViewCreateAttributes) HasNpRuleId() bool { + return o != nil && o.NpRuleId != nil +} + +// SetNpRuleId gets a reference to the given string and assigns it to the NpRuleId field. +func (o *CaseViewCreateAttributes) SetNpRuleId(v string) { + o.NpRuleId = &v +} + +// GetProjectId returns the ProjectId field value. +func (o *CaseViewCreateAttributes) GetProjectId() string { + if o == nil { + var ret string + return ret + } + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreateAttributes) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value. +func (o *CaseViewCreateAttributes) SetProjectId(v string) { + o.ProjectId = v +} + +// GetQuery returns the Query field value. +func (o *CaseViewCreateAttributes) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreateAttributes) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *CaseViewCreateAttributes) SetQuery(v string) { + o.Query = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewCreateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["name"] = o.Name + if o.NpRuleId != nil { + toSerialize["np_rule_id"] = o.NpRuleId + } + toSerialize["project_id"] = o.ProjectId + toSerialize["query"] = o.Query + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name"` + NpRuleId *string `json:"np_rule_id,omitempty"` + ProjectId *string `json:"project_id"` + Query *string `json:"query"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.ProjectId == nil { + return fmt.Errorf("required field project_id missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "np_rule_id", "project_id", "query"}) + } else { + return err + } + o.Name = *all.Name + o.NpRuleId = all.NpRuleId + o.ProjectId = *all.ProjectId + o.Query = *all.Query + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_view_create_request.go b/api/datadogV2/model_case_view_create_request.go new file mode 100644 index 00000000000..34c69087fd2 --- /dev/null +++ b/api/datadogV2/model_case_view_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewCreateRequest Request payload for creating a case view. +type CaseViewCreateRequest struct { + // Data object for creating a case view. + Data CaseViewCreate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewCreateRequest instantiates a new CaseViewCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewCreateRequest(data CaseViewCreate) *CaseViewCreateRequest { + this := CaseViewCreateRequest{} + this.Data = data + return &this +} + +// NewCaseViewCreateRequestWithDefaults instantiates a new CaseViewCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewCreateRequestWithDefaults() *CaseViewCreateRequest { + this := CaseViewCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseViewCreateRequest) GetData() CaseViewCreate { + if o == nil { + var ret CaseViewCreate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseViewCreateRequest) GetDataOk() (*CaseViewCreate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseViewCreateRequest) SetData(v CaseViewCreate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseViewCreate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_view_relationships.go b/api/datadogV2/model_case_view_relationships.go new file mode 100644 index 00000000000..c6520941ea9 --- /dev/null +++ b/api/datadogV2/model_case_view_relationships.go @@ -0,0 +1,203 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewRelationships Related resources for the case view, including the creator, last modifier, and associated project. +type CaseViewRelationships struct { + // Relationship to user. + CreatedBy NullableNullableUserRelationship `json:"created_by,omitempty"` + // Relationship to user. + ModifiedBy NullableNullableUserRelationship `json:"modified_by,omitempty"` + // Relationship to project. + Project *ProjectRelationship `json:"project,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewRelationships instantiates a new CaseViewRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewRelationships() *CaseViewRelationships { + this := CaseViewRelationships{} + return &this +} + +// NewCaseViewRelationshipsWithDefaults instantiates a new CaseViewRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewRelationshipsWithDefaults() *CaseViewRelationships { + this := CaseViewRelationships{} + return &this +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CaseViewRelationships) GetCreatedBy() NullableUserRelationship { + if o == nil || o.CreatedBy.Get() == nil { + var ret NullableUserRelationship + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CaseViewRelationships) GetCreatedByOk() (*NullableUserRelationship, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *CaseViewRelationships) HasCreatedBy() bool { + return o != nil && o.CreatedBy.IsSet() +} + +// SetCreatedBy gets a reference to the given NullableNullableUserRelationship and assigns it to the CreatedBy field. +func (o *CaseViewRelationships) SetCreatedBy(v NullableUserRelationship) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil. +func (o *CaseViewRelationships) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil. +func (o *CaseViewRelationships) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetModifiedBy returns the ModifiedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CaseViewRelationships) GetModifiedBy() NullableUserRelationship { + if o == nil || o.ModifiedBy.Get() == nil { + var ret NullableUserRelationship + return ret + } + return *o.ModifiedBy.Get() +} + +// GetModifiedByOk returns a tuple with the ModifiedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CaseViewRelationships) GetModifiedByOk() (*NullableUserRelationship, bool) { + if o == nil { + return nil, false + } + return o.ModifiedBy.Get(), o.ModifiedBy.IsSet() +} + +// HasModifiedBy returns a boolean if a field has been set. +func (o *CaseViewRelationships) HasModifiedBy() bool { + return o != nil && o.ModifiedBy.IsSet() +} + +// SetModifiedBy gets a reference to the given NullableNullableUserRelationship and assigns it to the ModifiedBy field. +func (o *CaseViewRelationships) SetModifiedBy(v NullableUserRelationship) { + o.ModifiedBy.Set(&v) +} + +// SetModifiedByNil sets the value for ModifiedBy to be an explicit nil. +func (o *CaseViewRelationships) SetModifiedByNil() { + o.ModifiedBy.Set(nil) +} + +// UnsetModifiedBy ensures that no value is present for ModifiedBy, not even an explicit nil. +func (o *CaseViewRelationships) UnsetModifiedBy() { + o.ModifiedBy.Unset() +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *CaseViewRelationships) GetProject() ProjectRelationship { + if o == nil || o.Project == nil { + var ret ProjectRelationship + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewRelationships) GetProjectOk() (*ProjectRelationship, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *CaseViewRelationships) HasProject() bool { + return o != nil && o.Project != nil +} + +// SetProject gets a reference to the given ProjectRelationship and assigns it to the Project field. +func (o *CaseViewRelationships) SetProject(v ProjectRelationship) { + o.Project = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if o.ModifiedBy.IsSet() { + toSerialize["modified_by"] = o.ModifiedBy.Get() + } + if o.Project != nil { + toSerialize["project"] = o.Project + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedBy NullableNullableUserRelationship `json:"created_by,omitempty"` + ModifiedBy NullableNullableUserRelationship `json:"modified_by,omitempty"` + Project *ProjectRelationship `json:"project,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_by", "modified_by", "project"}) + } else { + return err + } + + hasInvalidField := false + o.CreatedBy = all.CreatedBy + o.ModifiedBy = all.ModifiedBy + if all.Project != nil && all.Project.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Project = all.Project + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_view_resource_type.go b/api/datadogV2/model_case_view_resource_type.go new file mode 100644 index 00000000000..72f83b93293 --- /dev/null +++ b/api/datadogV2/model_case_view_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewResourceType JSON:API resource type for case views. +type CaseViewResourceType string + +// List of CaseViewResourceType. +const ( + CASEVIEWRESOURCETYPE_VIEW CaseViewResourceType = "view" +) + +var allowedCaseViewResourceTypeEnumValues = []CaseViewResourceType{ + CASEVIEWRESOURCETYPE_VIEW, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseViewResourceType) GetAllowedValues() []CaseViewResourceType { + return allowedCaseViewResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseViewResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseViewResourceType(value) + return nil +} + +// NewCaseViewResourceTypeFromValue returns a pointer to a valid CaseViewResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseViewResourceTypeFromValue(v string) (*CaseViewResourceType, error) { + ev := CaseViewResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseViewResourceType: valid values are %v", v, allowedCaseViewResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseViewResourceType) IsValid() bool { + for _, existing := range allowedCaseViewResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseViewResourceType value. +func (v CaseViewResourceType) Ptr() *CaseViewResourceType { + return &v +} diff --git a/api/datadogV2/model_case_view_response.go b/api/datadogV2/model_case_view_response.go new file mode 100644 index 00000000000..240de3dd8e3 --- /dev/null +++ b/api/datadogV2/model_case_view_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewResponse Response containing a single case view. +type CaseViewResponse struct { + // A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets. + Data CaseView `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewResponse instantiates a new CaseViewResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewResponse(data CaseView) *CaseViewResponse { + this := CaseViewResponse{} + this.Data = data + return &this +} + +// NewCaseViewResponseWithDefaults instantiates a new CaseViewResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewResponseWithDefaults() *CaseViewResponse { + this := CaseViewResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseViewResponse) GetData() CaseView { + if o == nil { + var ret CaseView + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseViewResponse) GetDataOk() (*CaseView, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseViewResponse) SetData(v CaseView) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseView `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_transport_webhook_log_network_ip.go b/api/datadogV2/model_case_view_update.go similarity index 50% rename from api/datadogV2/model_transport_webhook_log_network_ip.go rename to api/datadogV2/model_case_view_update.go index 82f39bed60f..e05c1305a26 100644 --- a/api/datadogV2/model_transport_webhook_log_network_ip.go +++ b/api/datadogV2/model_case_view_update.go @@ -5,95 +5,95 @@ package datadogV2 import ( + "fmt" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TransportWebhookLogNetworkIp The IP address information. -type TransportWebhookLogNetworkIp struct { - // Per-IP attribute records, each pairing an IP address with the providers that observed it. - Attributes []TransportWebhookLogIpAttribute `json:"attributes,omitempty"` - // The list of IP addresses. - List []string `json:"list,omitempty"` +// CaseViewUpdate Data object for updating a case view. +type CaseViewUpdate struct { + // Attributes that can be updated on a case view. All fields are optional; only provided fields are changed. + Attributes *CaseViewUpdateAttributes `json:"attributes,omitempty"` + // JSON:API resource type for case views. + Type CaseViewResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewTransportWebhookLogNetworkIp instantiates a new TransportWebhookLogNetworkIp object. +// NewCaseViewUpdate instantiates a new CaseViewUpdate object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewTransportWebhookLogNetworkIp() *TransportWebhookLogNetworkIp { - this := TransportWebhookLogNetworkIp{} +func NewCaseViewUpdate(typeVar CaseViewResourceType) *CaseViewUpdate { + this := CaseViewUpdate{} + this.Type = typeVar return &this } -// NewTransportWebhookLogNetworkIpWithDefaults instantiates a new TransportWebhookLogNetworkIp object. +// NewCaseViewUpdateWithDefaults instantiates a new CaseViewUpdate object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogNetworkIpWithDefaults() *TransportWebhookLogNetworkIp { - this := TransportWebhookLogNetworkIp{} +func NewCaseViewUpdateWithDefaults() *CaseViewUpdate { + this := CaseViewUpdate{} + var typeVar CaseViewResourceType = CASEVIEWRESOURCETYPE_VIEW + this.Type = typeVar return &this } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *TransportWebhookLogNetworkIp) GetAttributes() []TransportWebhookLogIpAttribute { +func (o *CaseViewUpdate) GetAttributes() CaseViewUpdateAttributes { if o == nil || o.Attributes == nil { - var ret []TransportWebhookLogIpAttribute + var ret CaseViewUpdateAttributes return ret } - return o.Attributes + return *o.Attributes } // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransportWebhookLogNetworkIp) GetAttributesOk() (*[]TransportWebhookLogIpAttribute, bool) { +func (o *CaseViewUpdate) GetAttributesOk() (*CaseViewUpdateAttributes, bool) { if o == nil || o.Attributes == nil { return nil, false } - return &o.Attributes, true + return o.Attributes, true } // HasAttributes returns a boolean if a field has been set. -func (o *TransportWebhookLogNetworkIp) HasAttributes() bool { +func (o *CaseViewUpdate) HasAttributes() bool { return o != nil && o.Attributes != nil } -// SetAttributes gets a reference to the given []TransportWebhookLogIpAttribute and assigns it to the Attributes field. -func (o *TransportWebhookLogNetworkIp) SetAttributes(v []TransportWebhookLogIpAttribute) { - o.Attributes = v +// SetAttributes gets a reference to the given CaseViewUpdateAttributes and assigns it to the Attributes field. +func (o *CaseViewUpdate) SetAttributes(v CaseViewUpdateAttributes) { + o.Attributes = &v } -// GetList returns the List field value if set, zero value otherwise. -func (o *TransportWebhookLogNetworkIp) GetList() []string { - if o == nil || o.List == nil { - var ret []string +// GetType returns the Type field value. +func (o *CaseViewUpdate) GetType() CaseViewResourceType { + if o == nil { + var ret CaseViewResourceType return ret } - return o.List + return o.Type } -// GetListOk returns a tuple with the List field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *TransportWebhookLogNetworkIp) GetListOk() (*[]string, bool) { - if o == nil || o.List == nil { +func (o *CaseViewUpdate) GetTypeOk() (*CaseViewResourceType, bool) { + if o == nil { return nil, false } - return &o.List, true -} - -// HasList returns a boolean if a field has been set. -func (o *TransportWebhookLogNetworkIp) HasList() bool { - return o != nil && o.List != nil + return &o.Type, true } -// SetList gets a reference to the given []string and assigns it to the List field. -func (o *TransportWebhookLogNetworkIp) SetList(v []string) { - o.List = v +// SetType sets field value. +func (o *CaseViewUpdate) SetType(v CaseViewResourceType) { + o.Type = v } // MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogNetworkIp) MarshalJSON() ([]byte, error) { +func (o CaseViewUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -101,9 +101,7 @@ func (o TransportWebhookLogNetworkIp) MarshalJSON() ([]byte, error) { if o.Attributes != nil { toSerialize["attributes"] = o.Attributes } - if o.List != nil { - toSerialize["list"] = o.List - } + toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -112,26 +110,42 @@ func (o TransportWebhookLogNetworkIp) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogNetworkIp) UnmarshalJSON(bytes []byte) (err error) { +func (o *CaseViewUpdate) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes []TransportWebhookLogIpAttribute `json:"attributes,omitempty"` - List []string `json:"list,omitempty"` + Attributes *CaseViewUpdateAttributes `json:"attributes,omitempty"` + Type *CaseViewResourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "list"}) + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) } else { return err } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } o.Attributes = all.Attributes - o.List = all.List + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + return nil } diff --git a/api/datadogV2/model_case_view_update_attributes.go b/api/datadogV2/model_case_view_update_attributes.go new file mode 100644 index 00000000000..ea4b4f7ff63 --- /dev/null +++ b/api/datadogV2/model_case_view_update_attributes.go @@ -0,0 +1,172 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewUpdateAttributes Attributes that can be updated on a case view. All fields are optional; only provided fields are changed. +type CaseViewUpdateAttributes struct { + // The name of the view. + Name *string `json:"name,omitempty"` + // The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + NpRuleId *string `json:"np_rule_id,omitempty"` + // The query used to filter cases in this view. + Query *string `json:"query,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewUpdateAttributes instantiates a new CaseViewUpdateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewUpdateAttributes() *CaseViewUpdateAttributes { + this := CaseViewUpdateAttributes{} + return &this +} + +// NewCaseViewUpdateAttributesWithDefaults instantiates a new CaseViewUpdateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewUpdateAttributesWithDefaults() *CaseViewUpdateAttributes { + this := CaseViewUpdateAttributes{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CaseViewUpdateAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewUpdateAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CaseViewUpdateAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CaseViewUpdateAttributes) SetName(v string) { + o.Name = &v +} + +// GetNpRuleId returns the NpRuleId field value if set, zero value otherwise. +func (o *CaseViewUpdateAttributes) GetNpRuleId() string { + if o == nil || o.NpRuleId == nil { + var ret string + return ret + } + return *o.NpRuleId +} + +// GetNpRuleIdOk returns a tuple with the NpRuleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewUpdateAttributes) GetNpRuleIdOk() (*string, bool) { + if o == nil || o.NpRuleId == nil { + return nil, false + } + return o.NpRuleId, true +} + +// HasNpRuleId returns a boolean if a field has been set. +func (o *CaseViewUpdateAttributes) HasNpRuleId() bool { + return o != nil && o.NpRuleId != nil +} + +// SetNpRuleId gets a reference to the given string and assigns it to the NpRuleId field. +func (o *CaseViewUpdateAttributes) SetNpRuleId(v string) { + o.NpRuleId = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *CaseViewUpdateAttributes) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseViewUpdateAttributes) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *CaseViewUpdateAttributes) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *CaseViewUpdateAttributes) SetQuery(v string) { + o.Query = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewUpdateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.NpRuleId != nil { + toSerialize["np_rule_id"] = o.NpRuleId + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + NpRuleId *string `json:"np_rule_id,omitempty"` + Query *string `json:"query,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "np_rule_id", "query"}) + } else { + return err + } + o.Name = all.Name + o.NpRuleId = all.NpRuleId + o.Query = all.Query + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_view_update_request.go b/api/datadogV2/model_case_view_update_request.go new file mode 100644 index 00000000000..2dc1d96864f --- /dev/null +++ b/api/datadogV2/model_case_view_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewUpdateRequest Request payload for updating a case view. +type CaseViewUpdateRequest struct { + // Data object for updating a case view. + Data CaseViewUpdate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewUpdateRequest instantiates a new CaseViewUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewUpdateRequest(data CaseViewUpdate) *CaseViewUpdateRequest { + this := CaseViewUpdateRequest{} + this.Data = data + return &this +} + +// NewCaseViewUpdateRequestWithDefaults instantiates a new CaseViewUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewUpdateRequestWithDefaults() *CaseViewUpdateRequest { + this := CaseViewUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseViewUpdateRequest) GetData() CaseViewUpdate { + if o == nil { + var ret CaseViewUpdate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseViewUpdateRequest) GetDataOk() (*CaseViewUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseViewUpdateRequest) SetData(v CaseViewUpdate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CaseViewUpdate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_views_response.go b/api/datadogV2/model_case_views_response.go new file mode 100644 index 00000000000..6dd9f304c62 --- /dev/null +++ b/api/datadogV2/model_case_views_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseViewsResponse Response containing a list of case views. +type CaseViewsResponse struct { + // A list of case views. + Data []CaseView `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseViewsResponse instantiates a new CaseViewsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseViewsResponse(data []CaseView) *CaseViewsResponse { + this := CaseViewsResponse{} + this.Data = data + return &this +} + +// NewCaseViewsResponseWithDefaults instantiates a new CaseViewsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseViewsResponseWithDefaults() *CaseViewsResponse { + this := CaseViewsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseViewsResponse) GetData() []CaseView { + if o == nil { + var ret []CaseView + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseViewsResponse) GetDataOk() (*[]CaseView, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseViewsResponse) SetData(v []CaseView) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseViewsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseViewsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CaseView `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_watcher.go b/api/datadogV2/model_case_watcher.go new file mode 100644 index 00000000000..22670dda167 --- /dev/null +++ b/api/datadogV2/model_case_watcher.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseWatcher Represents a user who is subscribed to notifications for a case. Watchers receive updates when the case's status, priority, assignee, or comments change. +type CaseWatcher struct { + // The primary identifier of the case watcher. + Id string `json:"id"` + // Relationships for a case watcher, linking to the underlying user resource. + Relationships CaseWatcherRelationships `json:"relationships"` + // JSON:API resource type for case watchers. + Type CaseWatcherResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseWatcher instantiates a new CaseWatcher object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseWatcher(id string, relationships CaseWatcherRelationships, typeVar CaseWatcherResourceType) *CaseWatcher { + this := CaseWatcher{} + this.Id = id + this.Relationships = relationships + this.Type = typeVar + return &this +} + +// NewCaseWatcherWithDefaults instantiates a new CaseWatcher object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseWatcherWithDefaults() *CaseWatcher { + this := CaseWatcher{} + var typeVar CaseWatcherResourceType = CASEWATCHERRESOURCETYPE_WATCHER + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *CaseWatcher) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CaseWatcher) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CaseWatcher) SetId(v string) { + o.Id = v +} + +// GetRelationships returns the Relationships field value. +func (o *CaseWatcher) GetRelationships() CaseWatcherRelationships { + if o == nil { + var ret CaseWatcherRelationships + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value +// and a boolean to check if the value has been set. +func (o *CaseWatcher) GetRelationshipsOk() (*CaseWatcherRelationships, bool) { + if o == nil { + return nil, false + } + return &o.Relationships, true +} + +// SetRelationships sets field value. +func (o *CaseWatcher) SetRelationships(v CaseWatcherRelationships) { + o.Relationships = v +} + +// GetType returns the Type field value. +func (o *CaseWatcher) GetType() CaseWatcherResourceType { + if o == nil { + var ret CaseWatcherResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CaseWatcher) GetTypeOk() (*CaseWatcherResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CaseWatcher) SetType(v CaseWatcherResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseWatcher) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["relationships"] = o.Relationships + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseWatcher) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Relationships *CaseWatcherRelationships `json:"relationships"` + Type *CaseWatcherResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Relationships == nil { + return fmt.Errorf("required field relationships missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = *all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_watcher_relationships.go b/api/datadogV2/model_case_watcher_relationships.go new file mode 100644 index 00000000000..e002f0282f7 --- /dev/null +++ b/api/datadogV2/model_case_watcher_relationships.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseWatcherRelationships Relationships for a case watcher, linking to the underlying user resource. +type CaseWatcherRelationships struct { + // The user relationship for a case watcher. + User CaseWatcherUserRelationship `json:"user"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseWatcherRelationships instantiates a new CaseWatcherRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseWatcherRelationships(user CaseWatcherUserRelationship) *CaseWatcherRelationships { + this := CaseWatcherRelationships{} + this.User = user + return &this +} + +// NewCaseWatcherRelationshipsWithDefaults instantiates a new CaseWatcherRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseWatcherRelationshipsWithDefaults() *CaseWatcherRelationships { + this := CaseWatcherRelationships{} + return &this +} + +// GetUser returns the User field value. +func (o *CaseWatcherRelationships) GetUser() CaseWatcherUserRelationship { + if o == nil { + var ret CaseWatcherUserRelationship + return ret + } + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *CaseWatcherRelationships) GetUserOk() (*CaseWatcherUserRelationship, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value. +func (o *CaseWatcherRelationships) SetUser(v CaseWatcherUserRelationship) { + o.User = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseWatcherRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseWatcherRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + User *CaseWatcherUserRelationship `json:"user"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.User == nil { + return fmt.Errorf("required field user missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"user"}) + } else { + return err + } + + hasInvalidField := false + if all.User.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.User = *all.User + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_watcher_resource_type.go b/api/datadogV2/model_case_watcher_resource_type.go new file mode 100644 index 00000000000..2397fe01c9a --- /dev/null +++ b/api/datadogV2/model_case_watcher_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseWatcherResourceType JSON:API resource type for case watchers. +type CaseWatcherResourceType string + +// List of CaseWatcherResourceType. +const ( + CASEWATCHERRESOURCETYPE_WATCHER CaseWatcherResourceType = "watcher" +) + +var allowedCaseWatcherResourceTypeEnumValues = []CaseWatcherResourceType{ + CASEWATCHERRESOURCETYPE_WATCHER, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseWatcherResourceType) GetAllowedValues() []CaseWatcherResourceType { + return allowedCaseWatcherResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseWatcherResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseWatcherResourceType(value) + return nil +} + +// NewCaseWatcherResourceTypeFromValue returns a pointer to a valid CaseWatcherResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseWatcherResourceTypeFromValue(v string) (*CaseWatcherResourceType, error) { + ev := CaseWatcherResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseWatcherResourceType: valid values are %v", v, allowedCaseWatcherResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseWatcherResourceType) IsValid() bool { + for _, existing := range allowedCaseWatcherResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseWatcherResourceType value. +func (v CaseWatcherResourceType) Ptr() *CaseWatcherResourceType { + return &v +} diff --git a/api/datadogV2/model_case_watcher_user_relationship.go b/api/datadogV2/model_case_watcher_user_relationship.go new file mode 100644 index 00000000000..599dc0fc0a5 --- /dev/null +++ b/api/datadogV2/model_case_watcher_user_relationship.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseWatcherUserRelationship The user relationship for a case watcher. +type CaseWatcherUserRelationship struct { + // Relationship to user object. + Data UserRelationshipData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseWatcherUserRelationship instantiates a new CaseWatcherUserRelationship object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseWatcherUserRelationship(data UserRelationshipData) *CaseWatcherUserRelationship { + this := CaseWatcherUserRelationship{} + this.Data = data + return &this +} + +// NewCaseWatcherUserRelationshipWithDefaults instantiates a new CaseWatcherUserRelationship object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseWatcherUserRelationshipWithDefaults() *CaseWatcherUserRelationship { + this := CaseWatcherUserRelationship{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseWatcherUserRelationship) GetData() UserRelationshipData { + if o == nil { + var ret UserRelationshipData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseWatcherUserRelationship) GetDataOk() (*UserRelationshipData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseWatcherUserRelationship) SetData(v UserRelationshipData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseWatcherUserRelationship) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseWatcherUserRelationship) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UserRelationshipData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_case_watchers_response.go b/api/datadogV2/model_case_watchers_response.go new file mode 100644 index 00000000000..e03ec12a00c --- /dev/null +++ b/api/datadogV2/model_case_watchers_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseWatchersResponse Response containing the list of users watching a case. +type CaseWatchersResponse struct { + // List of case watchers. + Data []CaseWatcher `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCaseWatchersResponse instantiates a new CaseWatchersResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCaseWatchersResponse(data []CaseWatcher) *CaseWatchersResponse { + this := CaseWatchersResponse{} + this.Data = data + return &this +} + +// NewCaseWatchersResponseWithDefaults instantiates a new CaseWatchersResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCaseWatchersResponseWithDefaults() *CaseWatchersResponse { + this := CaseWatchersResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CaseWatchersResponse) GetData() []CaseWatcher { + if o == nil { + var ret []CaseWatcher + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaseWatchersResponse) GetDataOk() (*[]CaseWatcher, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CaseWatchersResponse) SetData(v []CaseWatcher) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CaseWatchersResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CaseWatchersResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CaseWatcher `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_aws_ec2_ri_commitment.go b/api/datadogV2/model_commitments_aws_ec2_ri_commitment.go new file mode 100644 index 00000000000..4bf94d5f9e0 --- /dev/null +++ b/api/datadogV2/model_commitments_aws_ec2_ri_commitment.go @@ -0,0 +1,506 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAwsEC2RICommitment AWS EC2 Reserved Instance commitment details. +type CommitmentsAwsEC2RICommitment struct { + // The availability zone of the reservation. + AvailabilityZone *string `json:"availability_zone,omitempty"` + // The unique identifier of the Reserved Instance. + CommitmentId string `json:"commitment_id"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The EC2 instance type. + InstanceType string `json:"instance_type"` + // The number of Normalized Capacity Units. + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + // The number of reserved instances. + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + // The offering class of the Reserved Instance. + OfferingClass string `json:"offering_class"` + // The operating system of the Reserved Instance. + OperatingSystem string `json:"operating_system"` + // The payment option for the Reserved Instance. + PurchaseOption string `json:"purchase_option"` + // The AWS region of the Reserved Instance. + Region string `json:"region"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAwsEC2RICommitment instantiates a new CommitmentsAwsEC2RICommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAwsEC2RICommitment(commitmentId string, instanceType string, offeringClass string, operatingSystem string, purchaseOption string, region string) *CommitmentsAwsEC2RICommitment { + this := CommitmentsAwsEC2RICommitment{} + this.CommitmentId = commitmentId + this.InstanceType = instanceType + this.OfferingClass = offeringClass + this.OperatingSystem = operatingSystem + this.PurchaseOption = purchaseOption + this.Region = region + return &this +} + +// NewCommitmentsAwsEC2RICommitmentWithDefaults instantiates a new CommitmentsAwsEC2RICommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAwsEC2RICommitmentWithDefaults() *CommitmentsAwsEC2RICommitment { + this := CommitmentsAwsEC2RICommitment{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetAvailabilityZone() string { + if o == nil || o.AvailabilityZone == nil { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || o.AvailabilityZone == nil { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasAvailabilityZone() bool { + return o != nil && o.AvailabilityZone != nil +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CommitmentsAwsEC2RICommitment) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAwsEC2RICommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAwsEC2RICommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetInstanceType returns the InstanceType field value. +func (o *CommitmentsAwsEC2RICommitment) GetInstanceType() string { + if o == nil { + var ret string + return ret + } + return o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetInstanceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceType, true +} + +// SetInstanceType sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetInstanceType(v string) { + o.InstanceType = v +} + +// GetNumberOfNfus returns the NumberOfNfus field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetNumberOfNfus() float64 { + if o == nil || o.NumberOfNfus == nil { + var ret float64 + return ret + } + return *o.NumberOfNfus +} + +// GetNumberOfNfusOk returns a tuple with the NumberOfNfus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetNumberOfNfusOk() (*float64, bool) { + if o == nil || o.NumberOfNfus == nil { + return nil, false + } + return o.NumberOfNfus, true +} + +// HasNumberOfNfus returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasNumberOfNfus() bool { + return o != nil && o.NumberOfNfus != nil +} + +// SetNumberOfNfus gets a reference to the given float64 and assigns it to the NumberOfNfus field. +func (o *CommitmentsAwsEC2RICommitment) SetNumberOfNfus(v float64) { + o.NumberOfNfus = &v +} + +// GetNumberOfReservations returns the NumberOfReservations field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetNumberOfReservations() float64 { + if o == nil || o.NumberOfReservations == nil { + var ret float64 + return ret + } + return *o.NumberOfReservations +} + +// GetNumberOfReservationsOk returns a tuple with the NumberOfReservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetNumberOfReservationsOk() (*float64, bool) { + if o == nil || o.NumberOfReservations == nil { + return nil, false + } + return o.NumberOfReservations, true +} + +// HasNumberOfReservations returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasNumberOfReservations() bool { + return o != nil && o.NumberOfReservations != nil +} + +// SetNumberOfReservations gets a reference to the given float64 and assigns it to the NumberOfReservations field. +func (o *CommitmentsAwsEC2RICommitment) SetNumberOfReservations(v float64) { + o.NumberOfReservations = &v +} + +// GetOfferingClass returns the OfferingClass field value. +func (o *CommitmentsAwsEC2RICommitment) GetOfferingClass() string { + if o == nil { + var ret string + return ret + } + return o.OfferingClass +} + +// GetOfferingClassOk returns a tuple with the OfferingClass field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetOfferingClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingClass, true +} + +// SetOfferingClass sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetOfferingClass(v string) { + o.OfferingClass = v +} + +// GetOperatingSystem returns the OperatingSystem field value. +func (o *CommitmentsAwsEC2RICommitment) GetOperatingSystem() string { + if o == nil { + var ret string + return ret + } + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetOperatingSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OperatingSystem, true +} + +// SetOperatingSystem sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetOperatingSystem(v string) { + o.OperatingSystem = v +} + +// GetPurchaseOption returns the PurchaseOption field value. +func (o *CommitmentsAwsEC2RICommitment) GetPurchaseOption() string { + if o == nil { + var ret string + return ret + } + return o.PurchaseOption +} + +// GetPurchaseOptionOk returns a tuple with the PurchaseOption field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetPurchaseOptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PurchaseOption, true +} + +// SetPurchaseOption sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetPurchaseOption(v string) { + o.PurchaseOption = v +} + +// GetRegion returns the Region field value. +func (o *CommitmentsAwsEC2RICommitment) GetRegion() string { + if o == nil { + var ret string + return ret + } + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value. +func (o *CommitmentsAwsEC2RICommitment) SetRegion(v string) { + o.Region = v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAwsEC2RICommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAwsEC2RICommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAwsEC2RICommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsEC2RICommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAwsEC2RICommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAwsEC2RICommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAwsEC2RICommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AvailabilityZone != nil { + toSerialize["availability_zone"] = o.AvailabilityZone + } + toSerialize["commitment_id"] = o.CommitmentId + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + toSerialize["instance_type"] = o.InstanceType + if o.NumberOfNfus != nil { + toSerialize["number_of_nfus"] = o.NumberOfNfus + } + if o.NumberOfReservations != nil { + toSerialize["number_of_reservations"] = o.NumberOfReservations + } + toSerialize["offering_class"] = o.OfferingClass + toSerialize["operating_system"] = o.OperatingSystem + toSerialize["purchase_option"] = o.PurchaseOption + toSerialize["region"] = o.Region + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAwsEC2RICommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AvailabilityZone *string `json:"availability_zone,omitempty"` + CommitmentId *string `json:"commitment_id"` + ExpirationDate *string `json:"expiration_date,omitempty"` + InstanceType *string `json:"instance_type"` + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + OfferingClass *string `json:"offering_class"` + OperatingSystem *string `json:"operating_system"` + PurchaseOption *string `json:"purchase_option"` + Region *string `json:"region"` + StartDate *string `json:"start_date,omitempty"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + if all.InstanceType == nil { + return fmt.Errorf("required field instance_type missing") + } + if all.OfferingClass == nil { + return fmt.Errorf("required field offering_class missing") + } + if all.OperatingSystem == nil { + return fmt.Errorf("required field operating_system missing") + } + if all.PurchaseOption == nil { + return fmt.Errorf("required field purchase_option missing") + } + if all.Region == nil { + return fmt.Errorf("required field region missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"availability_zone", "commitment_id", "expiration_date", "instance_type", "number_of_nfus", "number_of_reservations", "offering_class", "operating_system", "purchase_option", "region", "start_date", "term_length", "utilization"}) + } else { + return err + } + o.AvailabilityZone = all.AvailabilityZone + o.CommitmentId = *all.CommitmentId + o.ExpirationDate = all.ExpirationDate + o.InstanceType = *all.InstanceType + o.NumberOfNfus = all.NumberOfNfus + o.NumberOfReservations = all.NumberOfReservations + o.OfferingClass = *all.OfferingClass + o.OperatingSystem = *all.OperatingSystem + o.PurchaseOption = *all.PurchaseOption + o.Region = *all.Region + o.StartDate = all.StartDate + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_aws_elasticache_ri_commitment.go b/api/datadogV2/model_commitments_aws_elasticache_ri_commitment.go new file mode 100644 index 00000000000..1e5c892b398 --- /dev/null +++ b/api/datadogV2/model_commitments_aws_elasticache_ri_commitment.go @@ -0,0 +1,439 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAwsElasticacheRICommitment AWS ElastiCache Reserved Instance commitment details. +type CommitmentsAwsElasticacheRICommitment struct { + // The cache engine type of the Reserved Instance. + CacheEngine string `json:"cache_engine"` + // The unique identifier of the Reserved Instance. + CommitmentId string `json:"commitment_id"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The ElastiCache instance type. + InstanceType string `json:"instance_type"` + // The number of Normalized Capacity Units. + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + // The number of reserved instances. + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + // The payment option for the Reserved Instance. + PurchaseOption string `json:"purchase_option"` + // The AWS region of the Reserved Instance. + Region string `json:"region"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAwsElasticacheRICommitment instantiates a new CommitmentsAwsElasticacheRICommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAwsElasticacheRICommitment(cacheEngine string, commitmentId string, instanceType string, purchaseOption string, region string) *CommitmentsAwsElasticacheRICommitment { + this := CommitmentsAwsElasticacheRICommitment{} + this.CacheEngine = cacheEngine + this.CommitmentId = commitmentId + this.InstanceType = instanceType + this.PurchaseOption = purchaseOption + this.Region = region + return &this +} + +// NewCommitmentsAwsElasticacheRICommitmentWithDefaults instantiates a new CommitmentsAwsElasticacheRICommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAwsElasticacheRICommitmentWithDefaults() *CommitmentsAwsElasticacheRICommitment { + this := CommitmentsAwsElasticacheRICommitment{} + return &this +} + +// GetCacheEngine returns the CacheEngine field value. +func (o *CommitmentsAwsElasticacheRICommitment) GetCacheEngine() string { + if o == nil { + var ret string + return ret + } + return o.CacheEngine +} + +// GetCacheEngineOk returns a tuple with the CacheEngine field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetCacheEngineOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CacheEngine, true +} + +// SetCacheEngine sets field value. +func (o *CommitmentsAwsElasticacheRICommitment) SetCacheEngine(v string) { + o.CacheEngine = v +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAwsElasticacheRICommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAwsElasticacheRICommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAwsElasticacheRICommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetInstanceType returns the InstanceType field value. +func (o *CommitmentsAwsElasticacheRICommitment) GetInstanceType() string { + if o == nil { + var ret string + return ret + } + return o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetInstanceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceType, true +} + +// SetInstanceType sets field value. +func (o *CommitmentsAwsElasticacheRICommitment) SetInstanceType(v string) { + o.InstanceType = v +} + +// GetNumberOfNfus returns the NumberOfNfus field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetNumberOfNfus() float64 { + if o == nil || o.NumberOfNfus == nil { + var ret float64 + return ret + } + return *o.NumberOfNfus +} + +// GetNumberOfNfusOk returns a tuple with the NumberOfNfus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetNumberOfNfusOk() (*float64, bool) { + if o == nil || o.NumberOfNfus == nil { + return nil, false + } + return o.NumberOfNfus, true +} + +// HasNumberOfNfus returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasNumberOfNfus() bool { + return o != nil && o.NumberOfNfus != nil +} + +// SetNumberOfNfus gets a reference to the given float64 and assigns it to the NumberOfNfus field. +func (o *CommitmentsAwsElasticacheRICommitment) SetNumberOfNfus(v float64) { + o.NumberOfNfus = &v +} + +// GetNumberOfReservations returns the NumberOfReservations field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetNumberOfReservations() float64 { + if o == nil || o.NumberOfReservations == nil { + var ret float64 + return ret + } + return *o.NumberOfReservations +} + +// GetNumberOfReservationsOk returns a tuple with the NumberOfReservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetNumberOfReservationsOk() (*float64, bool) { + if o == nil || o.NumberOfReservations == nil { + return nil, false + } + return o.NumberOfReservations, true +} + +// HasNumberOfReservations returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasNumberOfReservations() bool { + return o != nil && o.NumberOfReservations != nil +} + +// SetNumberOfReservations gets a reference to the given float64 and assigns it to the NumberOfReservations field. +func (o *CommitmentsAwsElasticacheRICommitment) SetNumberOfReservations(v float64) { + o.NumberOfReservations = &v +} + +// GetPurchaseOption returns the PurchaseOption field value. +func (o *CommitmentsAwsElasticacheRICommitment) GetPurchaseOption() string { + if o == nil { + var ret string + return ret + } + return o.PurchaseOption +} + +// GetPurchaseOptionOk returns a tuple with the PurchaseOption field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetPurchaseOptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PurchaseOption, true +} + +// SetPurchaseOption sets field value. +func (o *CommitmentsAwsElasticacheRICommitment) SetPurchaseOption(v string) { + o.PurchaseOption = v +} + +// GetRegion returns the Region field value. +func (o *CommitmentsAwsElasticacheRICommitment) GetRegion() string { + if o == nil { + var ret string + return ret + } + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value. +func (o *CommitmentsAwsElasticacheRICommitment) SetRegion(v string) { + o.Region = v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAwsElasticacheRICommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAwsElasticacheRICommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAwsElasticacheRICommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsElasticacheRICommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAwsElasticacheRICommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAwsElasticacheRICommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAwsElasticacheRICommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["cache_engine"] = o.CacheEngine + toSerialize["commitment_id"] = o.CommitmentId + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + toSerialize["instance_type"] = o.InstanceType + if o.NumberOfNfus != nil { + toSerialize["number_of_nfus"] = o.NumberOfNfus + } + if o.NumberOfReservations != nil { + toSerialize["number_of_reservations"] = o.NumberOfReservations + } + toSerialize["purchase_option"] = o.PurchaseOption + toSerialize["region"] = o.Region + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAwsElasticacheRICommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CacheEngine *string `json:"cache_engine"` + CommitmentId *string `json:"commitment_id"` + ExpirationDate *string `json:"expiration_date,omitempty"` + InstanceType *string `json:"instance_type"` + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + PurchaseOption *string `json:"purchase_option"` + Region *string `json:"region"` + StartDate *string `json:"start_date,omitempty"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CacheEngine == nil { + return fmt.Errorf("required field cache_engine missing") + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + if all.InstanceType == nil { + return fmt.Errorf("required field instance_type missing") + } + if all.PurchaseOption == nil { + return fmt.Errorf("required field purchase_option missing") + } + if all.Region == nil { + return fmt.Errorf("required field region missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cache_engine", "commitment_id", "expiration_date", "instance_type", "number_of_nfus", "number_of_reservations", "purchase_option", "region", "start_date", "term_length", "utilization"}) + } else { + return err + } + o.CacheEngine = *all.CacheEngine + o.CommitmentId = *all.CommitmentId + o.ExpirationDate = all.ExpirationDate + o.InstanceType = *all.InstanceType + o.NumberOfNfus = all.NumberOfNfus + o.NumberOfReservations = all.NumberOfReservations + o.PurchaseOption = *all.PurchaseOption + o.Region = *all.Region + o.StartDate = all.StartDate + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_aws_rdsri_commitment.go b/api/datadogV2/model_commitments_aws_rdsri_commitment.go new file mode 100644 index 00000000000..1d9ba2a40d0 --- /dev/null +++ b/api/datadogV2/model_commitments_aws_rdsri_commitment.go @@ -0,0 +1,474 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAwsRDSRICommitment AWS RDS Reserved Instance commitment details. +type CommitmentsAwsRDSRICommitment struct { + // The unique identifier of the Reserved Instance. + CommitmentId string `json:"commitment_id"` + // The database engine of the Reserved Instance. + DatabaseEngine string `json:"database_engine"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The RDS instance type. + InstanceType string `json:"instance_type"` + // Whether the Reserved Instance is Multi-AZ. + IsMultiAz *bool `json:"is_multi_az,omitempty"` + // The number of Normalized Capacity Units. + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + // The number of reserved instances. + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + // The payment option for the Reserved Instance. + PurchaseOption string `json:"purchase_option"` + // The AWS region of the Reserved Instance. + Region string `json:"region"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAwsRDSRICommitment instantiates a new CommitmentsAwsRDSRICommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAwsRDSRICommitment(commitmentId string, databaseEngine string, instanceType string, purchaseOption string, region string) *CommitmentsAwsRDSRICommitment { + this := CommitmentsAwsRDSRICommitment{} + this.CommitmentId = commitmentId + this.DatabaseEngine = databaseEngine + this.InstanceType = instanceType + this.PurchaseOption = purchaseOption + this.Region = region + return &this +} + +// NewCommitmentsAwsRDSRICommitmentWithDefaults instantiates a new CommitmentsAwsRDSRICommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAwsRDSRICommitmentWithDefaults() *CommitmentsAwsRDSRICommitment { + this := CommitmentsAwsRDSRICommitment{} + return &this +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAwsRDSRICommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAwsRDSRICommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetDatabaseEngine returns the DatabaseEngine field value. +func (o *CommitmentsAwsRDSRICommitment) GetDatabaseEngine() string { + if o == nil { + var ret string + return ret + } + return o.DatabaseEngine +} + +// GetDatabaseEngineOk returns a tuple with the DatabaseEngine field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetDatabaseEngineOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatabaseEngine, true +} + +// SetDatabaseEngine sets field value. +func (o *CommitmentsAwsRDSRICommitment) SetDatabaseEngine(v string) { + o.DatabaseEngine = v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAwsRDSRICommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetInstanceType returns the InstanceType field value. +func (o *CommitmentsAwsRDSRICommitment) GetInstanceType() string { + if o == nil { + var ret string + return ret + } + return o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetInstanceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceType, true +} + +// SetInstanceType sets field value. +func (o *CommitmentsAwsRDSRICommitment) SetInstanceType(v string) { + o.InstanceType = v +} + +// GetIsMultiAz returns the IsMultiAz field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetIsMultiAz() bool { + if o == nil || o.IsMultiAz == nil { + var ret bool + return ret + } + return *o.IsMultiAz +} + +// GetIsMultiAzOk returns a tuple with the IsMultiAz field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetIsMultiAzOk() (*bool, bool) { + if o == nil || o.IsMultiAz == nil { + return nil, false + } + return o.IsMultiAz, true +} + +// HasIsMultiAz returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasIsMultiAz() bool { + return o != nil && o.IsMultiAz != nil +} + +// SetIsMultiAz gets a reference to the given bool and assigns it to the IsMultiAz field. +func (o *CommitmentsAwsRDSRICommitment) SetIsMultiAz(v bool) { + o.IsMultiAz = &v +} + +// GetNumberOfNfus returns the NumberOfNfus field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetNumberOfNfus() float64 { + if o == nil || o.NumberOfNfus == nil { + var ret float64 + return ret + } + return *o.NumberOfNfus +} + +// GetNumberOfNfusOk returns a tuple with the NumberOfNfus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetNumberOfNfusOk() (*float64, bool) { + if o == nil || o.NumberOfNfus == nil { + return nil, false + } + return o.NumberOfNfus, true +} + +// HasNumberOfNfus returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasNumberOfNfus() bool { + return o != nil && o.NumberOfNfus != nil +} + +// SetNumberOfNfus gets a reference to the given float64 and assigns it to the NumberOfNfus field. +func (o *CommitmentsAwsRDSRICommitment) SetNumberOfNfus(v float64) { + o.NumberOfNfus = &v +} + +// GetNumberOfReservations returns the NumberOfReservations field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetNumberOfReservations() float64 { + if o == nil || o.NumberOfReservations == nil { + var ret float64 + return ret + } + return *o.NumberOfReservations +} + +// GetNumberOfReservationsOk returns a tuple with the NumberOfReservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetNumberOfReservationsOk() (*float64, bool) { + if o == nil || o.NumberOfReservations == nil { + return nil, false + } + return o.NumberOfReservations, true +} + +// HasNumberOfReservations returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasNumberOfReservations() bool { + return o != nil && o.NumberOfReservations != nil +} + +// SetNumberOfReservations gets a reference to the given float64 and assigns it to the NumberOfReservations field. +func (o *CommitmentsAwsRDSRICommitment) SetNumberOfReservations(v float64) { + o.NumberOfReservations = &v +} + +// GetPurchaseOption returns the PurchaseOption field value. +func (o *CommitmentsAwsRDSRICommitment) GetPurchaseOption() string { + if o == nil { + var ret string + return ret + } + return o.PurchaseOption +} + +// GetPurchaseOptionOk returns a tuple with the PurchaseOption field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetPurchaseOptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PurchaseOption, true +} + +// SetPurchaseOption sets field value. +func (o *CommitmentsAwsRDSRICommitment) SetPurchaseOption(v string) { + o.PurchaseOption = v +} + +// GetRegion returns the Region field value. +func (o *CommitmentsAwsRDSRICommitment) GetRegion() string { + if o == nil { + var ret string + return ret + } + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value. +func (o *CommitmentsAwsRDSRICommitment) SetRegion(v string) { + o.Region = v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAwsRDSRICommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAwsRDSRICommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAwsRDSRICommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsRDSRICommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAwsRDSRICommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAwsRDSRICommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAwsRDSRICommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["commitment_id"] = o.CommitmentId + toSerialize["database_engine"] = o.DatabaseEngine + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + toSerialize["instance_type"] = o.InstanceType + if o.IsMultiAz != nil { + toSerialize["is_multi_az"] = o.IsMultiAz + } + if o.NumberOfNfus != nil { + toSerialize["number_of_nfus"] = o.NumberOfNfus + } + if o.NumberOfReservations != nil { + toSerialize["number_of_reservations"] = o.NumberOfReservations + } + toSerialize["purchase_option"] = o.PurchaseOption + toSerialize["region"] = o.Region + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAwsRDSRICommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CommitmentId *string `json:"commitment_id"` + DatabaseEngine *string `json:"database_engine"` + ExpirationDate *string `json:"expiration_date,omitempty"` + InstanceType *string `json:"instance_type"` + IsMultiAz *bool `json:"is_multi_az,omitempty"` + NumberOfNfus *float64 `json:"number_of_nfus,omitempty"` + NumberOfReservations *float64 `json:"number_of_reservations,omitempty"` + PurchaseOption *string `json:"purchase_option"` + Region *string `json:"region"` + StartDate *string `json:"start_date,omitempty"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + if all.DatabaseEngine == nil { + return fmt.Errorf("required field database_engine missing") + } + if all.InstanceType == nil { + return fmt.Errorf("required field instance_type missing") + } + if all.PurchaseOption == nil { + return fmt.Errorf("required field purchase_option missing") + } + if all.Region == nil { + return fmt.Errorf("required field region missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"commitment_id", "database_engine", "expiration_date", "instance_type", "is_multi_az", "number_of_nfus", "number_of_reservations", "purchase_option", "region", "start_date", "term_length", "utilization"}) + } else { + return err + } + o.CommitmentId = *all.CommitmentId + o.DatabaseEngine = *all.DatabaseEngine + o.ExpirationDate = all.ExpirationDate + o.InstanceType = *all.InstanceType + o.IsMultiAz = all.IsMultiAz + o.NumberOfNfus = all.NumberOfNfus + o.NumberOfReservations = all.NumberOfReservations + o.PurchaseOption = *all.PurchaseOption + o.Region = *all.Region + o.StartDate = all.StartDate + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_aws_sp_commitment.go b/api/datadogV2/model_commitments_aws_sp_commitment.go new file mode 100644 index 00000000000..5096f97ec3c --- /dev/null +++ b/api/datadogV2/model_commitments_aws_sp_commitment.go @@ -0,0 +1,340 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAwsSPCommitment AWS Savings Plan commitment details. +type CommitmentsAwsSPCommitment struct { + // The unique identifier of the Savings Plan. + CommitmentId string `json:"commitment_id"` + // The hourly committed spend for the Savings Plan. + CommittedSpendPerHour *float64 `json:"committed_spend_per_hour,omitempty"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The payment option for the Savings Plan. + PurchaseOption string `json:"purchase_option"` + // The Savings Plan type. + SavingsPlanType string `json:"savings_plan_type"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAwsSPCommitment instantiates a new CommitmentsAwsSPCommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAwsSPCommitment(commitmentId string, purchaseOption string, savingsPlanType string) *CommitmentsAwsSPCommitment { + this := CommitmentsAwsSPCommitment{} + this.CommitmentId = commitmentId + this.PurchaseOption = purchaseOption + this.SavingsPlanType = savingsPlanType + return &this +} + +// NewCommitmentsAwsSPCommitmentWithDefaults instantiates a new CommitmentsAwsSPCommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAwsSPCommitmentWithDefaults() *CommitmentsAwsSPCommitment { + this := CommitmentsAwsSPCommitment{} + return &this +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAwsSPCommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAwsSPCommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetCommittedSpendPerHour returns the CommittedSpendPerHour field value if set, zero value otherwise. +func (o *CommitmentsAwsSPCommitment) GetCommittedSpendPerHour() float64 { + if o == nil || o.CommittedSpendPerHour == nil { + var ret float64 + return ret + } + return *o.CommittedSpendPerHour +} + +// GetCommittedSpendPerHourOk returns a tuple with the CommittedSpendPerHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetCommittedSpendPerHourOk() (*float64, bool) { + if o == nil || o.CommittedSpendPerHour == nil { + return nil, false + } + return o.CommittedSpendPerHour, true +} + +// HasCommittedSpendPerHour returns a boolean if a field has been set. +func (o *CommitmentsAwsSPCommitment) HasCommittedSpendPerHour() bool { + return o != nil && o.CommittedSpendPerHour != nil +} + +// SetCommittedSpendPerHour gets a reference to the given float64 and assigns it to the CommittedSpendPerHour field. +func (o *CommitmentsAwsSPCommitment) SetCommittedSpendPerHour(v float64) { + o.CommittedSpendPerHour = &v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAwsSPCommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAwsSPCommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAwsSPCommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetPurchaseOption returns the PurchaseOption field value. +func (o *CommitmentsAwsSPCommitment) GetPurchaseOption() string { + if o == nil { + var ret string + return ret + } + return o.PurchaseOption +} + +// GetPurchaseOptionOk returns a tuple with the PurchaseOption field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetPurchaseOptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PurchaseOption, true +} + +// SetPurchaseOption sets field value. +func (o *CommitmentsAwsSPCommitment) SetPurchaseOption(v string) { + o.PurchaseOption = v +} + +// GetSavingsPlanType returns the SavingsPlanType field value. +func (o *CommitmentsAwsSPCommitment) GetSavingsPlanType() string { + if o == nil { + var ret string + return ret + } + return o.SavingsPlanType +} + +// GetSavingsPlanTypeOk returns a tuple with the SavingsPlanType field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetSavingsPlanTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SavingsPlanType, true +} + +// SetSavingsPlanType sets field value. +func (o *CommitmentsAwsSPCommitment) SetSavingsPlanType(v string) { + o.SavingsPlanType = v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAwsSPCommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAwsSPCommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAwsSPCommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAwsSPCommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAwsSPCommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAwsSPCommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAwsSPCommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAwsSPCommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAwsSPCommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAwsSPCommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAwsSPCommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["commitment_id"] = o.CommitmentId + if o.CommittedSpendPerHour != nil { + toSerialize["committed_spend_per_hour"] = o.CommittedSpendPerHour + } + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + toSerialize["purchase_option"] = o.PurchaseOption + toSerialize["savings_plan_type"] = o.SavingsPlanType + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAwsSPCommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CommitmentId *string `json:"commitment_id"` + CommittedSpendPerHour *float64 `json:"committed_spend_per_hour,omitempty"` + ExpirationDate *string `json:"expiration_date,omitempty"` + PurchaseOption *string `json:"purchase_option"` + SavingsPlanType *string `json:"savings_plan_type"` + StartDate *string `json:"start_date,omitempty"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + if all.PurchaseOption == nil { + return fmt.Errorf("required field purchase_option missing") + } + if all.SavingsPlanType == nil { + return fmt.Errorf("required field savings_plan_type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"commitment_id", "committed_spend_per_hour", "expiration_date", "purchase_option", "savings_plan_type", "start_date", "term_length", "utilization"}) + } else { + return err + } + o.CommitmentId = *all.CommitmentId + o.CommittedSpendPerHour = all.CommittedSpendPerHour + o.ExpirationDate = all.ExpirationDate + o.PurchaseOption = *all.PurchaseOption + o.SavingsPlanType = *all.SavingsPlanType + o.StartDate = all.StartDate + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_azure_compute_sp_commitment.go b/api/datadogV2/model_commitments_azure_compute_sp_commitment.go new file mode 100644 index 00000000000..18bc026020e --- /dev/null +++ b/api/datadogV2/model_commitments_azure_compute_sp_commitment.go @@ -0,0 +1,308 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAzureComputeSPCommitment Azure Compute Savings Plan commitment details. +type CommitmentsAzureComputeSPCommitment struct { + // The display name of the Azure Savings Plan. + BenefitName string `json:"benefit_name"` + // The unique identifier of the Savings Plan. + CommitmentId string `json:"commitment_id"` + // The hourly committed spend for the Savings Plan. + CommittedSpendPerHour *float64 `json:"committed_spend_per_hour,omitempty"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAzureComputeSPCommitment instantiates a new CommitmentsAzureComputeSPCommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAzureComputeSPCommitment(benefitName string, commitmentId string) *CommitmentsAzureComputeSPCommitment { + this := CommitmentsAzureComputeSPCommitment{} + this.BenefitName = benefitName + this.CommitmentId = commitmentId + return &this +} + +// NewCommitmentsAzureComputeSPCommitmentWithDefaults instantiates a new CommitmentsAzureComputeSPCommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAzureComputeSPCommitmentWithDefaults() *CommitmentsAzureComputeSPCommitment { + this := CommitmentsAzureComputeSPCommitment{} + return &this +} + +// GetBenefitName returns the BenefitName field value. +func (o *CommitmentsAzureComputeSPCommitment) GetBenefitName() string { + if o == nil { + var ret string + return ret + } + return o.BenefitName +} + +// GetBenefitNameOk returns a tuple with the BenefitName field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetBenefitNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BenefitName, true +} + +// SetBenefitName sets field value. +func (o *CommitmentsAzureComputeSPCommitment) SetBenefitName(v string) { + o.BenefitName = v +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAzureComputeSPCommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAzureComputeSPCommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetCommittedSpendPerHour returns the CommittedSpendPerHour field value if set, zero value otherwise. +func (o *CommitmentsAzureComputeSPCommitment) GetCommittedSpendPerHour() float64 { + if o == nil || o.CommittedSpendPerHour == nil { + var ret float64 + return ret + } + return *o.CommittedSpendPerHour +} + +// GetCommittedSpendPerHourOk returns a tuple with the CommittedSpendPerHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetCommittedSpendPerHourOk() (*float64, bool) { + if o == nil || o.CommittedSpendPerHour == nil { + return nil, false + } + return o.CommittedSpendPerHour, true +} + +// HasCommittedSpendPerHour returns a boolean if a field has been set. +func (o *CommitmentsAzureComputeSPCommitment) HasCommittedSpendPerHour() bool { + return o != nil && o.CommittedSpendPerHour != nil +} + +// SetCommittedSpendPerHour gets a reference to the given float64 and assigns it to the CommittedSpendPerHour field. +func (o *CommitmentsAzureComputeSPCommitment) SetCommittedSpendPerHour(v float64) { + o.CommittedSpendPerHour = &v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAzureComputeSPCommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAzureComputeSPCommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAzureComputeSPCommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAzureComputeSPCommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAzureComputeSPCommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAzureComputeSPCommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAzureComputeSPCommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAzureComputeSPCommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAzureComputeSPCommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAzureComputeSPCommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureComputeSPCommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAzureComputeSPCommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAzureComputeSPCommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAzureComputeSPCommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["benefit_name"] = o.BenefitName + toSerialize["commitment_id"] = o.CommitmentId + if o.CommittedSpendPerHour != nil { + toSerialize["committed_spend_per_hour"] = o.CommittedSpendPerHour + } + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAzureComputeSPCommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BenefitName *string `json:"benefit_name"` + CommitmentId *string `json:"commitment_id"` + CommittedSpendPerHour *float64 `json:"committed_spend_per_hour,omitempty"` + ExpirationDate *string `json:"expiration_date,omitempty"` + StartDate *string `json:"start_date,omitempty"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.BenefitName == nil { + return fmt.Errorf("required field benefit_name missing") + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"benefit_name", "commitment_id", "committed_spend_per_hour", "expiration_date", "start_date", "term_length", "utilization"}) + } else { + return err + } + o.BenefitName = *all.BenefitName + o.CommitmentId = *all.CommitmentId + o.CommittedSpendPerHour = all.CommittedSpendPerHour + o.ExpirationDate = all.ExpirationDate + o.StartDate = all.StartDate + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_azure_vmri_commitment.go b/api/datadogV2/model_commitments_azure_vmri_commitment.go new file mode 100644 index 00000000000..a8e8e655af0 --- /dev/null +++ b/api/datadogV2/model_commitments_azure_vmri_commitment.go @@ -0,0 +1,411 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAzureVMRICommitment Azure Virtual Machine Reserved Instance commitment details. +type CommitmentsAzureVMRICommitment struct { + // The display name of the Azure reservation. + BenefitName string `json:"benefit_name"` + // The unique identifier of the Reserved Instance. + CommitmentId string `json:"commitment_id"` + // The expiration date of the commitment. + ExpirationDate *string `json:"expiration_date,omitempty"` + // The Azure VM instance type. + InstanceType string `json:"instance_type"` + // The Azure meter sub-category for the reservation. + MeterSubCategory string `json:"meter_sub_category"` + // The Azure region of the Reserved Instance. + Region string `json:"region"` + // The start date of the commitment. + StartDate *string `json:"start_date,omitempty"` + // Status of an Azure VM Reserved Instance. + Status CommitmentsAzureVMRIStatus `json:"status"` + // The term length in years. + TermLength *float64 `json:"term_length,omitempty"` + // The utilization percentage of the commitment. + Utilization *float64 `json:"utilization,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsAzureVMRICommitment instantiates a new CommitmentsAzureVMRICommitment object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsAzureVMRICommitment(benefitName string, commitmentId string, instanceType string, meterSubCategory string, region string, status CommitmentsAzureVMRIStatus) *CommitmentsAzureVMRICommitment { + this := CommitmentsAzureVMRICommitment{} + this.BenefitName = benefitName + this.CommitmentId = commitmentId + this.InstanceType = instanceType + this.MeterSubCategory = meterSubCategory + this.Region = region + this.Status = status + return &this +} + +// NewCommitmentsAzureVMRICommitmentWithDefaults instantiates a new CommitmentsAzureVMRICommitment object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsAzureVMRICommitmentWithDefaults() *CommitmentsAzureVMRICommitment { + this := CommitmentsAzureVMRICommitment{} + return &this +} + +// GetBenefitName returns the BenefitName field value. +func (o *CommitmentsAzureVMRICommitment) GetBenefitName() string { + if o == nil { + var ret string + return ret + } + return o.BenefitName +} + +// GetBenefitNameOk returns a tuple with the BenefitName field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetBenefitNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BenefitName, true +} + +// SetBenefitName sets field value. +func (o *CommitmentsAzureVMRICommitment) SetBenefitName(v string) { + o.BenefitName = v +} + +// GetCommitmentId returns the CommitmentId field value. +func (o *CommitmentsAzureVMRICommitment) GetCommitmentId() string { + if o == nil { + var ret string + return ret + } + return o.CommitmentId +} + +// GetCommitmentIdOk returns a tuple with the CommitmentId field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetCommitmentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitmentId, true +} + +// SetCommitmentId sets field value. +func (o *CommitmentsAzureVMRICommitment) SetCommitmentId(v string) { + o.CommitmentId = v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *CommitmentsAzureVMRICommitment) GetExpirationDate() string { + if o == nil || o.ExpirationDate == nil { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetExpirationDateOk() (*string, bool) { + if o == nil || o.ExpirationDate == nil { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *CommitmentsAzureVMRICommitment) HasExpirationDate() bool { + return o != nil && o.ExpirationDate != nil +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *CommitmentsAzureVMRICommitment) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetInstanceType returns the InstanceType field value. +func (o *CommitmentsAzureVMRICommitment) GetInstanceType() string { + if o == nil { + var ret string + return ret + } + return o.InstanceType +} + +// GetInstanceTypeOk returns a tuple with the InstanceType field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetInstanceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceType, true +} + +// SetInstanceType sets field value. +func (o *CommitmentsAzureVMRICommitment) SetInstanceType(v string) { + o.InstanceType = v +} + +// GetMeterSubCategory returns the MeterSubCategory field value. +func (o *CommitmentsAzureVMRICommitment) GetMeterSubCategory() string { + if o == nil { + var ret string + return ret + } + return o.MeterSubCategory +} + +// GetMeterSubCategoryOk returns a tuple with the MeterSubCategory field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetMeterSubCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MeterSubCategory, true +} + +// SetMeterSubCategory sets field value. +func (o *CommitmentsAzureVMRICommitment) SetMeterSubCategory(v string) { + o.MeterSubCategory = v +} + +// GetRegion returns the Region field value. +func (o *CommitmentsAzureVMRICommitment) GetRegion() string { + if o == nil { + var ret string + return ret + } + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value. +func (o *CommitmentsAzureVMRICommitment) SetRegion(v string) { + o.Region = v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CommitmentsAzureVMRICommitment) GetStartDate() string { + if o == nil || o.StartDate == nil { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetStartDateOk() (*string, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CommitmentsAzureVMRICommitment) HasStartDate() bool { + return o != nil && o.StartDate != nil +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *CommitmentsAzureVMRICommitment) SetStartDate(v string) { + o.StartDate = &v +} + +// GetStatus returns the Status field value. +func (o *CommitmentsAzureVMRICommitment) GetStatus() CommitmentsAzureVMRIStatus { + if o == nil { + var ret CommitmentsAzureVMRIStatus + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetStatusOk() (*CommitmentsAzureVMRIStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *CommitmentsAzureVMRICommitment) SetStatus(v CommitmentsAzureVMRIStatus) { + o.Status = v +} + +// GetTermLength returns the TermLength field value if set, zero value otherwise. +func (o *CommitmentsAzureVMRICommitment) GetTermLength() float64 { + if o == nil || o.TermLength == nil { + var ret float64 + return ret + } + return *o.TermLength +} + +// GetTermLengthOk returns a tuple with the TermLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetTermLengthOk() (*float64, bool) { + if o == nil || o.TermLength == nil { + return nil, false + } + return o.TermLength, true +} + +// HasTermLength returns a boolean if a field has been set. +func (o *CommitmentsAzureVMRICommitment) HasTermLength() bool { + return o != nil && o.TermLength != nil +} + +// SetTermLength gets a reference to the given float64 and assigns it to the TermLength field. +func (o *CommitmentsAzureVMRICommitment) SetTermLength(v float64) { + o.TermLength = &v +} + +// GetUtilization returns the Utilization field value if set, zero value otherwise. +func (o *CommitmentsAzureVMRICommitment) GetUtilization() float64 { + if o == nil || o.Utilization == nil { + var ret float64 + return ret + } + return *o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsAzureVMRICommitment) GetUtilizationOk() (*float64, bool) { + if o == nil || o.Utilization == nil { + return nil, false + } + return o.Utilization, true +} + +// HasUtilization returns a boolean if a field has been set. +func (o *CommitmentsAzureVMRICommitment) HasUtilization() bool { + return o != nil && o.Utilization != nil +} + +// SetUtilization gets a reference to the given float64 and assigns it to the Utilization field. +func (o *CommitmentsAzureVMRICommitment) SetUtilization(v float64) { + o.Utilization = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsAzureVMRICommitment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["benefit_name"] = o.BenefitName + toSerialize["commitment_id"] = o.CommitmentId + if o.ExpirationDate != nil { + toSerialize["expiration_date"] = o.ExpirationDate + } + toSerialize["instance_type"] = o.InstanceType + toSerialize["meter_sub_category"] = o.MeterSubCategory + toSerialize["region"] = o.Region + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + toSerialize["status"] = o.Status + if o.TermLength != nil { + toSerialize["term_length"] = o.TermLength + } + if o.Utilization != nil { + toSerialize["utilization"] = o.Utilization + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsAzureVMRICommitment) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BenefitName *string `json:"benefit_name"` + CommitmentId *string `json:"commitment_id"` + ExpirationDate *string `json:"expiration_date,omitempty"` + InstanceType *string `json:"instance_type"` + MeterSubCategory *string `json:"meter_sub_category"` + Region *string `json:"region"` + StartDate *string `json:"start_date,omitempty"` + Status *CommitmentsAzureVMRIStatus `json:"status"` + TermLength *float64 `json:"term_length,omitempty"` + Utilization *float64 `json:"utilization,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.BenefitName == nil { + return fmt.Errorf("required field benefit_name missing") + } + if all.CommitmentId == nil { + return fmt.Errorf("required field commitment_id missing") + } + if all.InstanceType == nil { + return fmt.Errorf("required field instance_type missing") + } + if all.MeterSubCategory == nil { + return fmt.Errorf("required field meter_sub_category missing") + } + if all.Region == nil { + return fmt.Errorf("required field region missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"benefit_name", "commitment_id", "expiration_date", "instance_type", "meter_sub_category", "region", "start_date", "status", "term_length", "utilization"}) + } else { + return err + } + + hasInvalidField := false + o.BenefitName = *all.BenefitName + o.CommitmentId = *all.CommitmentId + o.ExpirationDate = all.ExpirationDate + o.InstanceType = *all.InstanceType + o.MeterSubCategory = *all.MeterSubCategory + o.Region = *all.Region + o.StartDate = all.StartDate + if !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = *all.Status + } + o.TermLength = all.TermLength + o.Utilization = all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_azure_vmri_status.go b/api/datadogV2/model_commitments_azure_vmri_status.go new file mode 100644 index 00000000000..2349c7a2ff7 --- /dev/null +++ b/api/datadogV2/model_commitments_azure_vmri_status.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsAzureVMRIStatus Status of an Azure VM Reserved Instance. +type CommitmentsAzureVMRIStatus string + +// List of CommitmentsAzureVMRIStatus. +const ( + COMMITMENTSAZUREVMRISTATUS_RUNNING CommitmentsAzureVMRIStatus = "running" + COMMITMENTSAZUREVMRISTATUS_EXPIRED CommitmentsAzureVMRIStatus = "expired" + COMMITMENTSAZUREVMRISTATUS_CANCELLED CommitmentsAzureVMRIStatus = "cancelled" +) + +var allowedCommitmentsAzureVMRIStatusEnumValues = []CommitmentsAzureVMRIStatus{ + COMMITMENTSAZUREVMRISTATUS_RUNNING, + COMMITMENTSAZUREVMRISTATUS_EXPIRED, + COMMITMENTSAZUREVMRISTATUS_CANCELLED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CommitmentsAzureVMRIStatus) GetAllowedValues() []CommitmentsAzureVMRIStatus { + return allowedCommitmentsAzureVMRIStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CommitmentsAzureVMRIStatus) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CommitmentsAzureVMRIStatus(value) + return nil +} + +// NewCommitmentsAzureVMRIStatusFromValue returns a pointer to a valid CommitmentsAzureVMRIStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCommitmentsAzureVMRIStatusFromValue(v string) (*CommitmentsAzureVMRIStatus, error) { + ev := CommitmentsAzureVMRIStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CommitmentsAzureVMRIStatus: valid values are %v", v, allowedCommitmentsAzureVMRIStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CommitmentsAzureVMRIStatus) IsValid() bool { + for _, existing := range allowedCommitmentsAzureVMRIStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommitmentsAzureVMRIStatus value. +func (v CommitmentsAzureVMRIStatus) Ptr() *CommitmentsAzureVMRIStatus { + return &v +} diff --git a/api/datadogV2/model_commitments_commitment_type.go b/api/datadogV2/model_commitments_commitment_type.go new file mode 100644 index 00000000000..7cb398ac15a --- /dev/null +++ b/api/datadogV2/model_commitments_commitment_type.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsCommitmentType Type of commitment. ri for Reserved Instances, sp for Savings Plans. +type CommitmentsCommitmentType string + +// List of CommitmentsCommitmentType. +const ( + COMMITMENTSCOMMITMENTTYPE_RESERVED_INSTANCES CommitmentsCommitmentType = "ri" + COMMITMENTSCOMMITMENTTYPE_SAVINGS_PLANS CommitmentsCommitmentType = "sp" +) + +var allowedCommitmentsCommitmentTypeEnumValues = []CommitmentsCommitmentType{ + COMMITMENTSCOMMITMENTTYPE_RESERVED_INSTANCES, + COMMITMENTSCOMMITMENTTYPE_SAVINGS_PLANS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CommitmentsCommitmentType) GetAllowedValues() []CommitmentsCommitmentType { + return allowedCommitmentsCommitmentTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CommitmentsCommitmentType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CommitmentsCommitmentType(value) + return nil +} + +// NewCommitmentsCommitmentTypeFromValue returns a pointer to a valid CommitmentsCommitmentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCommitmentsCommitmentTypeFromValue(v string) (*CommitmentsCommitmentType, error) { + ev := CommitmentsCommitmentType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CommitmentsCommitmentType: valid values are %v", v, allowedCommitmentsCommitmentTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CommitmentsCommitmentType) IsValid() bool { + for _, existing := range allowedCommitmentsCommitmentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommitmentsCommitmentType value. +func (v CommitmentsCommitmentType) Ptr() *CommitmentsCommitmentType { + return &v +} diff --git a/api/datadogV2/model_commitments_coverage_scalar_response.go b/api/datadogV2/model_commitments_coverage_scalar_response.go new file mode 100644 index 00000000000..3a765a0eb3d --- /dev/null +++ b/api/datadogV2/model_commitments_coverage_scalar_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsCoverageScalarResponse Response containing scalar coverage metrics for cloud commitment programs. +type CommitmentsCoverageScalarResponse struct { + // Array of scalar columns in the response. + Columns []CommitmentsScalarColumn `json:"columns"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsCoverageScalarResponse instantiates a new CommitmentsCoverageScalarResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsCoverageScalarResponse(columns []CommitmentsScalarColumn) *CommitmentsCoverageScalarResponse { + this := CommitmentsCoverageScalarResponse{} + this.Columns = columns + return &this +} + +// NewCommitmentsCoverageScalarResponseWithDefaults instantiates a new CommitmentsCoverageScalarResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsCoverageScalarResponseWithDefaults() *CommitmentsCoverageScalarResponse { + this := CommitmentsCoverageScalarResponse{} + return &this +} + +// GetColumns returns the Columns field value. +func (o *CommitmentsCoverageScalarResponse) GetColumns() []CommitmentsScalarColumn { + if o == nil { + var ret []CommitmentsScalarColumn + return ret + } + return o.Columns +} + +// GetColumnsOk returns a tuple with the Columns field value +// and a boolean to check if the value has been set. +func (o *CommitmentsCoverageScalarResponse) GetColumnsOk() (*[]CommitmentsScalarColumn, bool) { + if o == nil { + return nil, false + } + return &o.Columns, true +} + +// SetColumns sets field value. +func (o *CommitmentsCoverageScalarResponse) SetColumns(v []CommitmentsScalarColumn) { + o.Columns = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsCoverageScalarResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["columns"] = o.Columns + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsCoverageScalarResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Columns *[]CommitmentsScalarColumn `json:"columns"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Columns == nil { + return fmt.Errorf("required field columns missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"columns"}) + } else { + return err + } + o.Columns = *all.Columns + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_coverage_timeseries_response.go b/api/datadogV2/model_commitments_coverage_timeseries_response.go new file mode 100644 index 00000000000..7f58f3789ae --- /dev/null +++ b/api/datadogV2/model_commitments_coverage_timeseries_response.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsCoverageTimeseriesResponse Response containing timeseries coverage metrics for cloud commitment programs. +type CommitmentsCoverageTimeseriesResponse struct { + // A timeseries metric containing timestamps, series values, and optional unit metadata. + Cost CommitmentsTimeseriesMetric `json:"cost"` + // A timeseries metric containing timestamps, series values, and optional unit metadata. + Hours CommitmentsTimeseriesMetric `json:"hours"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsCoverageTimeseriesResponse instantiates a new CommitmentsCoverageTimeseriesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsCoverageTimeseriesResponse(cost CommitmentsTimeseriesMetric, hours CommitmentsTimeseriesMetric) *CommitmentsCoverageTimeseriesResponse { + this := CommitmentsCoverageTimeseriesResponse{} + this.Cost = cost + this.Hours = hours + return &this +} + +// NewCommitmentsCoverageTimeseriesResponseWithDefaults instantiates a new CommitmentsCoverageTimeseriesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsCoverageTimeseriesResponseWithDefaults() *CommitmentsCoverageTimeseriesResponse { + this := CommitmentsCoverageTimeseriesResponse{} + return &this +} + +// GetCost returns the Cost field value. +func (o *CommitmentsCoverageTimeseriesResponse) GetCost() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.Cost +} + +// GetCostOk returns a tuple with the Cost field value +// and a boolean to check if the value has been set. +func (o *CommitmentsCoverageTimeseriesResponse) GetCostOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.Cost, true +} + +// SetCost sets field value. +func (o *CommitmentsCoverageTimeseriesResponse) SetCost(v CommitmentsTimeseriesMetric) { + o.Cost = v +} + +// GetHours returns the Hours field value. +func (o *CommitmentsCoverageTimeseriesResponse) GetHours() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.Hours +} + +// GetHoursOk returns a tuple with the Hours field value +// and a boolean to check if the value has been set. +func (o *CommitmentsCoverageTimeseriesResponse) GetHoursOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.Hours, true +} + +// SetHours sets field value. +func (o *CommitmentsCoverageTimeseriesResponse) SetHours(v CommitmentsTimeseriesMetric) { + o.Hours = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsCoverageTimeseriesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["cost"] = o.Cost + toSerialize["hours"] = o.Hours + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsCoverageTimeseriesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cost *CommitmentsTimeseriesMetric `json:"cost"` + Hours *CommitmentsTimeseriesMetric `json:"hours"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Cost == nil { + return fmt.Errorf("required field cost missing") + } + if all.Hours == nil { + return fmt.Errorf("required field hours missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cost", "hours"}) + } else { + return err + } + + hasInvalidField := false + if all.Cost.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Cost = *all.Cost + if all.Hours.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Hours = *all.Hours + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_list_item.go b/api/datadogV2/model_commitments_list_item.go new file mode 100644 index 00000000000..a5a3ea512a6 --- /dev/null +++ b/api/datadogV2/model_commitments_list_item.go @@ -0,0 +1,233 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsListItem - A commitment item, which varies based on the provider, product, and commitment type. +type CommitmentsListItem struct { + CommitmentsAwsEC2RICommitment *CommitmentsAwsEC2RICommitment + CommitmentsAwsRDSRICommitment *CommitmentsAwsRDSRICommitment + CommitmentsAwsElasticacheRICommitment *CommitmentsAwsElasticacheRICommitment + CommitmentsAwsSPCommitment *CommitmentsAwsSPCommitment + CommitmentsAzureVMRICommitment *CommitmentsAzureVMRICommitment + CommitmentsAzureComputeSPCommitment *CommitmentsAzureComputeSPCommitment + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// CommitmentsAwsEC2RICommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAwsEC2RICommitment wrapped in CommitmentsListItem. +func CommitmentsAwsEC2RICommitmentAsCommitmentsListItem(v *CommitmentsAwsEC2RICommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAwsEC2RICommitment: v} +} + +// CommitmentsAwsRDSRICommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAwsRDSRICommitment wrapped in CommitmentsListItem. +func CommitmentsAwsRDSRICommitmentAsCommitmentsListItem(v *CommitmentsAwsRDSRICommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAwsRDSRICommitment: v} +} + +// CommitmentsAwsElasticacheRICommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAwsElasticacheRICommitment wrapped in CommitmentsListItem. +func CommitmentsAwsElasticacheRICommitmentAsCommitmentsListItem(v *CommitmentsAwsElasticacheRICommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAwsElasticacheRICommitment: v} +} + +// CommitmentsAwsSPCommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAwsSPCommitment wrapped in CommitmentsListItem. +func CommitmentsAwsSPCommitmentAsCommitmentsListItem(v *CommitmentsAwsSPCommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAwsSPCommitment: v} +} + +// CommitmentsAzureVMRICommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAzureVMRICommitment wrapped in CommitmentsListItem. +func CommitmentsAzureVMRICommitmentAsCommitmentsListItem(v *CommitmentsAzureVMRICommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAzureVMRICommitment: v} +} + +// CommitmentsAzureComputeSPCommitmentAsCommitmentsListItem is a convenience function that returns CommitmentsAzureComputeSPCommitment wrapped in CommitmentsListItem. +func CommitmentsAzureComputeSPCommitmentAsCommitmentsListItem(v *CommitmentsAzureComputeSPCommitment) CommitmentsListItem { + return CommitmentsListItem{CommitmentsAzureComputeSPCommitment: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *CommitmentsListItem) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CommitmentsAwsEC2RICommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAwsEC2RICommitment) + if err == nil { + if obj.CommitmentsAwsEC2RICommitment != nil && obj.CommitmentsAwsEC2RICommitment.UnparsedObject == nil { + jsonCommitmentsAwsEC2RICommitment, _ := datadog.Marshal(obj.CommitmentsAwsEC2RICommitment) + if string(jsonCommitmentsAwsEC2RICommitment) == "{}" { // empty struct + obj.CommitmentsAwsEC2RICommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAwsEC2RICommitment = nil + } + } else { + obj.CommitmentsAwsEC2RICommitment = nil + } + + // try to unmarshal data into CommitmentsAwsRDSRICommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAwsRDSRICommitment) + if err == nil { + if obj.CommitmentsAwsRDSRICommitment != nil && obj.CommitmentsAwsRDSRICommitment.UnparsedObject == nil { + jsonCommitmentsAwsRDSRICommitment, _ := datadog.Marshal(obj.CommitmentsAwsRDSRICommitment) + if string(jsonCommitmentsAwsRDSRICommitment) == "{}" { // empty struct + obj.CommitmentsAwsRDSRICommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAwsRDSRICommitment = nil + } + } else { + obj.CommitmentsAwsRDSRICommitment = nil + } + + // try to unmarshal data into CommitmentsAwsElasticacheRICommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAwsElasticacheRICommitment) + if err == nil { + if obj.CommitmentsAwsElasticacheRICommitment != nil && obj.CommitmentsAwsElasticacheRICommitment.UnparsedObject == nil { + jsonCommitmentsAwsElasticacheRICommitment, _ := datadog.Marshal(obj.CommitmentsAwsElasticacheRICommitment) + if string(jsonCommitmentsAwsElasticacheRICommitment) == "{}" { // empty struct + obj.CommitmentsAwsElasticacheRICommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAwsElasticacheRICommitment = nil + } + } else { + obj.CommitmentsAwsElasticacheRICommitment = nil + } + + // try to unmarshal data into CommitmentsAwsSPCommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAwsSPCommitment) + if err == nil { + if obj.CommitmentsAwsSPCommitment != nil && obj.CommitmentsAwsSPCommitment.UnparsedObject == nil { + jsonCommitmentsAwsSPCommitment, _ := datadog.Marshal(obj.CommitmentsAwsSPCommitment) + if string(jsonCommitmentsAwsSPCommitment) == "{}" { // empty struct + obj.CommitmentsAwsSPCommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAwsSPCommitment = nil + } + } else { + obj.CommitmentsAwsSPCommitment = nil + } + + // try to unmarshal data into CommitmentsAzureVMRICommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAzureVMRICommitment) + if err == nil { + if obj.CommitmentsAzureVMRICommitment != nil && obj.CommitmentsAzureVMRICommitment.UnparsedObject == nil { + jsonCommitmentsAzureVMRICommitment, _ := datadog.Marshal(obj.CommitmentsAzureVMRICommitment) + if string(jsonCommitmentsAzureVMRICommitment) == "{}" { // empty struct + obj.CommitmentsAzureVMRICommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAzureVMRICommitment = nil + } + } else { + obj.CommitmentsAzureVMRICommitment = nil + } + + // try to unmarshal data into CommitmentsAzureComputeSPCommitment + err = datadog.Unmarshal(data, &obj.CommitmentsAzureComputeSPCommitment) + if err == nil { + if obj.CommitmentsAzureComputeSPCommitment != nil && obj.CommitmentsAzureComputeSPCommitment.UnparsedObject == nil { + jsonCommitmentsAzureComputeSPCommitment, _ := datadog.Marshal(obj.CommitmentsAzureComputeSPCommitment) + if string(jsonCommitmentsAzureComputeSPCommitment) == "{}" { // empty struct + obj.CommitmentsAzureComputeSPCommitment = nil + } else { + match++ + } + } else { + obj.CommitmentsAzureComputeSPCommitment = nil + } + } else { + obj.CommitmentsAzureComputeSPCommitment = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.CommitmentsAwsEC2RICommitment = nil + obj.CommitmentsAwsRDSRICommitment = nil + obj.CommitmentsAwsElasticacheRICommitment = nil + obj.CommitmentsAwsSPCommitment = nil + obj.CommitmentsAzureVMRICommitment = nil + obj.CommitmentsAzureComputeSPCommitment = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj CommitmentsListItem) MarshalJSON() ([]byte, error) { + if obj.CommitmentsAwsEC2RICommitment != nil { + return datadog.Marshal(&obj.CommitmentsAwsEC2RICommitment) + } + + if obj.CommitmentsAwsRDSRICommitment != nil { + return datadog.Marshal(&obj.CommitmentsAwsRDSRICommitment) + } + + if obj.CommitmentsAwsElasticacheRICommitment != nil { + return datadog.Marshal(&obj.CommitmentsAwsElasticacheRICommitment) + } + + if obj.CommitmentsAwsSPCommitment != nil { + return datadog.Marshal(&obj.CommitmentsAwsSPCommitment) + } + + if obj.CommitmentsAzureVMRICommitment != nil { + return datadog.Marshal(&obj.CommitmentsAzureVMRICommitment) + } + + if obj.CommitmentsAzureComputeSPCommitment != nil { + return datadog.Marshal(&obj.CommitmentsAzureComputeSPCommitment) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *CommitmentsListItem) GetActualInstance() interface{} { + if obj.CommitmentsAwsEC2RICommitment != nil { + return obj.CommitmentsAwsEC2RICommitment + } + + if obj.CommitmentsAwsRDSRICommitment != nil { + return obj.CommitmentsAwsRDSRICommitment + } + + if obj.CommitmentsAwsElasticacheRICommitment != nil { + return obj.CommitmentsAwsElasticacheRICommitment + } + + if obj.CommitmentsAwsSPCommitment != nil { + return obj.CommitmentsAwsSPCommitment + } + + if obj.CommitmentsAzureVMRICommitment != nil { + return obj.CommitmentsAzureVMRICommitment + } + + if obj.CommitmentsAzureComputeSPCommitment != nil { + return obj.CommitmentsAzureComputeSPCommitment + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_commitments_list_meta.go b/api/datadogV2/model_commitments_list_meta.go new file mode 100644 index 00000000000..4bca1b53a70 --- /dev/null +++ b/api/datadogV2/model_commitments_list_meta.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsListMeta Metadata for a commitments list response. +type CommitmentsListMeta struct { + // Unit metadata for a numeric metric. + CommittedSpendUnit *CommitmentsUnit `json:"committed_spend_unit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsListMeta instantiates a new CommitmentsListMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsListMeta() *CommitmentsListMeta { + this := CommitmentsListMeta{} + return &this +} + +// NewCommitmentsListMetaWithDefaults instantiates a new CommitmentsListMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsListMetaWithDefaults() *CommitmentsListMeta { + this := CommitmentsListMeta{} + return &this +} + +// GetCommittedSpendUnit returns the CommittedSpendUnit field value if set, zero value otherwise. +func (o *CommitmentsListMeta) GetCommittedSpendUnit() CommitmentsUnit { + if o == nil || o.CommittedSpendUnit == nil { + var ret CommitmentsUnit + return ret + } + return *o.CommittedSpendUnit +} + +// GetCommittedSpendUnitOk returns a tuple with the CommittedSpendUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsListMeta) GetCommittedSpendUnitOk() (*CommitmentsUnit, bool) { + if o == nil || o.CommittedSpendUnit == nil { + return nil, false + } + return o.CommittedSpendUnit, true +} + +// HasCommittedSpendUnit returns a boolean if a field has been set. +func (o *CommitmentsListMeta) HasCommittedSpendUnit() bool { + return o != nil && o.CommittedSpendUnit != nil +} + +// SetCommittedSpendUnit gets a reference to the given CommitmentsUnit and assigns it to the CommittedSpendUnit field. +func (o *CommitmentsListMeta) SetCommittedSpendUnit(v CommitmentsUnit) { + o.CommittedSpendUnit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsListMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CommittedSpendUnit != nil { + toSerialize["committed_spend_unit"] = o.CommittedSpendUnit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsListMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CommittedSpendUnit *CommitmentsUnit `json:"committed_spend_unit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"committed_spend_unit"}) + } else { + return err + } + + hasInvalidField := false + if all.CommittedSpendUnit != nil && all.CommittedSpendUnit.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.CommittedSpendUnit = all.CommittedSpendUnit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_list_response.go b/api/datadogV2/model_commitments_list_response.go new file mode 100644 index 00000000000..8bafeaa19a6 --- /dev/null +++ b/api/datadogV2/model_commitments_list_response.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsListResponse Response containing a list of cloud commitment details. +type CommitmentsListResponse struct { + // Array of commitment items. + Commitments []CommitmentsListItem `json:"commitments"` + // Metadata for a commitments list response. + Meta *CommitmentsListMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsListResponse instantiates a new CommitmentsListResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsListResponse(commitments []CommitmentsListItem) *CommitmentsListResponse { + this := CommitmentsListResponse{} + this.Commitments = commitments + return &this +} + +// NewCommitmentsListResponseWithDefaults instantiates a new CommitmentsListResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsListResponseWithDefaults() *CommitmentsListResponse { + this := CommitmentsListResponse{} + return &this +} + +// GetCommitments returns the Commitments field value. +func (o *CommitmentsListResponse) GetCommitments() []CommitmentsListItem { + if o == nil { + var ret []CommitmentsListItem + return ret + } + return o.Commitments +} + +// GetCommitmentsOk returns a tuple with the Commitments field value +// and a boolean to check if the value has been set. +func (o *CommitmentsListResponse) GetCommitmentsOk() (*[]CommitmentsListItem, bool) { + if o == nil { + return nil, false + } + return &o.Commitments, true +} + +// SetCommitments sets field value. +func (o *CommitmentsListResponse) SetCommitments(v []CommitmentsListItem) { + o.Commitments = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CommitmentsListResponse) GetMeta() CommitmentsListMeta { + if o == nil || o.Meta == nil { + var ret CommitmentsListMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsListResponse) GetMetaOk() (*CommitmentsListMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CommitmentsListResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CommitmentsListMeta and assigns it to the Meta field. +func (o *CommitmentsListResponse) SetMeta(v CommitmentsListMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsListResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["commitments"] = o.Commitments + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsListResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Commitments *[]CommitmentsListItem `json:"commitments"` + Meta *CommitmentsListMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Commitments == nil { + return fmt.Errorf("required field commitments missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"commitments", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Commitments = *all.Commitments + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_on_demand_hotspots_scalar_meta.go b/api/datadogV2/model_commitments_on_demand_hotspots_scalar_meta.go new file mode 100644 index 00000000000..94b007887a8 --- /dev/null +++ b/api/datadogV2/model_commitments_on_demand_hotspots_scalar_meta.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsOnDemandHotspotsScalarMeta Metadata for the on-demand hot-spots scalar response. +type CommitmentsOnDemandHotspotsScalarMeta struct { + // Active on-demand filters applied to the response. + OnDemandFilters string `json:"on_demand_filters"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsOnDemandHotspotsScalarMeta instantiates a new CommitmentsOnDemandHotspotsScalarMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsOnDemandHotspotsScalarMeta(onDemandFilters string) *CommitmentsOnDemandHotspotsScalarMeta { + this := CommitmentsOnDemandHotspotsScalarMeta{} + this.OnDemandFilters = onDemandFilters + return &this +} + +// NewCommitmentsOnDemandHotspotsScalarMetaWithDefaults instantiates a new CommitmentsOnDemandHotspotsScalarMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsOnDemandHotspotsScalarMetaWithDefaults() *CommitmentsOnDemandHotspotsScalarMeta { + this := CommitmentsOnDemandHotspotsScalarMeta{} + return &this +} + +// GetOnDemandFilters returns the OnDemandFilters field value. +func (o *CommitmentsOnDemandHotspotsScalarMeta) GetOnDemandFilters() string { + if o == nil { + var ret string + return ret + } + return o.OnDemandFilters +} + +// GetOnDemandFiltersOk returns a tuple with the OnDemandFilters field value +// and a boolean to check if the value has been set. +func (o *CommitmentsOnDemandHotspotsScalarMeta) GetOnDemandFiltersOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OnDemandFilters, true +} + +// SetOnDemandFilters sets field value. +func (o *CommitmentsOnDemandHotspotsScalarMeta) SetOnDemandFilters(v string) { + o.OnDemandFilters = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsOnDemandHotspotsScalarMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["on_demand_filters"] = o.OnDemandFilters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsOnDemandHotspotsScalarMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + OnDemandFilters *string `json:"on_demand_filters"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.OnDemandFilters == nil { + return fmt.Errorf("required field on_demand_filters missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"on_demand_filters"}) + } else { + return err + } + o.OnDemandFilters = *all.OnDemandFilters + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_on_demand_hotspots_scalar_response.go b/api/datadogV2/model_commitments_on_demand_hotspots_scalar_response.go new file mode 100644 index 00000000000..bbd7dc84dfa --- /dev/null +++ b/api/datadogV2/model_commitments_on_demand_hotspots_scalar_response.go @@ -0,0 +1,177 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsOnDemandHotspotsScalarResponse Response containing scalar on-demand hot-spots data for cloud commitment programs. +type CommitmentsOnDemandHotspotsScalarResponse struct { + // Array of scalar columns in the response. + Columns []CommitmentsScalarColumn `json:"columns"` + // Metadata for the on-demand hot-spots scalar response. + Meta *CommitmentsOnDemandHotspotsScalarMeta `json:"meta,omitempty"` + // Array of scalar columns in the response. + Total []CommitmentsScalarColumn `json:"total"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsOnDemandHotspotsScalarResponse instantiates a new CommitmentsOnDemandHotspotsScalarResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsOnDemandHotspotsScalarResponse(columns []CommitmentsScalarColumn, total []CommitmentsScalarColumn) *CommitmentsOnDemandHotspotsScalarResponse { + this := CommitmentsOnDemandHotspotsScalarResponse{} + this.Columns = columns + this.Total = total + return &this +} + +// NewCommitmentsOnDemandHotspotsScalarResponseWithDefaults instantiates a new CommitmentsOnDemandHotspotsScalarResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsOnDemandHotspotsScalarResponseWithDefaults() *CommitmentsOnDemandHotspotsScalarResponse { + this := CommitmentsOnDemandHotspotsScalarResponse{} + return &this +} + +// GetColumns returns the Columns field value. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetColumns() []CommitmentsScalarColumn { + if o == nil { + var ret []CommitmentsScalarColumn + return ret + } + return o.Columns +} + +// GetColumnsOk returns a tuple with the Columns field value +// and a boolean to check if the value has been set. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetColumnsOk() (*[]CommitmentsScalarColumn, bool) { + if o == nil { + return nil, false + } + return &o.Columns, true +} + +// SetColumns sets field value. +func (o *CommitmentsOnDemandHotspotsScalarResponse) SetColumns(v []CommitmentsScalarColumn) { + o.Columns = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetMeta() CommitmentsOnDemandHotspotsScalarMeta { + if o == nil || o.Meta == nil { + var ret CommitmentsOnDemandHotspotsScalarMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetMetaOk() (*CommitmentsOnDemandHotspotsScalarMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CommitmentsOnDemandHotspotsScalarResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CommitmentsOnDemandHotspotsScalarMeta and assigns it to the Meta field. +func (o *CommitmentsOnDemandHotspotsScalarResponse) SetMeta(v CommitmentsOnDemandHotspotsScalarMeta) { + o.Meta = &v +} + +// GetTotal returns the Total field value. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetTotal() []CommitmentsScalarColumn { + if o == nil { + var ret []CommitmentsScalarColumn + return ret + } + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *CommitmentsOnDemandHotspotsScalarResponse) GetTotalOk() (*[]CommitmentsScalarColumn, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value. +func (o *CommitmentsOnDemandHotspotsScalarResponse) SetTotal(v []CommitmentsScalarColumn) { + o.Total = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsOnDemandHotspotsScalarResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["columns"] = o.Columns + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + toSerialize["total"] = o.Total + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsOnDemandHotspotsScalarResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Columns *[]CommitmentsScalarColumn `json:"columns"` + Meta *CommitmentsOnDemandHotspotsScalarMeta `json:"meta,omitempty"` + Total *[]CommitmentsScalarColumn `json:"total"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Columns == nil { + return fmt.Errorf("required field columns missing") + } + if all.Total == nil { + return fmt.Errorf("required field total missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"columns", "meta", "total"}) + } else { + return err + } + + hasInvalidField := false + o.Columns = *all.Columns + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + o.Total = *all.Total + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_provider.go b/api/datadogV2/model_commitments_provider.go new file mode 100644 index 00000000000..87c48a2c7a4 --- /dev/null +++ b/api/datadogV2/model_commitments_provider.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsProvider Cloud provider for commitment programs. +type CommitmentsProvider string + +// List of CommitmentsProvider. +const ( + COMMITMENTSPROVIDER_AWS CommitmentsProvider = "aws" + COMMITMENTSPROVIDER_AZURE CommitmentsProvider = "azure" +) + +var allowedCommitmentsProviderEnumValues = []CommitmentsProvider{ + COMMITMENTSPROVIDER_AWS, + COMMITMENTSPROVIDER_AZURE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CommitmentsProvider) GetAllowedValues() []CommitmentsProvider { + return allowedCommitmentsProviderEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CommitmentsProvider) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CommitmentsProvider(value) + return nil +} + +// NewCommitmentsProviderFromValue returns a pointer to a valid CommitmentsProvider +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCommitmentsProviderFromValue(v string) (*CommitmentsProvider, error) { + ev := CommitmentsProvider(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CommitmentsProvider: valid values are %v", v, allowedCommitmentsProviderEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CommitmentsProvider) IsValid() bool { + for _, existing := range allowedCommitmentsProviderEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommitmentsProvider value. +func (v CommitmentsProvider) Ptr() *CommitmentsProvider { + return &v +} diff --git a/api/datadogV2/model_commitments_savings_scalar_response.go b/api/datadogV2/model_commitments_savings_scalar_response.go new file mode 100644 index 00000000000..1fdbc97e2e1 --- /dev/null +++ b/api/datadogV2/model_commitments_savings_scalar_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsSavingsScalarResponse Response containing scalar savings metrics for cloud commitment programs. +type CommitmentsSavingsScalarResponse struct { + // Array of scalar columns in the response. + Columns []CommitmentsScalarColumn `json:"columns"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsSavingsScalarResponse instantiates a new CommitmentsSavingsScalarResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsSavingsScalarResponse(columns []CommitmentsScalarColumn) *CommitmentsSavingsScalarResponse { + this := CommitmentsSavingsScalarResponse{} + this.Columns = columns + return &this +} + +// NewCommitmentsSavingsScalarResponseWithDefaults instantiates a new CommitmentsSavingsScalarResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsSavingsScalarResponseWithDefaults() *CommitmentsSavingsScalarResponse { + this := CommitmentsSavingsScalarResponse{} + return &this +} + +// GetColumns returns the Columns field value. +func (o *CommitmentsSavingsScalarResponse) GetColumns() []CommitmentsScalarColumn { + if o == nil { + var ret []CommitmentsScalarColumn + return ret + } + return o.Columns +} + +// GetColumnsOk returns a tuple with the Columns field value +// and a boolean to check if the value has been set. +func (o *CommitmentsSavingsScalarResponse) GetColumnsOk() (*[]CommitmentsScalarColumn, bool) { + if o == nil { + return nil, false + } + return &o.Columns, true +} + +// SetColumns sets field value. +func (o *CommitmentsSavingsScalarResponse) SetColumns(v []CommitmentsScalarColumn) { + o.Columns = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsSavingsScalarResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["columns"] = o.Columns + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsSavingsScalarResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Columns *[]CommitmentsScalarColumn `json:"columns"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Columns == nil { + return fmt.Errorf("required field columns missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"columns"}) + } else { + return err + } + o.Columns = *all.Columns + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_savings_timeseries_response.go b/api/datadogV2/model_commitments_savings_timeseries_response.go new file mode 100644 index 00000000000..2cbd54206c8 --- /dev/null +++ b/api/datadogV2/model_commitments_savings_timeseries_response.go @@ -0,0 +1,215 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsSavingsTimeseriesResponse Response containing timeseries savings metrics for cloud commitment programs. +type CommitmentsSavingsTimeseriesResponse struct { + // A timeseries metric containing timestamps, series values, and optional unit metadata. + ActualCost CommitmentsTimeseriesMetric `json:"actual_cost"` + // A timeseries metric containing timestamps, series values, and optional unit metadata. + EffectiveSavingsRate CommitmentsTimeseriesMetric `json:"effective_savings_rate"` + // A timeseries metric containing timestamps, series values, and optional unit metadata. + OnDemandEquivalentCost CommitmentsTimeseriesMetric `json:"on_demand_equivalent_cost"` + // A timeseries metric containing timestamps, series values, and optional unit metadata. + RealizedSavings CommitmentsTimeseriesMetric `json:"realized_savings"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsSavingsTimeseriesResponse instantiates a new CommitmentsSavingsTimeseriesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsSavingsTimeseriesResponse(actualCost CommitmentsTimeseriesMetric, effectiveSavingsRate CommitmentsTimeseriesMetric, onDemandEquivalentCost CommitmentsTimeseriesMetric, realizedSavings CommitmentsTimeseriesMetric) *CommitmentsSavingsTimeseriesResponse { + this := CommitmentsSavingsTimeseriesResponse{} + this.ActualCost = actualCost + this.EffectiveSavingsRate = effectiveSavingsRate + this.OnDemandEquivalentCost = onDemandEquivalentCost + this.RealizedSavings = realizedSavings + return &this +} + +// NewCommitmentsSavingsTimeseriesResponseWithDefaults instantiates a new CommitmentsSavingsTimeseriesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsSavingsTimeseriesResponseWithDefaults() *CommitmentsSavingsTimeseriesResponse { + this := CommitmentsSavingsTimeseriesResponse{} + return &this +} + +// GetActualCost returns the ActualCost field value. +func (o *CommitmentsSavingsTimeseriesResponse) GetActualCost() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.ActualCost +} + +// GetActualCostOk returns a tuple with the ActualCost field value +// and a boolean to check if the value has been set. +func (o *CommitmentsSavingsTimeseriesResponse) GetActualCostOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.ActualCost, true +} + +// SetActualCost sets field value. +func (o *CommitmentsSavingsTimeseriesResponse) SetActualCost(v CommitmentsTimeseriesMetric) { + o.ActualCost = v +} + +// GetEffectiveSavingsRate returns the EffectiveSavingsRate field value. +func (o *CommitmentsSavingsTimeseriesResponse) GetEffectiveSavingsRate() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.EffectiveSavingsRate +} + +// GetEffectiveSavingsRateOk returns a tuple with the EffectiveSavingsRate field value +// and a boolean to check if the value has been set. +func (o *CommitmentsSavingsTimeseriesResponse) GetEffectiveSavingsRateOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.EffectiveSavingsRate, true +} + +// SetEffectiveSavingsRate sets field value. +func (o *CommitmentsSavingsTimeseriesResponse) SetEffectiveSavingsRate(v CommitmentsTimeseriesMetric) { + o.EffectiveSavingsRate = v +} + +// GetOnDemandEquivalentCost returns the OnDemandEquivalentCost field value. +func (o *CommitmentsSavingsTimeseriesResponse) GetOnDemandEquivalentCost() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.OnDemandEquivalentCost +} + +// GetOnDemandEquivalentCostOk returns a tuple with the OnDemandEquivalentCost field value +// and a boolean to check if the value has been set. +func (o *CommitmentsSavingsTimeseriesResponse) GetOnDemandEquivalentCostOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.OnDemandEquivalentCost, true +} + +// SetOnDemandEquivalentCost sets field value. +func (o *CommitmentsSavingsTimeseriesResponse) SetOnDemandEquivalentCost(v CommitmentsTimeseriesMetric) { + o.OnDemandEquivalentCost = v +} + +// GetRealizedSavings returns the RealizedSavings field value. +func (o *CommitmentsSavingsTimeseriesResponse) GetRealizedSavings() CommitmentsTimeseriesMetric { + if o == nil { + var ret CommitmentsTimeseriesMetric + return ret + } + return o.RealizedSavings +} + +// GetRealizedSavingsOk returns a tuple with the RealizedSavings field value +// and a boolean to check if the value has been set. +func (o *CommitmentsSavingsTimeseriesResponse) GetRealizedSavingsOk() (*CommitmentsTimeseriesMetric, bool) { + if o == nil { + return nil, false + } + return &o.RealizedSavings, true +} + +// SetRealizedSavings sets field value. +func (o *CommitmentsSavingsTimeseriesResponse) SetRealizedSavings(v CommitmentsTimeseriesMetric) { + o.RealizedSavings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsSavingsTimeseriesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["actual_cost"] = o.ActualCost + toSerialize["effective_savings_rate"] = o.EffectiveSavingsRate + toSerialize["on_demand_equivalent_cost"] = o.OnDemandEquivalentCost + toSerialize["realized_savings"] = o.RealizedSavings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsSavingsTimeseriesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ActualCost *CommitmentsTimeseriesMetric `json:"actual_cost"` + EffectiveSavingsRate *CommitmentsTimeseriesMetric `json:"effective_savings_rate"` + OnDemandEquivalentCost *CommitmentsTimeseriesMetric `json:"on_demand_equivalent_cost"` + RealizedSavings *CommitmentsTimeseriesMetric `json:"realized_savings"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ActualCost == nil { + return fmt.Errorf("required field actual_cost missing") + } + if all.EffectiveSavingsRate == nil { + return fmt.Errorf("required field effective_savings_rate missing") + } + if all.OnDemandEquivalentCost == nil { + return fmt.Errorf("required field on_demand_equivalent_cost missing") + } + if all.RealizedSavings == nil { + return fmt.Errorf("required field realized_savings missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"actual_cost", "effective_savings_rate", "on_demand_equivalent_cost", "realized_savings"}) + } else { + return err + } + + hasInvalidField := false + if all.ActualCost.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ActualCost = *all.ActualCost + if all.EffectiveSavingsRate.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.EffectiveSavingsRate = *all.EffectiveSavingsRate + if all.OnDemandEquivalentCost.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.OnDemandEquivalentCost = *all.OnDemandEquivalentCost + if all.RealizedSavings.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.RealizedSavings = *all.RealizedSavings + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_scalar_column.go b/api/datadogV2/model_commitments_scalar_column.go new file mode 100644 index 00000000000..1b04279e543 --- /dev/null +++ b/api/datadogV2/model_commitments_scalar_column.go @@ -0,0 +1,213 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsScalarColumn A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. +type CommitmentsScalarColumn struct { + // Metadata for a scalar column, including unit information. + Meta *CommitmentsScalarColumnMeta `json:"meta,omitempty"` + // The column name. + Name string `json:"name"` + // The column type. "group" for dimension columns, "number" for metric columns. + Type CommitmentsScalarColumnType `json:"type"` + // Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + Values []interface{} `json:"values"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsScalarColumn instantiates a new CommitmentsScalarColumn object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsScalarColumn(name string, typeVar CommitmentsScalarColumnType, values []interface{}) *CommitmentsScalarColumn { + this := CommitmentsScalarColumn{} + this.Name = name + this.Type = typeVar + this.Values = values + return &this +} + +// NewCommitmentsScalarColumnWithDefaults instantiates a new CommitmentsScalarColumn object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsScalarColumnWithDefaults() *CommitmentsScalarColumn { + this := CommitmentsScalarColumn{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CommitmentsScalarColumn) GetMeta() CommitmentsScalarColumnMeta { + if o == nil || o.Meta == nil { + var ret CommitmentsScalarColumnMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsScalarColumn) GetMetaOk() (*CommitmentsScalarColumnMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CommitmentsScalarColumn) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CommitmentsScalarColumnMeta and assigns it to the Meta field. +func (o *CommitmentsScalarColumn) SetMeta(v CommitmentsScalarColumnMeta) { + o.Meta = &v +} + +// GetName returns the Name field value. +func (o *CommitmentsScalarColumn) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CommitmentsScalarColumn) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CommitmentsScalarColumn) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value. +func (o *CommitmentsScalarColumn) GetType() CommitmentsScalarColumnType { + if o == nil { + var ret CommitmentsScalarColumnType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CommitmentsScalarColumn) GetTypeOk() (*CommitmentsScalarColumnType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CommitmentsScalarColumn) SetType(v CommitmentsScalarColumnType) { + o.Type = v +} + +// GetValues returns the Values field value. +func (o *CommitmentsScalarColumn) GetValues() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value +// and a boolean to check if the value has been set. +func (o *CommitmentsScalarColumn) GetValuesOk() (*[]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Values, true +} + +// SetValues sets field value. +func (o *CommitmentsScalarColumn) SetValues(v []interface{}) { + o.Values = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsScalarColumn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["values"] = o.Values + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsScalarColumn) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Meta *CommitmentsScalarColumnMeta `json:"meta,omitempty"` + Name *string `json:"name"` + Type *CommitmentsScalarColumnType `json:"type"` + Values *[]interface{} `json:"values"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + if all.Values == nil { + return fmt.Errorf("required field values missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"meta", "name", "type", "values"}) + } else { + return err + } + + hasInvalidField := false + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + o.Name = *all.Name + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + o.Values = *all.Values + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_scalar_column_meta.go b/api/datadogV2/model_commitments_scalar_column_meta.go new file mode 100644 index 00000000000..e6324ffcdd2 --- /dev/null +++ b/api/datadogV2/model_commitments_scalar_column_meta.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsScalarColumnMeta Metadata for a scalar column, including unit information. +type CommitmentsScalarColumnMeta struct { + // Unit metadata for a numeric metric. + Unit CommitmentsUnit `json:"unit"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsScalarColumnMeta instantiates a new CommitmentsScalarColumnMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsScalarColumnMeta(unit CommitmentsUnit) *CommitmentsScalarColumnMeta { + this := CommitmentsScalarColumnMeta{} + this.Unit = unit + return &this +} + +// NewCommitmentsScalarColumnMetaWithDefaults instantiates a new CommitmentsScalarColumnMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsScalarColumnMetaWithDefaults() *CommitmentsScalarColumnMeta { + this := CommitmentsScalarColumnMeta{} + return &this +} + +// GetUnit returns the Unit field value. +func (o *CommitmentsScalarColumnMeta) GetUnit() CommitmentsUnit { + if o == nil { + var ret CommitmentsUnit + return ret + } + return o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value +// and a boolean to check if the value has been set. +func (o *CommitmentsScalarColumnMeta) GetUnitOk() (*CommitmentsUnit, bool) { + if o == nil { + return nil, false + } + return &o.Unit, true +} + +// SetUnit sets field value. +func (o *CommitmentsScalarColumnMeta) SetUnit(v CommitmentsUnit) { + o.Unit = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsScalarColumnMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["unit"] = o.Unit + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsScalarColumnMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Unit *CommitmentsUnit `json:"unit"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Unit == nil { + return fmt.Errorf("required field unit missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"unit"}) + } else { + return err + } + + hasInvalidField := false + if all.Unit.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Unit = *all.Unit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_scalar_column_type.go b/api/datadogV2/model_commitments_scalar_column_type.go new file mode 100644 index 00000000000..cd9cfce05af --- /dev/null +++ b/api/datadogV2/model_commitments_scalar_column_type.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsScalarColumnType The column type. "group" for dimension columns, "number" for metric columns. +type CommitmentsScalarColumnType string + +// List of CommitmentsScalarColumnType. +const ( + COMMITMENTSSCALARCOLUMNTYPE_GROUP CommitmentsScalarColumnType = "group" + COMMITMENTSSCALARCOLUMNTYPE_NUMBER CommitmentsScalarColumnType = "number" +) + +var allowedCommitmentsScalarColumnTypeEnumValues = []CommitmentsScalarColumnType{ + COMMITMENTSSCALARCOLUMNTYPE_GROUP, + COMMITMENTSSCALARCOLUMNTYPE_NUMBER, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CommitmentsScalarColumnType) GetAllowedValues() []CommitmentsScalarColumnType { + return allowedCommitmentsScalarColumnTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CommitmentsScalarColumnType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CommitmentsScalarColumnType(value) + return nil +} + +// NewCommitmentsScalarColumnTypeFromValue returns a pointer to a valid CommitmentsScalarColumnType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCommitmentsScalarColumnTypeFromValue(v string) (*CommitmentsScalarColumnType, error) { + ev := CommitmentsScalarColumnType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CommitmentsScalarColumnType: valid values are %v", v, allowedCommitmentsScalarColumnTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CommitmentsScalarColumnType) IsValid() bool { + for _, existing := range allowedCommitmentsScalarColumnTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommitmentsScalarColumnType value. +func (v CommitmentsScalarColumnType) Ptr() *CommitmentsScalarColumnType { + return &v +} diff --git a/api/datadogV2/model_commitments_timeseries_metric.go b/api/datadogV2/model_commitments_timeseries_metric.go new file mode 100644 index 00000000000..600cee89b20 --- /dev/null +++ b/api/datadogV2/model_commitments_timeseries_metric.go @@ -0,0 +1,177 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsTimeseriesMetric A timeseries metric containing timestamps, series values, and optional unit metadata. +type CommitmentsTimeseriesMetric struct { + // Timeseries data as a map of series names to their corresponding value arrays. + Series map[string][]float64 `json:"series"` + // Unix timestamps in seconds for the timeseries data points. + Times []int64 `json:"times"` + // Unit metadata for a numeric metric. + Unit *CommitmentsUnit `json:"unit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsTimeseriesMetric instantiates a new CommitmentsTimeseriesMetric object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsTimeseriesMetric(series map[string][]float64, times []int64) *CommitmentsTimeseriesMetric { + this := CommitmentsTimeseriesMetric{} + this.Series = series + this.Times = times + return &this +} + +// NewCommitmentsTimeseriesMetricWithDefaults instantiates a new CommitmentsTimeseriesMetric object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsTimeseriesMetricWithDefaults() *CommitmentsTimeseriesMetric { + this := CommitmentsTimeseriesMetric{} + return &this +} + +// GetSeries returns the Series field value. +func (o *CommitmentsTimeseriesMetric) GetSeries() map[string][]float64 { + if o == nil { + var ret map[string][]float64 + return ret + } + return o.Series +} + +// GetSeriesOk returns a tuple with the Series field value +// and a boolean to check if the value has been set. +func (o *CommitmentsTimeseriesMetric) GetSeriesOk() (*map[string][]float64, bool) { + if o == nil { + return nil, false + } + return &o.Series, true +} + +// SetSeries sets field value. +func (o *CommitmentsTimeseriesMetric) SetSeries(v map[string][]float64) { + o.Series = v +} + +// GetTimes returns the Times field value. +func (o *CommitmentsTimeseriesMetric) GetTimes() []int64 { + if o == nil { + var ret []int64 + return ret + } + return o.Times +} + +// GetTimesOk returns a tuple with the Times field value +// and a boolean to check if the value has been set. +func (o *CommitmentsTimeseriesMetric) GetTimesOk() (*[]int64, bool) { + if o == nil { + return nil, false + } + return &o.Times, true +} + +// SetTimes sets field value. +func (o *CommitmentsTimeseriesMetric) SetTimes(v []int64) { + o.Times = v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *CommitmentsTimeseriesMetric) GetUnit() CommitmentsUnit { + if o == nil || o.Unit == nil { + var ret CommitmentsUnit + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsTimeseriesMetric) GetUnitOk() (*CommitmentsUnit, bool) { + if o == nil || o.Unit == nil { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *CommitmentsTimeseriesMetric) HasUnit() bool { + return o != nil && o.Unit != nil +} + +// SetUnit gets a reference to the given CommitmentsUnit and assigns it to the Unit field. +func (o *CommitmentsTimeseriesMetric) SetUnit(v CommitmentsUnit) { + o.Unit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsTimeseriesMetric) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["series"] = o.Series + toSerialize["times"] = o.Times + if o.Unit != nil { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsTimeseriesMetric) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Series *map[string][]float64 `json:"series"` + Times *[]int64 `json:"times"` + Unit *CommitmentsUnit `json:"unit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Series == nil { + return fmt.Errorf("required field series missing") + } + if all.Times == nil { + return fmt.Errorf("required field times missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"series", "times", "unit"}) + } else { + return err + } + + hasInvalidField := false + o.Series = *all.Series + o.Times = *all.Times + if all.Unit != nil && all.Unit.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Unit = all.Unit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_commitments_unit.go b/api/datadogV2/model_commitments_unit.go new file mode 100644 index 00000000000..2b59d0c2af5 --- /dev/null +++ b/api/datadogV2/model_commitments_unit.go @@ -0,0 +1,261 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsUnit Unit metadata for a numeric metric. +type CommitmentsUnit struct { + // The unit family (for example, percentage or money). + Family string `json:"family"` + // The unit identifier. + Id int64 `json:"id"` + // The unit name (for example, percent or dollar). + Name string `json:"name"` + // The plural form of the unit name. + Plural string `json:"plural"` + // The scale factor for the unit. + ScaleFactor float64 `json:"scale_factor"` + // The abbreviated unit name (for example, % or $). + ShortName string `json:"short_name"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsUnit instantiates a new CommitmentsUnit object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsUnit(family string, id int64, name string, plural string, scaleFactor float64, shortName string) *CommitmentsUnit { + this := CommitmentsUnit{} + this.Family = family + this.Id = id + this.Name = name + this.Plural = plural + this.ScaleFactor = scaleFactor + this.ShortName = shortName + return &this +} + +// NewCommitmentsUnitWithDefaults instantiates a new CommitmentsUnit object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsUnitWithDefaults() *CommitmentsUnit { + this := CommitmentsUnit{} + return &this +} + +// GetFamily returns the Family field value. +func (o *CommitmentsUnit) GetFamily() string { + if o == nil { + var ret string + return ret + } + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value. +func (o *CommitmentsUnit) SetFamily(v string) { + o.Family = v +} + +// GetId returns the Id field value. +func (o *CommitmentsUnit) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CommitmentsUnit) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *CommitmentsUnit) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CommitmentsUnit) SetName(v string) { + o.Name = v +} + +// GetPlural returns the Plural field value. +func (o *CommitmentsUnit) GetPlural() string { + if o == nil { + var ret string + return ret + } + return o.Plural +} + +// GetPluralOk returns a tuple with the Plural field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetPluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Plural, true +} + +// SetPlural sets field value. +func (o *CommitmentsUnit) SetPlural(v string) { + o.Plural = v +} + +// GetScaleFactor returns the ScaleFactor field value. +func (o *CommitmentsUnit) GetScaleFactor() float64 { + if o == nil { + var ret float64 + return ret + } + return o.ScaleFactor +} + +// GetScaleFactorOk returns a tuple with the ScaleFactor field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetScaleFactorOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.ScaleFactor, true +} + +// SetScaleFactor sets field value. +func (o *CommitmentsUnit) SetScaleFactor(v float64) { + o.ScaleFactor = v +} + +// GetShortName returns the ShortName field value. +func (o *CommitmentsUnit) GetShortName() string { + if o == nil { + var ret string + return ret + } + return o.ShortName +} + +// GetShortNameOk returns a tuple with the ShortName field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUnit) GetShortNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortName, true +} + +// SetShortName sets field value. +func (o *CommitmentsUnit) SetShortName(v string) { + o.ShortName = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsUnit) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["family"] = o.Family + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["plural"] = o.Plural + toSerialize["scale_factor"] = o.ScaleFactor + toSerialize["short_name"] = o.ShortName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsUnit) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Family *string `json:"family"` + Id *int64 `json:"id"` + Name *string `json:"name"` + Plural *string `json:"plural"` + ScaleFactor *float64 `json:"scale_factor"` + ShortName *string `json:"short_name"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Family == nil { + return fmt.Errorf("required field family missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Plural == nil { + return fmt.Errorf("required field plural missing") + } + if all.ScaleFactor == nil { + return fmt.Errorf("required field scale_factor missing") + } + if all.ShortName == nil { + return fmt.Errorf("required field short_name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"family", "id", "name", "plural", "scale_factor", "short_name"}) + } else { + return err + } + o.Family = *all.Family + o.Id = *all.Id + o.Name = *all.Name + o.Plural = *all.Plural + o.ScaleFactor = *all.ScaleFactor + o.ShortName = *all.ShortName + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_utilization_scalar_product_breakdown_entry.go b/api/datadogV2/model_commitments_utilization_scalar_product_breakdown_entry.go new file mode 100644 index 00000000000..b6de7f43615 --- /dev/null +++ b/api/datadogV2/model_commitments_utilization_scalar_product_breakdown_entry.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsUtilizationScalarProductBreakdownEntry Per-product utilization data in a scalar utilization response. +type CommitmentsUtilizationScalarProductBreakdownEntry struct { + // The cloud product name. + Product string `json:"product"` + // The utilization percentage for the product. + Utilization float64 `json:"utilization"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsUtilizationScalarProductBreakdownEntry instantiates a new CommitmentsUtilizationScalarProductBreakdownEntry object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsUtilizationScalarProductBreakdownEntry(product string, utilization float64) *CommitmentsUtilizationScalarProductBreakdownEntry { + this := CommitmentsUtilizationScalarProductBreakdownEntry{} + this.Product = product + this.Utilization = utilization + return &this +} + +// NewCommitmentsUtilizationScalarProductBreakdownEntryWithDefaults instantiates a new CommitmentsUtilizationScalarProductBreakdownEntry object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsUtilizationScalarProductBreakdownEntryWithDefaults() *CommitmentsUtilizationScalarProductBreakdownEntry { + this := CommitmentsUtilizationScalarProductBreakdownEntry{} + return &this +} + +// GetProduct returns the Product field value. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) GetProduct() string { + if o == nil { + var ret string + return ret + } + return o.Product +} + +// GetProductOk returns a tuple with the Product field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) GetProductOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Product, true +} + +// SetProduct sets field value. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) SetProduct(v string) { + o.Product = v +} + +// GetUtilization returns the Utilization field value. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) GetUtilization() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) GetUtilizationOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Utilization, true +} + +// SetUtilization sets field value. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) SetUtilization(v float64) { + o.Utilization = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsUtilizationScalarProductBreakdownEntry) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["product"] = o.Product + toSerialize["utilization"] = o.Utilization + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsUtilizationScalarProductBreakdownEntry) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Product *string `json:"product"` + Utilization *float64 `json:"utilization"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Product == nil { + return fmt.Errorf("required field product missing") + } + if all.Utilization == nil { + return fmt.Errorf("required field utilization missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"product", "utilization"}) + } else { + return err + } + o.Product = *all.Product + o.Utilization = *all.Utilization + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_utilization_scalar_response.go b/api/datadogV2/model_commitments_utilization_scalar_response.go new file mode 100644 index 00000000000..32dda0a4c6a --- /dev/null +++ b/api/datadogV2/model_commitments_utilization_scalar_response.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsUtilizationScalarResponse Response containing scalar utilization metrics for cloud commitment programs. +type CommitmentsUtilizationScalarResponse struct { + // Array of scalar columns in the response. + Columns []CommitmentsScalarColumn `json:"columns"` + // Array of per-product utilization breakdown entries. + ProductBreakdown []CommitmentsUtilizationScalarProductBreakdownEntry `json:"product_breakdown,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsUtilizationScalarResponse instantiates a new CommitmentsUtilizationScalarResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsUtilizationScalarResponse(columns []CommitmentsScalarColumn) *CommitmentsUtilizationScalarResponse { + this := CommitmentsUtilizationScalarResponse{} + this.Columns = columns + return &this +} + +// NewCommitmentsUtilizationScalarResponseWithDefaults instantiates a new CommitmentsUtilizationScalarResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsUtilizationScalarResponseWithDefaults() *CommitmentsUtilizationScalarResponse { + this := CommitmentsUtilizationScalarResponse{} + return &this +} + +// GetColumns returns the Columns field value. +func (o *CommitmentsUtilizationScalarResponse) GetColumns() []CommitmentsScalarColumn { + if o == nil { + var ret []CommitmentsScalarColumn + return ret + } + return o.Columns +} + +// GetColumnsOk returns a tuple with the Columns field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationScalarResponse) GetColumnsOk() (*[]CommitmentsScalarColumn, bool) { + if o == nil { + return nil, false + } + return &o.Columns, true +} + +// SetColumns sets field value. +func (o *CommitmentsUtilizationScalarResponse) SetColumns(v []CommitmentsScalarColumn) { + o.Columns = v +} + +// GetProductBreakdown returns the ProductBreakdown field value if set, zero value otherwise. +func (o *CommitmentsUtilizationScalarResponse) GetProductBreakdown() []CommitmentsUtilizationScalarProductBreakdownEntry { + if o == nil || o.ProductBreakdown == nil { + var ret []CommitmentsUtilizationScalarProductBreakdownEntry + return ret + } + return o.ProductBreakdown +} + +// GetProductBreakdownOk returns a tuple with the ProductBreakdown field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationScalarResponse) GetProductBreakdownOk() (*[]CommitmentsUtilizationScalarProductBreakdownEntry, bool) { + if o == nil || o.ProductBreakdown == nil { + return nil, false + } + return &o.ProductBreakdown, true +} + +// HasProductBreakdown returns a boolean if a field has been set. +func (o *CommitmentsUtilizationScalarResponse) HasProductBreakdown() bool { + return o != nil && o.ProductBreakdown != nil +} + +// SetProductBreakdown gets a reference to the given []CommitmentsUtilizationScalarProductBreakdownEntry and assigns it to the ProductBreakdown field. +func (o *CommitmentsUtilizationScalarResponse) SetProductBreakdown(v []CommitmentsUtilizationScalarProductBreakdownEntry) { + o.ProductBreakdown = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsUtilizationScalarResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["columns"] = o.Columns + if o.ProductBreakdown != nil { + toSerialize["product_breakdown"] = o.ProductBreakdown + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsUtilizationScalarResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Columns *[]CommitmentsScalarColumn `json:"columns"` + ProductBreakdown []CommitmentsUtilizationScalarProductBreakdownEntry `json:"product_breakdown,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Columns == nil { + return fmt.Errorf("required field columns missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"columns", "product_breakdown"}) + } else { + return err + } + o.Columns = *all.Columns + o.ProductBreakdown = all.ProductBreakdown + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_commitments_utilization_timeseries_response.go b/api/datadogV2/model_commitments_utilization_timeseries_response.go new file mode 100644 index 00000000000..4dd99fb0814 --- /dev/null +++ b/api/datadogV2/model_commitments_utilization_timeseries_response.go @@ -0,0 +1,177 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CommitmentsUtilizationTimeseriesResponse Response containing timeseries utilization metrics for cloud commitment programs. +type CommitmentsUtilizationTimeseriesResponse struct { + // Timeseries data as a map of series names to their corresponding value arrays. + Series map[string][]float64 `json:"series"` + // Unix timestamps in seconds for the timeseries data points. + Times []int64 `json:"times"` + // Unit metadata for a numeric metric. + Unit *CommitmentsUnit `json:"unit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCommitmentsUtilizationTimeseriesResponse instantiates a new CommitmentsUtilizationTimeseriesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCommitmentsUtilizationTimeseriesResponse(series map[string][]float64, times []int64) *CommitmentsUtilizationTimeseriesResponse { + this := CommitmentsUtilizationTimeseriesResponse{} + this.Series = series + this.Times = times + return &this +} + +// NewCommitmentsUtilizationTimeseriesResponseWithDefaults instantiates a new CommitmentsUtilizationTimeseriesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCommitmentsUtilizationTimeseriesResponseWithDefaults() *CommitmentsUtilizationTimeseriesResponse { + this := CommitmentsUtilizationTimeseriesResponse{} + return &this +} + +// GetSeries returns the Series field value. +func (o *CommitmentsUtilizationTimeseriesResponse) GetSeries() map[string][]float64 { + if o == nil { + var ret map[string][]float64 + return ret + } + return o.Series +} + +// GetSeriesOk returns a tuple with the Series field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationTimeseriesResponse) GetSeriesOk() (*map[string][]float64, bool) { + if o == nil { + return nil, false + } + return &o.Series, true +} + +// SetSeries sets field value. +func (o *CommitmentsUtilizationTimeseriesResponse) SetSeries(v map[string][]float64) { + o.Series = v +} + +// GetTimes returns the Times field value. +func (o *CommitmentsUtilizationTimeseriesResponse) GetTimes() []int64 { + if o == nil { + var ret []int64 + return ret + } + return o.Times +} + +// GetTimesOk returns a tuple with the Times field value +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationTimeseriesResponse) GetTimesOk() (*[]int64, bool) { + if o == nil { + return nil, false + } + return &o.Times, true +} + +// SetTimes sets field value. +func (o *CommitmentsUtilizationTimeseriesResponse) SetTimes(v []int64) { + o.Times = v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *CommitmentsUtilizationTimeseriesResponse) GetUnit() CommitmentsUnit { + if o == nil || o.Unit == nil { + var ret CommitmentsUnit + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitmentsUtilizationTimeseriesResponse) GetUnitOk() (*CommitmentsUnit, bool) { + if o == nil || o.Unit == nil { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *CommitmentsUtilizationTimeseriesResponse) HasUnit() bool { + return o != nil && o.Unit != nil +} + +// SetUnit gets a reference to the given CommitmentsUnit and assigns it to the Unit field. +func (o *CommitmentsUtilizationTimeseriesResponse) SetUnit(v CommitmentsUnit) { + o.Unit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CommitmentsUtilizationTimeseriesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["series"] = o.Series + toSerialize["times"] = o.Times + if o.Unit != nil { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CommitmentsUtilizationTimeseriesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Series *map[string][]float64 `json:"series"` + Times *[]int64 `json:"times"` + Unit *CommitmentsUnit `json:"unit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Series == nil { + return fmt.Errorf("required field series missing") + } + if all.Times == nil { + return fmt.Errorf("required field times missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"series", "times", "unit"}) + } else { + return err + } + + hasInvalidField := false + o.Series = *all.Series + o.Times = *all.Times + if all.Unit != nil && all.Unit.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Unit = all.Unit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_currency.go b/api/datadogV2/model_cost_currency.go new file mode 100644 index 00000000000..256a5fdd249 --- /dev/null +++ b/api/datadogV2/model_cost_currency.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostCurrency A Cloud Cost Management billing currency entry. +type CostCurrency struct { + // The currency code (for example, `USD`). + Id string `json:"id"` + // Type of the Cloud Cost Management billing currency resource. + Type CostCurrencyType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostCurrency instantiates a new CostCurrency object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostCurrency(id string, typeVar CostCurrencyType) *CostCurrency { + this := CostCurrency{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewCostCurrencyWithDefaults instantiates a new CostCurrency object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostCurrencyWithDefaults() *CostCurrency { + this := CostCurrency{} + var typeVar CostCurrencyType = COSTCURRENCYTYPE_COST_CURRENCY + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *CostCurrency) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CostCurrency) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CostCurrency) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CostCurrency) GetType() CostCurrencyType { + if o == nil { + var ret CostCurrencyType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostCurrency) GetTypeOk() (*CostCurrencyType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostCurrency) SetType(v CostCurrencyType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostCurrency) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostCurrency) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *CostCurrencyType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_currency_response.go b/api/datadogV2/model_cost_currency_response.go new file mode 100644 index 00000000000..320f59f77e1 --- /dev/null +++ b/api/datadogV2/model_cost_currency_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostCurrencyResponse The dominant Cloud Cost Management billing currency for the requested period. The `data` array contains at most one entry, and is empty when no currency data is available. +type CostCurrencyResponse struct { + // The dominant billing currency. Empty when no data is available, or a single entry otherwise. + Data []CostCurrency `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostCurrencyResponse instantiates a new CostCurrencyResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostCurrencyResponse(data []CostCurrency) *CostCurrencyResponse { + this := CostCurrencyResponse{} + this.Data = data + return &this +} + +// NewCostCurrencyResponseWithDefaults instantiates a new CostCurrencyResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostCurrencyResponseWithDefaults() *CostCurrencyResponse { + this := CostCurrencyResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CostCurrencyResponse) GetData() []CostCurrency { + if o == nil { + var ret []CostCurrency + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostCurrencyResponse) GetDataOk() (*[]CostCurrency, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostCurrencyResponse) SetData(v []CostCurrency) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostCurrencyResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostCurrencyResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostCurrency `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_currency_type.go b/api/datadogV2/model_cost_currency_type.go new file mode 100644 index 00000000000..7856d1a641e --- /dev/null +++ b/api/datadogV2/model_cost_currency_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostCurrencyType Type of the Cloud Cost Management billing currency resource. +type CostCurrencyType string + +// List of CostCurrencyType. +const ( + COSTCURRENCYTYPE_COST_CURRENCY CostCurrencyType = "cost_currency" +) + +var allowedCostCurrencyTypeEnumValues = []CostCurrencyType{ + COSTCURRENCYTYPE_COST_CURRENCY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostCurrencyType) GetAllowedValues() []CostCurrencyType { + return allowedCostCurrencyTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostCurrencyType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostCurrencyType(value) + return nil +} + +// NewCostCurrencyTypeFromValue returns a pointer to a valid CostCurrencyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostCurrencyTypeFromValue(v string) (*CostCurrencyType, error) { + ev := CostCurrencyType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostCurrencyType: valid values are %v", v, allowedCostCurrencyTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostCurrencyType) IsValid() bool { + for _, existing := range allowedCostCurrencyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostCurrencyType value. +func (v CostCurrencyType) Ptr() *CostCurrencyType { + return &v +} diff --git a/api/datadogV2/model_cost_metric.go b/api/datadogV2/model_cost_metric.go new file mode 100644 index 00000000000..df3b45bfe27 --- /dev/null +++ b/api/datadogV2/model_cost_metric.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostMetric A Cloud Cost Management metric that has data for the requested period. +type CostMetric struct { + // The metric name, for example `aws.cost.net.amortized`. + Id string `json:"id"` + // Type of the Cloud Cost Management available metric resource. + Type CostMetricType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostMetric instantiates a new CostMetric object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostMetric(id string, typeVar CostMetricType) *CostMetric { + this := CostMetric{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewCostMetricWithDefaults instantiates a new CostMetric object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostMetricWithDefaults() *CostMetric { + this := CostMetric{} + var typeVar CostMetricType = COSTMETRICTYPE_COST_METRIC + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *CostMetric) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CostMetric) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CostMetric) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CostMetric) GetType() CostMetricType { + if o == nil { + var ret CostMetricType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostMetric) GetTypeOk() (*CostMetricType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostMetric) SetType(v CostMetricType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostMetric) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostMetric) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *CostMetricType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_metric_type.go b/api/datadogV2/model_cost_metric_type.go new file mode 100644 index 00000000000..087228edeb2 --- /dev/null +++ b/api/datadogV2/model_cost_metric_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostMetricType Type of the Cloud Cost Management available metric resource. +type CostMetricType string + +// List of CostMetricType. +const ( + COSTMETRICTYPE_COST_METRIC CostMetricType = "cost_metric" +) + +var allowedCostMetricTypeEnumValues = []CostMetricType{ + COSTMETRICTYPE_COST_METRIC, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostMetricType) GetAllowedValues() []CostMetricType { + return allowedCostMetricTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostMetricType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostMetricType(value) + return nil +} + +// NewCostMetricTypeFromValue returns a pointer to a valid CostMetricType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostMetricTypeFromValue(v string) (*CostMetricType, error) { + ev := CostMetricType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostMetricType: valid values are %v", v, allowedCostMetricTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostMetricType) IsValid() bool { + for _, existing := range allowedCostMetricTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostMetricType value. +func (v CostMetricType) Ptr() *CostMetricType { + return &v +} diff --git a/api/datadogV2/model_cost_metrics_response.go b/api/datadogV2/model_cost_metrics_response.go new file mode 100644 index 00000000000..7f817394c2a --- /dev/null +++ b/api/datadogV2/model_cost_metrics_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostMetricsResponse List of available Cloud Cost Management metrics for the requested period. +type CostMetricsResponse struct { + // List of available metrics. + Data []CostMetric `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostMetricsResponse instantiates a new CostMetricsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostMetricsResponse(data []CostMetric) *CostMetricsResponse { + this := CostMetricsResponse{} + this.Data = data + return &this +} + +// NewCostMetricsResponseWithDefaults instantiates a new CostMetricsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostMetricsResponseWithDefaults() *CostMetricsResponse { + this := CostMetricsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CostMetricsResponse) GetData() []CostMetric { + if o == nil { + var ret []CostMetric + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostMetricsResponse) GetDataOk() (*[]CostMetric, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostMetricsResponse) SetData(v []CostMetric) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostMetricsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostMetric `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_orchestrator.go b/api/datadogV2/model_cost_orchestrator.go new file mode 100644 index 00000000000..1cf28100987 --- /dev/null +++ b/api/datadogV2/model_cost_orchestrator.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostOrchestrator A container orchestrator detected in Cloud Cost Management data. +type CostOrchestrator struct { + // The orchestrator name, for example `kubernetes` or `ecs`. + Id string `json:"id"` + // Type of the Cloud Cost Management orchestrator resource. + Type CostOrchestratorType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostOrchestrator instantiates a new CostOrchestrator object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostOrchestrator(id string, typeVar CostOrchestratorType) *CostOrchestrator { + this := CostOrchestrator{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewCostOrchestratorWithDefaults instantiates a new CostOrchestrator object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostOrchestratorWithDefaults() *CostOrchestrator { + this := CostOrchestrator{} + var typeVar CostOrchestratorType = COSTORCHESTRATORTYPE_COST_ORCHESTRATOR + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *CostOrchestrator) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CostOrchestrator) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CostOrchestrator) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CostOrchestrator) GetType() CostOrchestratorType { + if o == nil { + var ret CostOrchestratorType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostOrchestrator) GetTypeOk() (*CostOrchestratorType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostOrchestrator) SetType(v CostOrchestratorType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostOrchestrator) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostOrchestrator) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *CostOrchestratorType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_orchestrator_type.go b/api/datadogV2/model_cost_orchestrator_type.go new file mode 100644 index 00000000000..883e78d386d --- /dev/null +++ b/api/datadogV2/model_cost_orchestrator_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostOrchestratorType Type of the Cloud Cost Management orchestrator resource. +type CostOrchestratorType string + +// List of CostOrchestratorType. +const ( + COSTORCHESTRATORTYPE_COST_ORCHESTRATOR CostOrchestratorType = "cost_orchestrator" +) + +var allowedCostOrchestratorTypeEnumValues = []CostOrchestratorType{ + COSTORCHESTRATORTYPE_COST_ORCHESTRATOR, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostOrchestratorType) GetAllowedValues() []CostOrchestratorType { + return allowedCostOrchestratorTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostOrchestratorType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostOrchestratorType(value) + return nil +} + +// NewCostOrchestratorTypeFromValue returns a pointer to a valid CostOrchestratorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostOrchestratorTypeFromValue(v string) (*CostOrchestratorType, error) { + ev := CostOrchestratorType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostOrchestratorType: valid values are %v", v, allowedCostOrchestratorTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostOrchestratorType) IsValid() bool { + for _, existing := range allowedCostOrchestratorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostOrchestratorType value. +func (v CostOrchestratorType) Ptr() *CostOrchestratorType { + return &v +} diff --git a/api/datadogV2/model_cost_orchestrators_response.go b/api/datadogV2/model_cost_orchestrators_response.go new file mode 100644 index 00000000000..b29d0cb35f1 --- /dev/null +++ b/api/datadogV2/model_cost_orchestrators_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostOrchestratorsResponse List of container orchestrators detected in Cloud Cost Management data for the requested period. +type CostOrchestratorsResponse struct { + // List of detected container orchestrators. + Data []CostOrchestrator `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostOrchestratorsResponse instantiates a new CostOrchestratorsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostOrchestratorsResponse(data []CostOrchestrator) *CostOrchestratorsResponse { + this := CostOrchestratorsResponse{} + this.Data = data + return &this +} + +// NewCostOrchestratorsResponseWithDefaults instantiates a new CostOrchestratorsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostOrchestratorsResponseWithDefaults() *CostOrchestratorsResponse { + this := CostOrchestratorsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CostOrchestratorsResponse) GetData() []CostOrchestrator { + if o == nil { + var ret []CostOrchestrator + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostOrchestratorsResponse) GetDataOk() (*[]CostOrchestrator, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostOrchestratorsResponse) SetData(v []CostOrchestrator) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostOrchestratorsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostOrchestratorsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostOrchestrator `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_recommendation_array.go b/api/datadogV2/model_cost_recommendation_array.go new file mode 100644 index 00000000000..29a6357264c --- /dev/null +++ b/api/datadogV2/model_cost_recommendation_array.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostRecommendationArray A page of cost recommendations with pagination metadata. +type CostRecommendationArray struct { + // The list of cost recommendations on this page. + Data []CostRecommendationData `json:"data"` + // Top-level JSON:API meta object for paginated cost recommendation responses. + Meta *RecommendationsPageMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostRecommendationArray instantiates a new CostRecommendationArray object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostRecommendationArray(data []CostRecommendationData) *CostRecommendationArray { + this := CostRecommendationArray{} + this.Data = data + return &this +} + +// NewCostRecommendationArrayWithDefaults instantiates a new CostRecommendationArray object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostRecommendationArrayWithDefaults() *CostRecommendationArray { + this := CostRecommendationArray{} + return &this +} + +// GetData returns the Data field value. +func (o *CostRecommendationArray) GetData() []CostRecommendationData { + if o == nil { + var ret []CostRecommendationData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostRecommendationArray) GetDataOk() (*[]CostRecommendationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostRecommendationArray) SetData(v []CostRecommendationData) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CostRecommendationArray) GetMeta() RecommendationsPageMeta { + if o == nil || o.Meta == nil { + var ret RecommendationsPageMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationArray) GetMetaOk() (*RecommendationsPageMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CostRecommendationArray) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given RecommendationsPageMeta and assigns it to the Meta field. +func (o *CostRecommendationArray) SetMeta(v RecommendationsPageMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostRecommendationArray) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostRecommendationArray) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostRecommendationData `json:"data"` + Meta *RecommendationsPageMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_recommendation_data.go b/api/datadogV2/model_cost_recommendation_data.go new file mode 100644 index 00000000000..39d2421dd14 --- /dev/null +++ b/api/datadogV2/model_cost_recommendation_data.go @@ -0,0 +1,186 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostRecommendationData A single cost recommendation entry in JSON:API form. +type CostRecommendationData struct { + // Attributes describing a single cost recommendation. + Attributes *CostRecommendationDataAttributes `json:"attributes,omitempty"` + // Unique identifier for the recommendation. + Id *string `json:"id,omitempty"` + // Recommendation resource type. + Type CostRecommendationDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostRecommendationData instantiates a new CostRecommendationData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostRecommendationData(typeVar CostRecommendationDataType) *CostRecommendationData { + this := CostRecommendationData{} + this.Type = typeVar + return &this +} + +// NewCostRecommendationDataWithDefaults instantiates a new CostRecommendationData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostRecommendationDataWithDefaults() *CostRecommendationData { + this := CostRecommendationData{} + var typeVar CostRecommendationDataType = COSTRECOMMENDATIONDATATYPE_RECOMMENDATION + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CostRecommendationData) GetAttributes() CostRecommendationDataAttributes { + if o == nil || o.Attributes == nil { + var ret CostRecommendationDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationData) GetAttributesOk() (*CostRecommendationDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CostRecommendationData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CostRecommendationDataAttributes and assigns it to the Attributes field. +func (o *CostRecommendationData) SetAttributes(v CostRecommendationDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CostRecommendationData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CostRecommendationData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CostRecommendationData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value. +func (o *CostRecommendationData) GetType() CostRecommendationDataType { + if o == nil { + var ret CostRecommendationDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostRecommendationData) GetTypeOk() (*CostRecommendationDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostRecommendationData) SetType(v CostRecommendationDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostRecommendationData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostRecommendationData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CostRecommendationDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CostRecommendationDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_recommendation_data_attributes.go b/api/datadogV2/model_cost_recommendation_data_attributes.go new file mode 100644 index 00000000000..88c1bb6265b --- /dev/null +++ b/api/datadogV2/model_cost_recommendation_data_attributes.go @@ -0,0 +1,286 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostRecommendationDataAttributes Attributes describing a single cost recommendation. +type CostRecommendationDataAttributes struct { + // Datadog resource key identifying the recommended resource. + DdResourceKey *string `json:"dd_resource_key,omitempty"` + // Estimated daily savings if the recommendation is applied. + PotentialDailySavings *CostRecommendationDataAttributesPotentialDailySavings `json:"potential_daily_savings,omitempty"` + // The kind of recommendation (for example, `terminate` or `rightsize`). + RecommendationType *string `json:"recommendation_type,omitempty"` + // Cloud provider identifier of the resource. + ResourceId *string `json:"resource_id,omitempty"` + // Resource type (for example, `aws_ec2_instance`). + ResourceType *string `json:"resource_type,omitempty"` + // Tags attached to the recommended resource. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostRecommendationDataAttributes instantiates a new CostRecommendationDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostRecommendationDataAttributes() *CostRecommendationDataAttributes { + this := CostRecommendationDataAttributes{} + return &this +} + +// NewCostRecommendationDataAttributesWithDefaults instantiates a new CostRecommendationDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostRecommendationDataAttributesWithDefaults() *CostRecommendationDataAttributes { + this := CostRecommendationDataAttributes{} + return &this +} + +// GetDdResourceKey returns the DdResourceKey field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetDdResourceKey() string { + if o == nil || o.DdResourceKey == nil { + var ret string + return ret + } + return *o.DdResourceKey +} + +// GetDdResourceKeyOk returns a tuple with the DdResourceKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetDdResourceKeyOk() (*string, bool) { + if o == nil || o.DdResourceKey == nil { + return nil, false + } + return o.DdResourceKey, true +} + +// HasDdResourceKey returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasDdResourceKey() bool { + return o != nil && o.DdResourceKey != nil +} + +// SetDdResourceKey gets a reference to the given string and assigns it to the DdResourceKey field. +func (o *CostRecommendationDataAttributes) SetDdResourceKey(v string) { + o.DdResourceKey = &v +} + +// GetPotentialDailySavings returns the PotentialDailySavings field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetPotentialDailySavings() CostRecommendationDataAttributesPotentialDailySavings { + if o == nil || o.PotentialDailySavings == nil { + var ret CostRecommendationDataAttributesPotentialDailySavings + return ret + } + return *o.PotentialDailySavings +} + +// GetPotentialDailySavingsOk returns a tuple with the PotentialDailySavings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetPotentialDailySavingsOk() (*CostRecommendationDataAttributesPotentialDailySavings, bool) { + if o == nil || o.PotentialDailySavings == nil { + return nil, false + } + return o.PotentialDailySavings, true +} + +// HasPotentialDailySavings returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasPotentialDailySavings() bool { + return o != nil && o.PotentialDailySavings != nil +} + +// SetPotentialDailySavings gets a reference to the given CostRecommendationDataAttributesPotentialDailySavings and assigns it to the PotentialDailySavings field. +func (o *CostRecommendationDataAttributes) SetPotentialDailySavings(v CostRecommendationDataAttributesPotentialDailySavings) { + o.PotentialDailySavings = &v +} + +// GetRecommendationType returns the RecommendationType field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetRecommendationType() string { + if o == nil || o.RecommendationType == nil { + var ret string + return ret + } + return *o.RecommendationType +} + +// GetRecommendationTypeOk returns a tuple with the RecommendationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetRecommendationTypeOk() (*string, bool) { + if o == nil || o.RecommendationType == nil { + return nil, false + } + return o.RecommendationType, true +} + +// HasRecommendationType returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasRecommendationType() bool { + return o != nil && o.RecommendationType != nil +} + +// SetRecommendationType gets a reference to the given string and assigns it to the RecommendationType field. +func (o *CostRecommendationDataAttributes) SetRecommendationType(v string) { + o.RecommendationType = &v +} + +// GetResourceId returns the ResourceId field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetResourceId() string { + if o == nil || o.ResourceId == nil { + var ret string + return ret + } + return *o.ResourceId +} + +// GetResourceIdOk returns a tuple with the ResourceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetResourceIdOk() (*string, bool) { + if o == nil || o.ResourceId == nil { + return nil, false + } + return o.ResourceId, true +} + +// HasResourceId returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasResourceId() bool { + return o != nil && o.ResourceId != nil +} + +// SetResourceId gets a reference to the given string and assigns it to the ResourceId field. +func (o *CostRecommendationDataAttributes) SetResourceId(v string) { + o.ResourceId = &v +} + +// GetResourceType returns the ResourceType field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetResourceType() string { + if o == nil || o.ResourceType == nil { + var ret string + return ret + } + return *o.ResourceType +} + +// GetResourceTypeOk returns a tuple with the ResourceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetResourceTypeOk() (*string, bool) { + if o == nil || o.ResourceType == nil { + return nil, false + } + return o.ResourceType, true +} + +// HasResourceType returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasResourceType() bool { + return o != nil && o.ResourceType != nil +} + +// SetResourceType gets a reference to the given string and assigns it to the ResourceType field. +func (o *CostRecommendationDataAttributes) SetResourceType(v string) { + o.ResourceType = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *CostRecommendationDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostRecommendationDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DdResourceKey != nil { + toSerialize["dd_resource_key"] = o.DdResourceKey + } + if o.PotentialDailySavings != nil { + toSerialize["potential_daily_savings"] = o.PotentialDailySavings + } + if o.RecommendationType != nil { + toSerialize["recommendation_type"] = o.RecommendationType + } + if o.ResourceId != nil { + toSerialize["resource_id"] = o.ResourceId + } + if o.ResourceType != nil { + toSerialize["resource_type"] = o.ResourceType + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostRecommendationDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DdResourceKey *string `json:"dd_resource_key,omitempty"` + PotentialDailySavings *CostRecommendationDataAttributesPotentialDailySavings `json:"potential_daily_savings,omitempty"` + RecommendationType *string `json:"recommendation_type,omitempty"` + ResourceId *string `json:"resource_id,omitempty"` + ResourceType *string `json:"resource_type,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"dd_resource_key", "potential_daily_savings", "recommendation_type", "resource_id", "resource_type", "tags"}) + } else { + return err + } + + hasInvalidField := false + o.DdResourceKey = all.DdResourceKey + if all.PotentialDailySavings != nil && all.PotentialDailySavings.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.PotentialDailySavings = all.PotentialDailySavings + o.RecommendationType = all.RecommendationType + o.ResourceId = all.ResourceId + o.ResourceType = all.ResourceType + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_recommendation_data_attributes_potential_daily_savings.go b/api/datadogV2/model_cost_recommendation_data_attributes_potential_daily_savings.go new file mode 100644 index 00000000000..0296afe9a4c --- /dev/null +++ b/api/datadogV2/model_cost_recommendation_data_attributes_potential_daily_savings.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostRecommendationDataAttributesPotentialDailySavings Estimated daily savings if the recommendation is applied. +type CostRecommendationDataAttributesPotentialDailySavings struct { + // Numeric amount of the potential daily savings. + Amount *float64 `json:"amount,omitempty"` + // ISO 4217 currency code for the savings amount. + Currency *string `json:"currency,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostRecommendationDataAttributesPotentialDailySavings instantiates a new CostRecommendationDataAttributesPotentialDailySavings object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostRecommendationDataAttributesPotentialDailySavings() *CostRecommendationDataAttributesPotentialDailySavings { + this := CostRecommendationDataAttributesPotentialDailySavings{} + return &this +} + +// NewCostRecommendationDataAttributesPotentialDailySavingsWithDefaults instantiates a new CostRecommendationDataAttributesPotentialDailySavings object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostRecommendationDataAttributesPotentialDailySavingsWithDefaults() *CostRecommendationDataAttributesPotentialDailySavings { + this := CostRecommendationDataAttributesPotentialDailySavings{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributesPotentialDailySavings) GetAmount() float64 { + if o == nil || o.Amount == nil { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributesPotentialDailySavings) GetAmountOk() (*float64, bool) { + if o == nil || o.Amount == nil { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributesPotentialDailySavings) HasAmount() bool { + return o != nil && o.Amount != nil +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *CostRecommendationDataAttributesPotentialDailySavings) SetAmount(v float64) { + o.Amount = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *CostRecommendationDataAttributesPotentialDailySavings) GetCurrency() string { + if o == nil || o.Currency == nil { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostRecommendationDataAttributesPotentialDailySavings) GetCurrencyOk() (*string, bool) { + if o == nil || o.Currency == nil { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *CostRecommendationDataAttributesPotentialDailySavings) HasCurrency() bool { + return o != nil && o.Currency != nil +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *CostRecommendationDataAttributesPotentialDailySavings) SetCurrency(v string) { + o.Currency = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostRecommendationDataAttributesPotentialDailySavings) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Amount != nil { + toSerialize["amount"] = o.Amount + } + if o.Currency != nil { + toSerialize["currency"] = o.Currency + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostRecommendationDataAttributesPotentialDailySavings) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Amount *float64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"amount", "currency"}) + } else { + return err + } + o.Amount = all.Amount + o.Currency = all.Currency + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_recommendation_data_type.go b/api/datadogV2/model_cost_recommendation_data_type.go new file mode 100644 index 00000000000..9a3c452c92c --- /dev/null +++ b/api/datadogV2/model_cost_recommendation_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostRecommendationDataType Recommendation resource type. +type CostRecommendationDataType string + +// List of CostRecommendationDataType. +const ( + COSTRECOMMENDATIONDATATYPE_RECOMMENDATION CostRecommendationDataType = "recommendation" +) + +var allowedCostRecommendationDataTypeEnumValues = []CostRecommendationDataType{ + COSTRECOMMENDATIONDATATYPE_RECOMMENDATION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostRecommendationDataType) GetAllowedValues() []CostRecommendationDataType { + return allowedCostRecommendationDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostRecommendationDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostRecommendationDataType(value) + return nil +} + +// NewCostRecommendationDataTypeFromValue returns a pointer to a valid CostRecommendationDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostRecommendationDataTypeFromValue(v string) (*CostRecommendationDataType, error) { + ev := CostRecommendationDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostRecommendationDataType: valid values are %v", v, allowedCostRecommendationDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostRecommendationDataType) IsValid() bool { + for _, existing := range allowedCostRecommendationDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostRecommendationDataType value. +func (v CostRecommendationDataType) Ptr() *CostRecommendationDataType { + return &v +} diff --git a/api/datadogV2/model_cost_tag_key_metadata.go b/api/datadogV2/model_cost_tag_key_metadata.go new file mode 100644 index 00000000000..63ee0988ed6 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_metadata.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeyMetadata A Cloud Cost Management tag key metadata entry, aggregating coverage and example values for a single tag key, metric, and period. +type CostTagKeyMetadata struct { + // Attributes of a Cloud Cost Management tag key metadata entry. + Attributes CostTagKeyMetadataAttributes `json:"attributes"` + // A composite identifier of the form `tag_key:metric` for monthly roll-ups, or `tag_key:metric:YYYY-MM-DD` when `filter[daily]=true`. + Id string `json:"id"` + // Type of the Cloud Cost Management tag key metadata resource. + Type CostTagKeyMetadataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeyMetadata instantiates a new CostTagKeyMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeyMetadata(attributes CostTagKeyMetadataAttributes, id string, typeVar CostTagKeyMetadataType) *CostTagKeyMetadata { + this := CostTagKeyMetadata{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCostTagKeyMetadataWithDefaults instantiates a new CostTagKeyMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeyMetadataWithDefaults() *CostTagKeyMetadata { + this := CostTagKeyMetadata{} + var typeVar CostTagKeyMetadataType = COSTTAGKEYMETADATATYPE_COST_TAG_KEY_METADATA + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CostTagKeyMetadata) GetAttributes() CostTagKeyMetadataAttributes { + if o == nil { + var ret CostTagKeyMetadataAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadata) GetAttributesOk() (*CostTagKeyMetadataAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CostTagKeyMetadata) SetAttributes(v CostTagKeyMetadataAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CostTagKeyMetadata) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadata) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CostTagKeyMetadata) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CostTagKeyMetadata) GetType() CostTagKeyMetadataType { + if o == nil { + var ret CostTagKeyMetadataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadata) GetTypeOk() (*CostTagKeyMetadataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostTagKeyMetadata) SetType(v CostTagKeyMetadataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeyMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeyMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CostTagKeyMetadataAttributes `json:"attributes"` + Id *string `json:"id"` + Type *CostTagKeyMetadataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_key_metadata_attributes.go b/api/datadogV2/model_cost_tag_key_metadata_attributes.go new file mode 100644 index 00000000000..6929221f9b5 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_metadata_attributes.go @@ -0,0 +1,296 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeyMetadataAttributes Attributes of a Cloud Cost Management tag key metadata entry. +type CostTagKeyMetadataAttributes struct { + // Number of unique tag values observed for this tag key, keyed by cloud account ID. + CardinalityByAccount map[string]int64 `json:"cardinality_by_account"` + // Total cost (in the report currency) of cost line items that carry this tag key for the requested period. + CostCovered float64 `json:"cost_covered"` + // The day this row corresponds to, in `YYYY-MM-DD` format. Present only when `filter[daily]=true`; omitted for the monthly roll-up returned by default. + Date *string `json:"date,omitempty"` + // The Cloud Cost Management metric this row aggregates, for example `aws.cost.net.amortized`. + Metric string `json:"metric"` + // Number of cost rows that carry this tag key over the requested period. + RowCount int64 `json:"row_count"` + // Origins where this tag key was observed (for example, `aws-user-defined`). + TagSources []string `json:"tag_sources"` + // A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + TopValuesByAccount map[string][]string `json:"top_values_by_account"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeyMetadataAttributes instantiates a new CostTagKeyMetadataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeyMetadataAttributes(cardinalityByAccount map[string]int64, costCovered float64, metric string, rowCount int64, tagSources []string, topValuesByAccount map[string][]string) *CostTagKeyMetadataAttributes { + this := CostTagKeyMetadataAttributes{} + this.CardinalityByAccount = cardinalityByAccount + this.CostCovered = costCovered + this.Metric = metric + this.RowCount = rowCount + this.TagSources = tagSources + this.TopValuesByAccount = topValuesByAccount + return &this +} + +// NewCostTagKeyMetadataAttributesWithDefaults instantiates a new CostTagKeyMetadataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeyMetadataAttributesWithDefaults() *CostTagKeyMetadataAttributes { + this := CostTagKeyMetadataAttributes{} + return &this +} + +// GetCardinalityByAccount returns the CardinalityByAccount field value. +func (o *CostTagKeyMetadataAttributes) GetCardinalityByAccount() map[string]int64 { + if o == nil { + var ret map[string]int64 + return ret + } + return o.CardinalityByAccount +} + +// GetCardinalityByAccountOk returns a tuple with the CardinalityByAccount field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetCardinalityByAccountOk() (*map[string]int64, bool) { + if o == nil { + return nil, false + } + return &o.CardinalityByAccount, true +} + +// SetCardinalityByAccount sets field value. +func (o *CostTagKeyMetadataAttributes) SetCardinalityByAccount(v map[string]int64) { + o.CardinalityByAccount = v +} + +// GetCostCovered returns the CostCovered field value. +func (o *CostTagKeyMetadataAttributes) GetCostCovered() float64 { + if o == nil { + var ret float64 + return ret + } + return o.CostCovered +} + +// GetCostCoveredOk returns a tuple with the CostCovered field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetCostCoveredOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.CostCovered, true +} + +// SetCostCovered sets field value. +func (o *CostTagKeyMetadataAttributes) SetCostCovered(v float64) { + o.CostCovered = v +} + +// GetDate returns the Date field value if set, zero value otherwise. +func (o *CostTagKeyMetadataAttributes) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetDateOk() (*string, bool) { + if o == nil || o.Date == nil { + return nil, false + } + return o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *CostTagKeyMetadataAttributes) HasDate() bool { + return o != nil && o.Date != nil +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *CostTagKeyMetadataAttributes) SetDate(v string) { + o.Date = &v +} + +// GetMetric returns the Metric field value. +func (o *CostTagKeyMetadataAttributes) GetMetric() string { + if o == nil { + var ret string + return ret + } + return o.Metric +} + +// GetMetricOk returns a tuple with the Metric field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetMetricOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metric, true +} + +// SetMetric sets field value. +func (o *CostTagKeyMetadataAttributes) SetMetric(v string) { + o.Metric = v +} + +// GetRowCount returns the RowCount field value. +func (o *CostTagKeyMetadataAttributes) GetRowCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.RowCount +} + +// GetRowCountOk returns a tuple with the RowCount field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetRowCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.RowCount, true +} + +// SetRowCount sets field value. +func (o *CostTagKeyMetadataAttributes) SetRowCount(v int64) { + o.RowCount = v +} + +// GetTagSources returns the TagSources field value. +func (o *CostTagKeyMetadataAttributes) GetTagSources() []string { + if o == nil { + var ret []string + return ret + } + return o.TagSources +} + +// GetTagSourcesOk returns a tuple with the TagSources field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetTagSourcesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.TagSources, true +} + +// SetTagSources sets field value. +func (o *CostTagKeyMetadataAttributes) SetTagSources(v []string) { + o.TagSources = v +} + +// GetTopValuesByAccount returns the TopValuesByAccount field value. +func (o *CostTagKeyMetadataAttributes) GetTopValuesByAccount() map[string][]string { + if o == nil { + var ret map[string][]string + return ret + } + return o.TopValuesByAccount +} + +// GetTopValuesByAccountOk returns a tuple with the TopValuesByAccount field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataAttributes) GetTopValuesByAccountOk() (*map[string][]string, bool) { + if o == nil { + return nil, false + } + return &o.TopValuesByAccount, true +} + +// SetTopValuesByAccount sets field value. +func (o *CostTagKeyMetadataAttributes) SetTopValuesByAccount(v map[string][]string) { + o.TopValuesByAccount = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeyMetadataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["cardinality_by_account"] = o.CardinalityByAccount + toSerialize["cost_covered"] = o.CostCovered + if o.Date != nil { + toSerialize["date"] = o.Date + } + toSerialize["metric"] = o.Metric + toSerialize["row_count"] = o.RowCount + toSerialize["tag_sources"] = o.TagSources + toSerialize["top_values_by_account"] = o.TopValuesByAccount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeyMetadataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CardinalityByAccount *map[string]int64 `json:"cardinality_by_account"` + CostCovered *float64 `json:"cost_covered"` + Date *string `json:"date,omitempty"` + Metric *string `json:"metric"` + RowCount *int64 `json:"row_count"` + TagSources *[]string `json:"tag_sources"` + TopValuesByAccount *map[string][]string `json:"top_values_by_account"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CardinalityByAccount == nil { + return fmt.Errorf("required field cardinality_by_account missing") + } + if all.CostCovered == nil { + return fmt.Errorf("required field cost_covered missing") + } + if all.Metric == nil { + return fmt.Errorf("required field metric missing") + } + if all.RowCount == nil { + return fmt.Errorf("required field row_count missing") + } + if all.TagSources == nil { + return fmt.Errorf("required field tag_sources missing") + } + if all.TopValuesByAccount == nil { + return fmt.Errorf("required field top_values_by_account missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cardinality_by_account", "cost_covered", "date", "metric", "row_count", "tag_sources", "top_values_by_account"}) + } else { + return err + } + o.CardinalityByAccount = *all.CardinalityByAccount + o.CostCovered = *all.CostCovered + o.Date = all.Date + o.Metric = *all.Metric + o.RowCount = *all.RowCount + o.TagSources = *all.TagSources + o.TopValuesByAccount = *all.TopValuesByAccount + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_key_metadata_response.go b/api/datadogV2/model_cost_tag_key_metadata_response.go new file mode 100644 index 00000000000..dbe915b7199 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_metadata_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeyMetadataResponse List of Cloud Cost Management tag key metadata entries for the requested period. +type CostTagKeyMetadataResponse struct { + // List of tag key metadata entries. + Data []CostTagKeyMetadata `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeyMetadataResponse instantiates a new CostTagKeyMetadataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeyMetadataResponse(data []CostTagKeyMetadata) *CostTagKeyMetadataResponse { + this := CostTagKeyMetadataResponse{} + this.Data = data + return &this +} + +// NewCostTagKeyMetadataResponseWithDefaults instantiates a new CostTagKeyMetadataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeyMetadataResponseWithDefaults() *CostTagKeyMetadataResponse { + this := CostTagKeyMetadataResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CostTagKeyMetadataResponse) GetData() []CostTagKeyMetadata { + if o == nil { + var ret []CostTagKeyMetadata + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostTagKeyMetadataResponse) GetDataOk() (*[]CostTagKeyMetadata, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostTagKeyMetadataResponse) SetData(v []CostTagKeyMetadata) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeyMetadataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeyMetadataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostTagKeyMetadata `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_key_metadata_type.go b/api/datadogV2/model_cost_tag_key_metadata_type.go new file mode 100644 index 00000000000..a962338441c --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_metadata_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeyMetadataType Type of the Cloud Cost Management tag key metadata resource. +type CostTagKeyMetadataType string + +// List of CostTagKeyMetadataType. +const ( + COSTTAGKEYMETADATATYPE_COST_TAG_KEY_METADATA CostTagKeyMetadataType = "cost_tag_key_metadata" +) + +var allowedCostTagKeyMetadataTypeEnumValues = []CostTagKeyMetadataType{ + COSTTAGKEYMETADATATYPE_COST_TAG_KEY_METADATA, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostTagKeyMetadataType) GetAllowedValues() []CostTagKeyMetadataType { + return allowedCostTagKeyMetadataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostTagKeyMetadataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostTagKeyMetadataType(value) + return nil +} + +// NewCostTagKeyMetadataTypeFromValue returns a pointer to a valid CostTagKeyMetadataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostTagKeyMetadataTypeFromValue(v string) (*CostTagKeyMetadataType, error) { + ev := CostTagKeyMetadataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostTagKeyMetadataType: valid values are %v", v, allowedCostTagKeyMetadataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostTagKeyMetadataType) IsValid() bool { + for _, existing := range allowedCostTagKeyMetadataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostTagKeyMetadataType value. +func (v CostTagKeyMetadataType) Ptr() *CostTagKeyMetadataType { + return &v +} diff --git a/api/datadogV2/model_cost_tag_key_source.go b/api/datadogV2/model_cost_tag_key_source.go new file mode 100644 index 00000000000..058526b24b0 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_source.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeySource A Cloud Cost Management tag key paired with the sources that produced it. +type CostTagKeySource struct { + // Attributes of a Cloud Cost Management tag source. + Attributes CostTagKeySourceAttributes `json:"attributes"` + // The tag key identifier. Equal to the empty-tag sentinel `__empty_tag_key__` when the tag key is empty. + Id string `json:"id"` + // Type of the Cloud Cost Management tag source resource. + Type CostTagKeySourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeySource instantiates a new CostTagKeySource object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeySource(attributes CostTagKeySourceAttributes, id string, typeVar CostTagKeySourceType) *CostTagKeySource { + this := CostTagKeySource{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCostTagKeySourceWithDefaults instantiates a new CostTagKeySource object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeySourceWithDefaults() *CostTagKeySource { + this := CostTagKeySource{} + var typeVar CostTagKeySourceType = COSTTAGKEYSOURCETYPE_COST_TAG_KEY_SOURCE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CostTagKeySource) GetAttributes() CostTagKeySourceAttributes { + if o == nil { + var ret CostTagKeySourceAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySource) GetAttributesOk() (*CostTagKeySourceAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CostTagKeySource) SetAttributes(v CostTagKeySourceAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CostTagKeySource) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CostTagKeySource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CostTagKeySource) GetType() CostTagKeySourceType { + if o == nil { + var ret CostTagKeySourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySource) GetTypeOk() (*CostTagKeySourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CostTagKeySource) SetType(v CostTagKeySourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeySource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeySource) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CostTagKeySourceAttributes `json:"attributes"` + Id *string `json:"id"` + Type *CostTagKeySourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_key_source_attributes.go b/api/datadogV2/model_cost_tag_key_source_attributes.go new file mode 100644 index 00000000000..6394248fe81 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_source_attributes.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeySourceAttributes Attributes of a Cloud Cost Management tag source. +type CostTagKeySourceAttributes struct { + // The tag key name. + TagKey string `json:"tag_key"` + // Origins where this tag key was observed (for example, `aws-user-defined`). + TagSources []string `json:"tag_sources"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeySourceAttributes instantiates a new CostTagKeySourceAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeySourceAttributes(tagKey string, tagSources []string) *CostTagKeySourceAttributes { + this := CostTagKeySourceAttributes{} + this.TagKey = tagKey + this.TagSources = tagSources + return &this +} + +// NewCostTagKeySourceAttributesWithDefaults instantiates a new CostTagKeySourceAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeySourceAttributesWithDefaults() *CostTagKeySourceAttributes { + this := CostTagKeySourceAttributes{} + return &this +} + +// GetTagKey returns the TagKey field value. +func (o *CostTagKeySourceAttributes) GetTagKey() string { + if o == nil { + var ret string + return ret + } + return o.TagKey +} + +// GetTagKeyOk returns a tuple with the TagKey field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySourceAttributes) GetTagKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TagKey, true +} + +// SetTagKey sets field value. +func (o *CostTagKeySourceAttributes) SetTagKey(v string) { + o.TagKey = v +} + +// GetTagSources returns the TagSources field value. +func (o *CostTagKeySourceAttributes) GetTagSources() []string { + if o == nil { + var ret []string + return ret + } + return o.TagSources +} + +// GetTagSourcesOk returns a tuple with the TagSources field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySourceAttributes) GetTagSourcesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.TagSources, true +} + +// SetTagSources sets field value. +func (o *CostTagKeySourceAttributes) SetTagSources(v []string) { + o.TagSources = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeySourceAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["tag_key"] = o.TagKey + toSerialize["tag_sources"] = o.TagSources + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeySourceAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + TagKey *string `json:"tag_key"` + TagSources *[]string `json:"tag_sources"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.TagKey == nil { + return fmt.Errorf("required field tag_key missing") + } + if all.TagSources == nil { + return fmt.Errorf("required field tag_sources missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"tag_key", "tag_sources"}) + } else { + return err + } + o.TagKey = *all.TagKey + o.TagSources = *all.TagSources + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_key_source_type.go b/api/datadogV2/model_cost_tag_key_source_type.go new file mode 100644 index 00000000000..58a030df3d4 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_source_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeySourceType Type of the Cloud Cost Management tag source resource. +type CostTagKeySourceType string + +// List of CostTagKeySourceType. +const ( + COSTTAGKEYSOURCETYPE_COST_TAG_KEY_SOURCE CostTagKeySourceType = "cost_tag_key_source" +) + +var allowedCostTagKeySourceTypeEnumValues = []CostTagKeySourceType{ + COSTTAGKEYSOURCETYPE_COST_TAG_KEY_SOURCE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostTagKeySourceType) GetAllowedValues() []CostTagKeySourceType { + return allowedCostTagKeySourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostTagKeySourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostTagKeySourceType(value) + return nil +} + +// NewCostTagKeySourceTypeFromValue returns a pointer to a valid CostTagKeySourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostTagKeySourceTypeFromValue(v string) (*CostTagKeySourceType, error) { + ev := CostTagKeySourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostTagKeySourceType: valid values are %v", v, allowedCostTagKeySourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostTagKeySourceType) IsValid() bool { + for _, existing := range allowedCostTagKeySourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostTagKeySourceType value. +func (v CostTagKeySourceType) Ptr() *CostTagKeySourceType { + return &v +} diff --git a/api/datadogV2/model_cost_tag_key_sources_response.go b/api/datadogV2/model_cost_tag_key_sources_response.go new file mode 100644 index 00000000000..1431824a271 --- /dev/null +++ b/api/datadogV2/model_cost_tag_key_sources_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagKeySourcesResponse List of Cloud Cost Management tag keys with their origin sources for the requested period. +type CostTagKeySourcesResponse struct { + // List of tag keys with their origin sources. + Data []CostTagKeySource `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCostTagKeySourcesResponse instantiates a new CostTagKeySourcesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCostTagKeySourcesResponse(data []CostTagKeySource) *CostTagKeySourcesResponse { + this := CostTagKeySourcesResponse{} + this.Data = data + return &this +} + +// NewCostTagKeySourcesResponseWithDefaults instantiates a new CostTagKeySourcesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCostTagKeySourcesResponseWithDefaults() *CostTagKeySourcesResponse { + this := CostTagKeySourcesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CostTagKeySourcesResponse) GetData() []CostTagKeySource { + if o == nil { + var ret []CostTagKeySource + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CostTagKeySourcesResponse) GetDataOk() (*[]CostTagKeySource, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CostTagKeySourcesResponse) SetData(v []CostTagKeySource) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CostTagKeySourcesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CostTagKeySourcesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]CostTagKeySource `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_cost_tag_metadata_daily_filter.go b/api/datadogV2/model_cost_tag_metadata_daily_filter.go new file mode 100644 index 00000000000..2af35257aa1 --- /dev/null +++ b/api/datadogV2/model_cost_tag_metadata_daily_filter.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CostTagMetadataDailyFilter Granularity for tag metadata results. `true` returns one row per day, `false` (or omitted) returns the monthly roll-up. +type CostTagMetadataDailyFilter string + +// List of CostTagMetadataDailyFilter. +const ( + COSTTAGMETADATADAILYFILTER_TRUE CostTagMetadataDailyFilter = "true" + COSTTAGMETADATADAILYFILTER_FALSE CostTagMetadataDailyFilter = "false" +) + +var allowedCostTagMetadataDailyFilterEnumValues = []CostTagMetadataDailyFilter{ + COSTTAGMETADATADAILYFILTER_TRUE, + COSTTAGMETADATADAILYFILTER_FALSE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CostTagMetadataDailyFilter) GetAllowedValues() []CostTagMetadataDailyFilter { + return allowedCostTagMetadataDailyFilterEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CostTagMetadataDailyFilter) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CostTagMetadataDailyFilter(value) + return nil +} + +// NewCostTagMetadataDailyFilterFromValue returns a pointer to a valid CostTagMetadataDailyFilter +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCostTagMetadataDailyFilterFromValue(v string) (*CostTagMetadataDailyFilter, error) { + ev := CostTagMetadataDailyFilter(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CostTagMetadataDailyFilter: valid values are %v", v, allowedCostTagMetadataDailyFilterEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CostTagMetadataDailyFilter) IsValid() bool { + for _, existing := range allowedCostTagMetadataDailyFilterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CostTagMetadataDailyFilter value. +func (v CostTagMetadataDailyFilter) Ptr() *CostTagMetadataDailyFilter { + return &v +} diff --git a/api/datadogV2/model_create_degradation_request_data_attributes.go b/api/datadogV2/model_create_degradation_request_data_attributes.go index f1aaa9c412d..86c9430c531 100644 --- a/api/datadogV2/model_create_degradation_request_data_attributes.go +++ b/api/datadogV2/model_create_degradation_request_data_attributes.go @@ -20,8 +20,6 @@ type CreateDegradationRequestDataAttributes struct { Status CreateDegradationRequestDataAttributesStatus `json:"status"` // The title of the degradation. Title string `json:"title"` - // - Updates []CreateDegradationRequestDataAttributesUpdatesItems `json:"updates,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -144,34 +142,6 @@ func (o *CreateDegradationRequestDataAttributes) SetTitle(v string) { o.Title = v } -// GetUpdates returns the Updates field value if set, zero value otherwise. -func (o *CreateDegradationRequestDataAttributes) GetUpdates() []CreateDegradationRequestDataAttributesUpdatesItems { - if o == nil || o.Updates == nil { - var ret []CreateDegradationRequestDataAttributesUpdatesItems - return ret - } - return o.Updates -} - -// GetUpdatesOk returns a tuple with the Updates field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributes) GetUpdatesOk() (*[]CreateDegradationRequestDataAttributesUpdatesItems, bool) { - if o == nil || o.Updates == nil { - return nil, false - } - return &o.Updates, true -} - -// HasUpdates returns a boolean if a field has been set. -func (o *CreateDegradationRequestDataAttributes) HasUpdates() bool { - return o != nil && o.Updates != nil -} - -// SetUpdates gets a reference to the given []CreateDegradationRequestDataAttributesUpdatesItems and assigns it to the Updates field. -func (o *CreateDegradationRequestDataAttributes) SetUpdates(v []CreateDegradationRequestDataAttributesUpdatesItems) { - o.Updates = v -} - // MarshalJSON serializes the struct using spec logic. func (o CreateDegradationRequestDataAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -184,9 +154,6 @@ func (o CreateDegradationRequestDataAttributes) MarshalJSON() ([]byte, error) { } toSerialize["status"] = o.Status toSerialize["title"] = o.Title - if o.Updates != nil { - toSerialize["updates"] = o.Updates - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -201,7 +168,6 @@ func (o *CreateDegradationRequestDataAttributes) UnmarshalJSON(bytes []byte) (er Description *string `json:"description,omitempty"` Status *CreateDegradationRequestDataAttributesStatus `json:"status"` Title *string `json:"title"` - Updates []CreateDegradationRequestDataAttributesUpdatesItems `json:"updates,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -217,7 +183,7 @@ func (o *CreateDegradationRequestDataAttributes) UnmarshalJSON(bytes []byte) (er } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "description", "status", "title", "updates"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "description", "status", "title"}) } else { return err } @@ -231,7 +197,6 @@ func (o *CreateDegradationRequestDataAttributes) UnmarshalJSON(bytes []byte) (er o.Status = *all.Status } o.Title = *all.Title - o.Updates = all.Updates if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_create_degradation_request_data_attributes_updates_items.go b/api/datadogV2/model_create_degradation_request_data_attributes_updates_items.go deleted file mode 100644 index 8b4fe54a982..00000000000 --- a/api/datadogV2/model_create_degradation_request_data_attributes_updates_items.go +++ /dev/null @@ -1,212 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - "time" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateDegradationRequestDataAttributesUpdatesItems A degradation update entry. -type CreateDegradationRequestDataAttributesUpdatesItems struct { - // The components affected. - ComponentsAffected []CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected"` - // A description of the update. - Description string `json:"description"` - // Timestamp of when the update occurred. - StartedAt time.Time `json:"started_at"` - // The status of the degradation. - Status CreateDegradationRequestDataAttributesStatus `json:"status"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewCreateDegradationRequestDataAttributesUpdatesItems instantiates a new CreateDegradationRequestDataAttributesUpdatesItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewCreateDegradationRequestDataAttributesUpdatesItems(componentsAffected []CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, description string, startedAt time.Time, status CreateDegradationRequestDataAttributesStatus) *CreateDegradationRequestDataAttributesUpdatesItems { - this := CreateDegradationRequestDataAttributesUpdatesItems{} - this.ComponentsAffected = componentsAffected - this.Description = description - this.StartedAt = startedAt - this.Status = status - return &this -} - -// NewCreateDegradationRequestDataAttributesUpdatesItemsWithDefaults instantiates a new CreateDegradationRequestDataAttributesUpdatesItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewCreateDegradationRequestDataAttributesUpdatesItemsWithDefaults() *CreateDegradationRequestDataAttributesUpdatesItems { - this := CreateDegradationRequestDataAttributesUpdatesItems{} - return &this -} - -// GetComponentsAffected returns the ComponentsAffected field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetComponentsAffected() []CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems { - if o == nil { - var ret []CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems - return ret - } - return o.ComponentsAffected -} - -// GetComponentsAffectedOk returns a tuple with the ComponentsAffected field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetComponentsAffectedOk() (*[]CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems, bool) { - if o == nil { - return nil, false - } - return &o.ComponentsAffected, true -} - -// SetComponentsAffected sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) SetComponentsAffected(v []CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) { - o.ComponentsAffected = v -} - -// GetDescription returns the Description field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetDescription() string { - if o == nil { - var ret string - return ret - } - return o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) SetDescription(v string) { - o.Description = v -} - -// GetStartedAt returns the StartedAt field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetStatus returns the Status field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetStatus() CreateDegradationRequestDataAttributesStatus { - if o == nil { - var ret CreateDegradationRequestDataAttributesStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) GetStatusOk() (*CreateDegradationRequestDataAttributesStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) SetStatus(v CreateDegradationRequestDataAttributesStatus) { - o.Status = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o CreateDegradationRequestDataAttributesUpdatesItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["components_affected"] = o.ComponentsAffected - toSerialize["description"] = o.Description - if o.StartedAt.Nanosecond() == 0 { - toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05.000Z07:00") - } - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *CreateDegradationRequestDataAttributesUpdatesItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - ComponentsAffected *[]CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected"` - Description *string `json:"description"` - StartedAt *time.Time `json:"started_at"` - Status *CreateDegradationRequestDataAttributesStatus `json:"status"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.ComponentsAffected == nil { - return fmt.Errorf("required field components_affected missing") - } - if all.Description == nil { - return fmt.Errorf("required field description missing") - } - if all.StartedAt == nil { - return fmt.Errorf("required field started_at missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "description", "started_at", "status"}) - } else { - return err - } - - hasInvalidField := false - o.ComponentsAffected = *all.ComponentsAffected - o.Description = *all.Description - o.StartedAt = *all.StartedAt - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_create_degradation_request_data_attributes_updates_items_components_affected_items.go b/api/datadogV2/model_create_degradation_request_data_attributes_updates_items_components_affected_items.go deleted file mode 100644 index c6a505458ac..00000000000 --- a/api/datadogV2/model_create_degradation_request_data_attributes_updates_items_components_affected_items.go +++ /dev/null @@ -1,178 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems A component affected by a degradation update. -type CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems struct { - // The ID of the component. Must be a component of type `component`. - Id string `json:"id"` - // The name of the component. - Name *string `json:"name,omitempty"` - // The status of the component. - Status StatusPagesComponentDataAttributesStatus `json:"status"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewCreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems instantiates a new CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewCreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems(id string, status StatusPagesComponentDataAttributesStatus) *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems { - this := CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems{} - this.Id = id - this.Status = status - return &this -} - -// NewCreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItemsWithDefaults instantiates a new CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewCreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItemsWithDefaults() *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems { - this := CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems{} - return &this -} - -// GetId returns the Id field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetId() string { - if o == nil { - var ret string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetName(v string) { - o.Name = &v -} - -// GetStatus returns the Status field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetStatus() StatusPagesComponentDataAttributesStatus { - if o == nil { - var ret StatusPagesComponentDataAttributesStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetStatusOk() (*StatusPagesComponentDataAttributesStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetStatus(v StatusPagesComponentDataAttributesStatus) { - o.Status = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["id"] = o.Id - if o.Name != nil { - toSerialize["name"] = o.Name - } - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Id *string `json:"id"` - Name *string `json:"name,omitempty"` - Status *StatusPagesComponentDataAttributesStatus `json:"status"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "status"}) - } else { - return err - } - - hasInvalidField := false - o.Id = *all.Id - o.Name = all.Name - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_create_maintenance_request_data_attributes.go b/api/datadogV2/model_create_maintenance_request_data_attributes.go index b93385fbfec..0b8080da994 100644 --- a/api/datadogV2/model_create_maintenance_request_data_attributes.go +++ b/api/datadogV2/model_create_maintenance_request_data_attributes.go @@ -27,8 +27,6 @@ type CreateMaintenanceRequestDataAttributes struct { StartDate time.Time `json:"start_date"` // The title of the maintenance. Title string `json:"title"` - // - Updates []CreateMaintenanceRequestDataAttributesUpdatesItems `json:"updates,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -219,34 +217,6 @@ func (o *CreateMaintenanceRequestDataAttributes) SetTitle(v string) { o.Title = v } -// GetUpdates returns the Updates field value if set, zero value otherwise. -func (o *CreateMaintenanceRequestDataAttributes) GetUpdates() []CreateMaintenanceRequestDataAttributesUpdatesItems { - if o == nil || o.Updates == nil { - var ret []CreateMaintenanceRequestDataAttributesUpdatesItems - return ret - } - return o.Updates -} - -// GetUpdatesOk returns a tuple with the Updates field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributes) GetUpdatesOk() (*[]CreateMaintenanceRequestDataAttributesUpdatesItems, bool) { - if o == nil || o.Updates == nil { - return nil, false - } - return &o.Updates, true -} - -// HasUpdates returns a boolean if a field has been set. -func (o *CreateMaintenanceRequestDataAttributes) HasUpdates() bool { - return o != nil && o.Updates != nil -} - -// SetUpdates gets a reference to the given []CreateMaintenanceRequestDataAttributesUpdatesItems and assigns it to the Updates field. -func (o *CreateMaintenanceRequestDataAttributes) SetUpdates(v []CreateMaintenanceRequestDataAttributesUpdatesItems) { - o.Updates = v -} - // MarshalJSON serializes the struct using spec logic. func (o CreateMaintenanceRequestDataAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -268,9 +238,6 @@ func (o CreateMaintenanceRequestDataAttributes) MarshalJSON() ([]byte, error) { toSerialize["start_date"] = o.StartDate.Format("2006-01-02T15:04:05.000Z07:00") } toSerialize["title"] = o.Title - if o.Updates != nil { - toSerialize["updates"] = o.Updates - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -288,7 +255,6 @@ func (o *CreateMaintenanceRequestDataAttributes) UnmarshalJSON(bytes []byte) (er ScheduledDescription *string `json:"scheduled_description"` StartDate *time.Time `json:"start_date"` Title *string `json:"title"` - Updates []CreateMaintenanceRequestDataAttributesUpdatesItems `json:"updates,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -316,7 +282,7 @@ func (o *CreateMaintenanceRequestDataAttributes) UnmarshalJSON(bytes []byte) (er } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"completed_date", "completed_description", "components_affected", "in_progress_description", "scheduled_description", "start_date", "title", "updates"}) + datadog.DeleteKeys(additionalProperties, &[]string{"completed_date", "completed_description", "components_affected", "in_progress_description", "scheduled_description", "start_date", "title"}) } else { return err } @@ -327,7 +293,6 @@ func (o *CreateMaintenanceRequestDataAttributes) UnmarshalJSON(bytes []byte) (er o.ScheduledDescription = *all.ScheduledDescription o.StartDate = *all.StartDate o.Title = *all.Title - o.Updates = all.Updates if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items.go b/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items.go deleted file mode 100644 index 3bac7c8b151..00000000000 --- a/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items.go +++ /dev/null @@ -1,212 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - "time" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateMaintenanceRequestDataAttributesUpdatesItems A maintenance update entry. -type CreateMaintenanceRequestDataAttributesUpdatesItems struct { - // The components affected. - ComponentsAffected []CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected"` - // A description of the update. - Description string `json:"description"` - // Timestamp of when the update occurred. - StartedAt time.Time `json:"started_at"` - // The status of a maintenance update. - Status CreateMaintenanceRequestDataAttributesUpdatesItemsStatus `json:"status"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewCreateMaintenanceRequestDataAttributesUpdatesItems instantiates a new CreateMaintenanceRequestDataAttributesUpdatesItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewCreateMaintenanceRequestDataAttributesUpdatesItems(componentsAffected []CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, description string, startedAt time.Time, status CreateMaintenanceRequestDataAttributesUpdatesItemsStatus) *CreateMaintenanceRequestDataAttributesUpdatesItems { - this := CreateMaintenanceRequestDataAttributesUpdatesItems{} - this.ComponentsAffected = componentsAffected - this.Description = description - this.StartedAt = startedAt - this.Status = status - return &this -} - -// NewCreateMaintenanceRequestDataAttributesUpdatesItemsWithDefaults instantiates a new CreateMaintenanceRequestDataAttributesUpdatesItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewCreateMaintenanceRequestDataAttributesUpdatesItemsWithDefaults() *CreateMaintenanceRequestDataAttributesUpdatesItems { - this := CreateMaintenanceRequestDataAttributesUpdatesItems{} - return &this -} - -// GetComponentsAffected returns the ComponentsAffected field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetComponentsAffected() []CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems { - if o == nil { - var ret []CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems - return ret - } - return o.ComponentsAffected -} - -// GetComponentsAffectedOk returns a tuple with the ComponentsAffected field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetComponentsAffectedOk() (*[]CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems, bool) { - if o == nil { - return nil, false - } - return &o.ComponentsAffected, true -} - -// SetComponentsAffected sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) SetComponentsAffected(v []CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) { - o.ComponentsAffected = v -} - -// GetDescription returns the Description field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetDescription() string { - if o == nil { - var ret string - return ret - } - return o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) SetDescription(v string) { - o.Description = v -} - -// GetStartedAt returns the StartedAt field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetStatus returns the Status field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetStatus() CreateMaintenanceRequestDataAttributesUpdatesItemsStatus { - if o == nil { - var ret CreateMaintenanceRequestDataAttributesUpdatesItemsStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) GetStatusOk() (*CreateMaintenanceRequestDataAttributesUpdatesItemsStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) SetStatus(v CreateMaintenanceRequestDataAttributesUpdatesItemsStatus) { - o.Status = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o CreateMaintenanceRequestDataAttributesUpdatesItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["components_affected"] = o.ComponentsAffected - toSerialize["description"] = o.Description - if o.StartedAt.Nanosecond() == 0 { - toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05.000Z07:00") - } - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - ComponentsAffected *[]CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected"` - Description *string `json:"description"` - StartedAt *time.Time `json:"started_at"` - Status *CreateMaintenanceRequestDataAttributesUpdatesItemsStatus `json:"status"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.ComponentsAffected == nil { - return fmt.Errorf("required field components_affected missing") - } - if all.Description == nil { - return fmt.Errorf("required field description missing") - } - if all.StartedAt == nil { - return fmt.Errorf("required field started_at missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "description", "started_at", "status"}) - } else { - return err - } - - hasInvalidField := false - o.ComponentsAffected = *all.ComponentsAffected - o.Description = *all.Description - o.StartedAt = *all.StartedAt - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items_components_affected_items.go b/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items_components_affected_items.go deleted file mode 100644 index b4cabd1a5ae..00000000000 --- a/api/datadogV2/model_create_maintenance_request_data_attributes_updates_items_components_affected_items.go +++ /dev/null @@ -1,178 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems A component affected by a maintenance update. -type CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems struct { - // The ID of the component. Must be a component of type `component`. - Id string `json:"id"` - // The name of the component. - Name *string `json:"name,omitempty"` - // The status of the component. - Status PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus `json:"status"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewCreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems instantiates a new CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewCreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems(id string, status PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus) *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems { - this := CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems{} - this.Id = id - this.Status = status - return &this -} - -// NewCreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItemsWithDefaults instantiates a new CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewCreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItemsWithDefaults() *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems { - this := CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems{} - return &this -} - -// GetId returns the Id field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetId() string { - if o == nil { - var ret string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetName(v string) { - o.Name = &v -} - -// GetStatus returns the Status field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetStatus() PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus { - if o == nil { - var ret PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) GetStatusOk() (*PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) SetStatus(v PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus) { - o.Status = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["id"] = o.Id - if o.Name != nil { - toSerialize["name"] = o.Name - } - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Id *string `json:"id"` - Name *string `json:"name,omitempty"` - Status *PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus `json:"status"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "status"}) - } else { - return err - } - - hasInvalidField := false - o.Id = *all.Id - o.Name = all.Name - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_create_publish_request_request.go b/api/datadogV2/model_create_publish_request_request.go new file mode 100644 index 00000000000..c9960ec3b68 --- /dev/null +++ b/api/datadogV2/model_create_publish_request_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreatePublishRequestRequest A request to ask for approval to publish an app whose protection level is `approval_required`. +type CreatePublishRequestRequest struct { + // Data for creating a publish request. + Data *CreatePublishRequestRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreatePublishRequestRequest instantiates a new CreatePublishRequestRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreatePublishRequestRequest() *CreatePublishRequestRequest { + this := CreatePublishRequestRequest{} + return &this +} + +// NewCreatePublishRequestRequestWithDefaults instantiates a new CreatePublishRequestRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreatePublishRequestRequestWithDefaults() *CreatePublishRequestRequest { + this := CreatePublishRequestRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CreatePublishRequestRequest) GetData() CreatePublishRequestRequestData { + if o == nil || o.Data == nil { + var ret CreatePublishRequestRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublishRequestRequest) GetDataOk() (*CreatePublishRequestRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CreatePublishRequestRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CreatePublishRequestRequestData and assigns it to the Data field. +func (o *CreatePublishRequestRequest) SetData(v CreatePublishRequestRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreatePublishRequestRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreatePublishRequestRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CreatePublishRequestRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_publish_request_request_data.go b/api/datadogV2/model_create_publish_request_request_data.go new file mode 100644 index 00000000000..a275e5156b1 --- /dev/null +++ b/api/datadogV2/model_create_publish_request_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreatePublishRequestRequestData Data for creating a publish request. +type CreatePublishRequestRequestData struct { + // Attributes for creating a publish request. + Attributes *CreatePublishRequestRequestDataAttributes `json:"attributes,omitempty"` + // The publish-request resource type. + Type *PublishRequestType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreatePublishRequestRequestData instantiates a new CreatePublishRequestRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreatePublishRequestRequestData() *CreatePublishRequestRequestData { + this := CreatePublishRequestRequestData{} + var typeVar PublishRequestType = PUBLISHREQUESTTYPE_PUBLISHREQUEST + this.Type = &typeVar + return &this +} + +// NewCreatePublishRequestRequestDataWithDefaults instantiates a new CreatePublishRequestRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreatePublishRequestRequestDataWithDefaults() *CreatePublishRequestRequestData { + this := CreatePublishRequestRequestData{} + var typeVar PublishRequestType = PUBLISHREQUESTTYPE_PUBLISHREQUEST + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CreatePublishRequestRequestData) GetAttributes() CreatePublishRequestRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret CreatePublishRequestRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublishRequestRequestData) GetAttributesOk() (*CreatePublishRequestRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CreatePublishRequestRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CreatePublishRequestRequestDataAttributes and assigns it to the Attributes field. +func (o *CreatePublishRequestRequestData) SetAttributes(v CreatePublishRequestRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreatePublishRequestRequestData) GetType() PublishRequestType { + if o == nil || o.Type == nil { + var ret PublishRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublishRequestRequestData) GetTypeOk() (*PublishRequestType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreatePublishRequestRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given PublishRequestType and assigns it to the Type field. +func (o *CreatePublishRequestRequestData) SetType(v PublishRequestType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreatePublishRequestRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreatePublishRequestRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CreatePublishRequestRequestDataAttributes `json:"attributes,omitempty"` + Type *PublishRequestType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_publish_request_request_data_attributes.go b/api/datadogV2/model_create_publish_request_request_data_attributes.go new file mode 100644 index 00000000000..94eeba3af2d --- /dev/null +++ b/api/datadogV2/model_create_publish_request_request_data_attributes.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreatePublishRequestRequestDataAttributes Attributes for creating a publish request. +type CreatePublishRequestRequestDataAttributes struct { + // An optional description of the changes in this publish request. + Description *string `json:"description,omitempty"` + // A short title for the publish request. + Title string `json:"title"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreatePublishRequestRequestDataAttributes instantiates a new CreatePublishRequestRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreatePublishRequestRequestDataAttributes(title string) *CreatePublishRequestRequestDataAttributes { + this := CreatePublishRequestRequestDataAttributes{} + this.Title = title + return &this +} + +// NewCreatePublishRequestRequestDataAttributesWithDefaults instantiates a new CreatePublishRequestRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreatePublishRequestRequestDataAttributesWithDefaults() *CreatePublishRequestRequestDataAttributes { + this := CreatePublishRequestRequestDataAttributes{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreatePublishRequestRequestDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublishRequestRequestDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreatePublishRequestRequestDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreatePublishRequestRequestDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetTitle returns the Title field value. +func (o *CreatePublishRequestRequestDataAttributes) GetTitle() string { + if o == nil { + var ret string + return ret + } + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *CreatePublishRequestRequestDataAttributes) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value. +func (o *CreatePublishRequestRequestDataAttributes) SetTitle(v string) { + o.Title = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreatePublishRequestRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + toSerialize["title"] = o.Title + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreatePublishRequestRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Title *string `json:"title"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Title == nil { + return fmt.Errorf("required field title missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "title"}) + } else { + return err + } + o.Description = all.Description + o.Title = *all.Title + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_config.go b/api/datadogV2/model_custom_attribute_config.go index 15b1113b5a2..8419f6da536 100644 --- a/api/datadogV2/model_custom_attribute_config.go +++ b/api/datadogV2/model_custom_attribute_config.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfig The definition of `CustomAttributeConfig` object. +// CustomAttributeConfig A custom attribute configuration that defines an organization-specific metadata field on cases. Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined select options. type CustomAttributeConfig struct { - // Custom attribute resource attributes + // Attributes of a custom attribute configuration, defining an organization-specific metadata field that can be added to cases of a given type. Attributes *CustomAttributeConfigResourceAttributes `json:"attributes,omitempty"` // Custom attribute configs identifier Id *string `json:"id,omitempty"` - // Custom attributes config JSON:API resource type + // JSON:API resource type for custom attribute configurations. Type *CustomAttributeConfigResourceType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_attributes_create.go b/api/datadogV2/model_custom_attribute_config_attributes_create.go index 5b881809271..275036b82ff 100644 --- a/api/datadogV2/model_custom_attribute_config_attributes_create.go +++ b/api/datadogV2/model_custom_attribute_config_attributes_create.go @@ -10,17 +10,17 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigAttributesCreate Custom attribute config resource attributes +// CustomAttributeConfigAttributesCreate Attributes required to create a custom attribute configuration. type CustomAttributeConfigAttributesCreate struct { - // Custom attribute description. + // A description explaining the purpose and expected values for this custom attribute. Description *string `json:"description,omitempty"` - // Custom attribute name. + // The human-readable label shown in the Case Management UI for this custom attribute. DisplayName string `json:"display_name"` - // Whether multiple values can be set + // If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed. IsMulti bool `json:"is_multi"` - // Custom attribute key. This will be the value use to search on this custom attribute + // The programmatic key used to reference this custom attribute in search queries and API calls. Key string `json:"key"` - // Custom attributes type + // The data type of the custom attribute, which determines the allowed values and UI input control. Type CustomAttributeType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_create.go b/api/datadogV2/model_custom_attribute_config_create.go index 9dceed6dc42..e3802d31e7a 100644 --- a/api/datadogV2/model_custom_attribute_config_create.go +++ b/api/datadogV2/model_custom_attribute_config_create.go @@ -10,11 +10,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigCreate Custom attribute config +// CustomAttributeConfigCreate Data object for creating a custom attribute configuration. type CustomAttributeConfigCreate struct { - // Custom attribute config resource attributes + // Attributes required to create a custom attribute configuration. Attributes CustomAttributeConfigAttributesCreate `json:"attributes"` - // Custom attributes config JSON:API resource type + // JSON:API resource type for custom attribute configurations. Type CustomAttributeConfigResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_create_request.go b/api/datadogV2/model_custom_attribute_config_create_request.go index 3bfe9d228e4..5f4a430b128 100644 --- a/api/datadogV2/model_custom_attribute_config_create_request.go +++ b/api/datadogV2/model_custom_attribute_config_create_request.go @@ -10,9 +10,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigCreateRequest Custom attribute config create request +// CustomAttributeConfigCreateRequest Request payload for creating a custom attribute configuration. type CustomAttributeConfigCreateRequest struct { - // Custom attribute config + // Data object for creating a custom attribute configuration. Data CustomAttributeConfigCreate `json:"data"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_resource_attributes.go b/api/datadogV2/model_custom_attribute_config_resource_attributes.go index 541174b6449..e0aca684ba7 100644 --- a/api/datadogV2/model_custom_attribute_config_resource_attributes.go +++ b/api/datadogV2/model_custom_attribute_config_resource_attributes.go @@ -10,19 +10,19 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigResourceAttributes Custom attribute resource attributes +// CustomAttributeConfigResourceAttributes Attributes of a custom attribute configuration, defining an organization-specific metadata field that can be added to cases of a given type. type CustomAttributeConfigResourceAttributes struct { - // Custom attribute config identifier. + // The UUID of the case type this custom attribute belongs to. CaseTypeId string `json:"case_type_id"` - // Custom attribute description. + // A description explaining the purpose and expected values for this custom attribute. Description *string `json:"description,omitempty"` - // Custom attribute name. + // The human-readable label shown in the Case Management UI for this custom attribute. DisplayName string `json:"display_name"` - // Whether multiple values can be set + // If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed. IsMulti bool `json:"is_multi"` - // Custom attribute key. This will be the value use to search on this custom attribute + // The programmatic key used to reference this custom attribute in search queries and API calls. Key string `json:"key"` - // Custom attributes type + // The data type of the custom attribute, which determines the allowed values and UI input control. Type CustomAttributeType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_resource_type.go b/api/datadogV2/model_custom_attribute_config_resource_type.go index f64f9707564..d1189c0bc02 100644 --- a/api/datadogV2/model_custom_attribute_config_resource_type.go +++ b/api/datadogV2/model_custom_attribute_config_resource_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigResourceType Custom attributes config JSON:API resource type +// CustomAttributeConfigResourceType JSON:API resource type for custom attribute configurations. type CustomAttributeConfigResourceType string // List of CustomAttributeConfigResourceType. diff --git a/api/datadogV2/model_custom_attribute_config_response.go b/api/datadogV2/model_custom_attribute_config_response.go index e43c77fe3a3..966efe9eb55 100644 --- a/api/datadogV2/model_custom_attribute_config_response.go +++ b/api/datadogV2/model_custom_attribute_config_response.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigResponse Custom attribute config response. +// CustomAttributeConfigResponse Response containing a single custom attribute configuration. type CustomAttributeConfigResponse struct { - // The definition of `CustomAttributeConfig` object. + // A custom attribute configuration that defines an organization-specific metadata field on cases. Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined select options. Data *CustomAttributeConfig `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_config_update.go b/api/datadogV2/model_custom_attribute_config_update.go new file mode 100644 index 00000000000..caafd9e16e0 --- /dev/null +++ b/api/datadogV2/model_custom_attribute_config_update.go @@ -0,0 +1,151 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomAttributeConfigUpdate Data object for updating a custom attribute configuration. +type CustomAttributeConfigUpdate struct { + // Attributes that can be updated on a custom attribute configuration. All fields are optional; only provided fields are changed. + Attributes *CustomAttributeConfigUpdateAttributes `json:"attributes,omitempty"` + // JSON:API resource type for custom attribute configurations. + Type CustomAttributeConfigResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomAttributeConfigUpdate instantiates a new CustomAttributeConfigUpdate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomAttributeConfigUpdate(typeVar CustomAttributeConfigResourceType) *CustomAttributeConfigUpdate { + this := CustomAttributeConfigUpdate{} + this.Type = typeVar + return &this +} + +// NewCustomAttributeConfigUpdateWithDefaults instantiates a new CustomAttributeConfigUpdate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomAttributeConfigUpdateWithDefaults() *CustomAttributeConfigUpdate { + this := CustomAttributeConfigUpdate{} + var typeVar CustomAttributeConfigResourceType = CUSTOMATTRIBUTECONFIGRESOURCETYPE_CUSTOM_ATTRIBUTE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdate) GetAttributes() CustomAttributeConfigUpdateAttributes { + if o == nil || o.Attributes == nil { + var ret CustomAttributeConfigUpdateAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdate) GetAttributesOk() (*CustomAttributeConfigUpdateAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdate) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CustomAttributeConfigUpdateAttributes and assigns it to the Attributes field. +func (o *CustomAttributeConfigUpdate) SetAttributes(v CustomAttributeConfigUpdateAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value. +func (o *CustomAttributeConfigUpdate) GetType() CustomAttributeConfigResourceType { + if o == nil { + var ret CustomAttributeConfigResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdate) GetTypeOk() (*CustomAttributeConfigResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CustomAttributeConfigUpdate) SetType(v CustomAttributeConfigResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomAttributeConfigUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomAttributeConfigUpdate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomAttributeConfigUpdateAttributes `json:"attributes,omitempty"` + Type *CustomAttributeConfigResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_config_update_attributes.go b/api/datadogV2/model_custom_attribute_config_update_attributes.go new file mode 100644 index 00000000000..906a6d5cac8 --- /dev/null +++ b/api/datadogV2/model_custom_attribute_config_update_attributes.go @@ -0,0 +1,255 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomAttributeConfigUpdateAttributes Attributes that can be updated on a custom attribute configuration. All fields are optional; only provided fields are changed. +type CustomAttributeConfigUpdateAttributes struct { + // A description explaining the purpose and expected values for this custom attribute. + Description *string `json:"description,omitempty"` + // The human-readable label shown in the Case Management UI for this custom attribute. + DisplayName *string `json:"display_name,omitempty"` + // An external field identifier to auto-populate this attribute from (used for integrations with external systems). + MapFrom *string `json:"map_from,omitempty"` + // The data type of the custom attribute, which determines the allowed values and UI input control. + Type *CustomAttributeType `json:"type,omitempty"` + // Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains the list of allowed options. + TypeData *CustomAttributeTypeData `json:"type_data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomAttributeConfigUpdateAttributes instantiates a new CustomAttributeConfigUpdateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomAttributeConfigUpdateAttributes() *CustomAttributeConfigUpdateAttributes { + this := CustomAttributeConfigUpdateAttributes{} + return &this +} + +// NewCustomAttributeConfigUpdateAttributesWithDefaults instantiates a new CustomAttributeConfigUpdateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomAttributeConfigUpdateAttributesWithDefaults() *CustomAttributeConfigUpdateAttributes { + this := CustomAttributeConfigUpdateAttributes{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdateAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdateAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomAttributeConfigUpdateAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdateAttributes) GetDisplayName() string { + if o == nil || o.DisplayName == nil { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateAttributes) GetDisplayNameOk() (*string, bool) { + if o == nil || o.DisplayName == nil { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdateAttributes) HasDisplayName() bool { + return o != nil && o.DisplayName != nil +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *CustomAttributeConfigUpdateAttributes) SetDisplayName(v string) { + o.DisplayName = &v +} + +// GetMapFrom returns the MapFrom field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdateAttributes) GetMapFrom() string { + if o == nil || o.MapFrom == nil { + var ret string + return ret + } + return *o.MapFrom +} + +// GetMapFromOk returns a tuple with the MapFrom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateAttributes) GetMapFromOk() (*string, bool) { + if o == nil || o.MapFrom == nil { + return nil, false + } + return o.MapFrom, true +} + +// HasMapFrom returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdateAttributes) HasMapFrom() bool { + return o != nil && o.MapFrom != nil +} + +// SetMapFrom gets a reference to the given string and assigns it to the MapFrom field. +func (o *CustomAttributeConfigUpdateAttributes) SetMapFrom(v string) { + o.MapFrom = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdateAttributes) GetType() CustomAttributeType { + if o == nil || o.Type == nil { + var ret CustomAttributeType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateAttributes) GetTypeOk() (*CustomAttributeType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdateAttributes) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CustomAttributeType and assigns it to the Type field. +func (o *CustomAttributeConfigUpdateAttributes) SetType(v CustomAttributeType) { + o.Type = &v +} + +// GetTypeData returns the TypeData field value if set, zero value otherwise. +func (o *CustomAttributeConfigUpdateAttributes) GetTypeData() CustomAttributeTypeData { + if o == nil || o.TypeData == nil { + var ret CustomAttributeTypeData + return ret + } + return *o.TypeData +} + +// GetTypeDataOk returns a tuple with the TypeData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateAttributes) GetTypeDataOk() (*CustomAttributeTypeData, bool) { + if o == nil || o.TypeData == nil { + return nil, false + } + return o.TypeData, true +} + +// HasTypeData returns a boolean if a field has been set. +func (o *CustomAttributeConfigUpdateAttributes) HasTypeData() bool { + return o != nil && o.TypeData != nil +} + +// SetTypeData gets a reference to the given CustomAttributeTypeData and assigns it to the TypeData field. +func (o *CustomAttributeConfigUpdateAttributes) SetTypeData(v CustomAttributeTypeData) { + o.TypeData = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomAttributeConfigUpdateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.DisplayName != nil { + toSerialize["display_name"] = o.DisplayName + } + if o.MapFrom != nil { + toSerialize["map_from"] = o.MapFrom + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.TypeData != nil { + toSerialize["type_data"] = o.TypeData + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomAttributeConfigUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + DisplayName *string `json:"display_name,omitempty"` + MapFrom *string `json:"map_from,omitempty"` + Type *CustomAttributeType `json:"type,omitempty"` + TypeData *CustomAttributeTypeData `json:"type_data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "display_name", "map_from", "type", "type_data"}) + } else { + return err + } + + hasInvalidField := false + o.Description = all.Description + o.DisplayName = all.DisplayName + o.MapFrom = all.MapFrom + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + if all.TypeData != nil && all.TypeData.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.TypeData = all.TypeData + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_config_update_request.go b/api/datadogV2/model_custom_attribute_config_update_request.go new file mode 100644 index 00000000000..c6ace246d63 --- /dev/null +++ b/api/datadogV2/model_custom_attribute_config_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomAttributeConfigUpdateRequest Request payload for updating a custom attribute configuration. +type CustomAttributeConfigUpdateRequest struct { + // Data object for updating a custom attribute configuration. + Data CustomAttributeConfigUpdate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomAttributeConfigUpdateRequest instantiates a new CustomAttributeConfigUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomAttributeConfigUpdateRequest(data CustomAttributeConfigUpdate) *CustomAttributeConfigUpdateRequest { + this := CustomAttributeConfigUpdateRequest{} + this.Data = data + return &this +} + +// NewCustomAttributeConfigUpdateRequestWithDefaults instantiates a new CustomAttributeConfigUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomAttributeConfigUpdateRequestWithDefaults() *CustomAttributeConfigUpdateRequest { + this := CustomAttributeConfigUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *CustomAttributeConfigUpdateRequest) GetData() CustomAttributeConfigUpdate { + if o == nil { + var ret CustomAttributeConfigUpdate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CustomAttributeConfigUpdateRequest) GetDataOk() (*CustomAttributeConfigUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CustomAttributeConfigUpdateRequest) SetData(v CustomAttributeConfigUpdate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomAttributeConfigUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomAttributeConfigUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomAttributeConfigUpdate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_configs_response.go b/api/datadogV2/model_custom_attribute_configs_response.go index 254b382d6bf..e82b798a880 100644 --- a/api/datadogV2/model_custom_attribute_configs_response.go +++ b/api/datadogV2/model_custom_attribute_configs_response.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeConfigsResponse Custom attribute configs response. +// CustomAttributeConfigsResponse Response containing a list of custom attribute configurations. type CustomAttributeConfigsResponse struct { // List of custom attribute configs of case type Data []CustomAttributeConfig `json:"data,omitempty"` diff --git a/api/datadogV2/model_custom_attribute_select_option.go b/api/datadogV2/model_custom_attribute_select_option.go new file mode 100644 index 00000000000..8d2472fcf4a --- /dev/null +++ b/api/datadogV2/model_custom_attribute_select_option.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomAttributeSelectOption A selectable option for a SELECT-type custom attribute. +type CustomAttributeSelectOption struct { + // Option value. + Value string `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomAttributeSelectOption instantiates a new CustomAttributeSelectOption object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomAttributeSelectOption(value string) *CustomAttributeSelectOption { + this := CustomAttributeSelectOption{} + this.Value = value + return &this +} + +// NewCustomAttributeSelectOptionWithDefaults instantiates a new CustomAttributeSelectOption object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomAttributeSelectOptionWithDefaults() *CustomAttributeSelectOption { + this := CustomAttributeSelectOption{} + return &this +} + +// GetValue returns the Value field value. +func (o *CustomAttributeSelectOption) GetValue() string { + if o == nil { + var ret string + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CustomAttributeSelectOption) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *CustomAttributeSelectOption) SetValue(v string) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomAttributeSelectOption) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomAttributeSelectOption) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Value *string `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"value"}) + } else { + return err + } + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_type.go b/api/datadogV2/model_custom_attribute_type.go index 20f6ce41eb7..fa9e07f189d 100644 --- a/api/datadogV2/model_custom_attribute_type.go +++ b/api/datadogV2/model_custom_attribute_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeType Custom attributes type +// CustomAttributeType The data type of the custom attribute, which determines the allowed values and UI input control. type CustomAttributeType string // List of CustomAttributeType. diff --git a/api/datadogV2/model_custom_attribute_type_data.go b/api/datadogV2/model_custom_attribute_type_data.go new file mode 100644 index 00000000000..37d1277cfbd --- /dev/null +++ b/api/datadogV2/model_custom_attribute_type_data.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomAttributeTypeData Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains the list of allowed options. +type CustomAttributeTypeData struct { + // Options for SELECT type custom attributes. + Options []CustomAttributeSelectOption `json:"options,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomAttributeTypeData instantiates a new CustomAttributeTypeData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomAttributeTypeData() *CustomAttributeTypeData { + this := CustomAttributeTypeData{} + return &this +} + +// NewCustomAttributeTypeDataWithDefaults instantiates a new CustomAttributeTypeData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomAttributeTypeDataWithDefaults() *CustomAttributeTypeData { + this := CustomAttributeTypeData{} + return &this +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CustomAttributeTypeData) GetOptions() []CustomAttributeSelectOption { + if o == nil || o.Options == nil { + var ret []CustomAttributeSelectOption + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomAttributeTypeData) GetOptionsOk() (*[]CustomAttributeSelectOption, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return &o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CustomAttributeTypeData) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given []CustomAttributeSelectOption and assigns it to the Options field. +func (o *CustomAttributeTypeData) SetOptions(v []CustomAttributeSelectOption) { + o.Options = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomAttributeTypeData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomAttributeTypeData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Options []CustomAttributeSelectOption `json:"options,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"options"}) + } else { + return err + } + o.Options = all.Options + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_attribute_value.go b/api/datadogV2/model_custom_attribute_value.go index 25c417224ca..f3cf7ea0a96 100644 --- a/api/datadogV2/model_custom_attribute_value.go +++ b/api/datadogV2/model_custom_attribute_value.go @@ -10,13 +10,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeValue Custom attribute values +// CustomAttributeValue A typed value for a custom attribute on a specific case. type CustomAttributeValue struct { // If true, value must be an array IsMulti bool `json:"is_multi"` - // Custom attributes type + // The data type of the custom attribute, which determines the allowed values and UI input control. Type CustomAttributeType `json:"type"` - // Union of supported value for a custom attribute + // The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values. Value CustomAttributeValuesUnion `json:"value"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_attribute_values_union.go b/api/datadogV2/model_custom_attribute_values_union.go index c804042387a..85e23d782cf 100644 --- a/api/datadogV2/model_custom_attribute_values_union.go +++ b/api/datadogV2/model_custom_attribute_values_union.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomAttributeValuesUnion - Union of supported value for a custom attribute +// CustomAttributeValuesUnion - The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values. type CustomAttributeValuesUnion struct { CustomAttributeStringValue *string CustomAttributeMultiStringValue *[]string diff --git a/api/datadogV2/model_dashboard_usage.go b/api/datadogV2/model_dashboard_usage.go new file mode 100644 index 00000000000..093dfcb2748 --- /dev/null +++ b/api/datadogV2/model_dashboard_usage.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardUsage A single dashboard usage record. +type DashboardUsage struct { + // Usage statistics for a dashboard. + Attributes DashboardUsageAttributes `json:"attributes"` + // The dashboard ID. + Id string `json:"id"` + // The type of the resource. Always `dashboards-usages`. + Type DashboardUsageType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDashboardUsage instantiates a new DashboardUsage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDashboardUsage(attributes DashboardUsageAttributes, id string, typeVar DashboardUsageType) *DashboardUsage { + this := DashboardUsage{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewDashboardUsageWithDefaults instantiates a new DashboardUsage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDashboardUsageWithDefaults() *DashboardUsage { + this := DashboardUsage{} + var typeVar DashboardUsageType = DASHBOARDUSAGETYPE_DASHBOARDS_USAGES + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *DashboardUsage) GetAttributes() DashboardUsageAttributes { + if o == nil { + var ret DashboardUsageAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *DashboardUsage) GetAttributesOk() (*DashboardUsageAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *DashboardUsage) SetAttributes(v DashboardUsageAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *DashboardUsage) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DashboardUsage) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *DashboardUsage) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *DashboardUsage) GetType() DashboardUsageType { + if o == nil { + var ret DashboardUsageType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DashboardUsage) GetTypeOk() (*DashboardUsageType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *DashboardUsage) SetType(v DashboardUsageType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DashboardUsage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DashboardUsage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *DashboardUsageAttributes `json:"attributes"` + Id *string `json:"id"` + Type *DashboardUsageType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_dashboard_usage_attributes.go b/api/datadogV2/model_dashboard_usage_attributes.go new file mode 100644 index 00000000000..c63137f44bc --- /dev/null +++ b/api/datadogV2/model_dashboard_usage_attributes.go @@ -0,0 +1,612 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardUsageAttributes Usage statistics for a dashboard. +type DashboardUsageAttributes struct { + // A user referenced from a dashboard usage record (author or viewer). + Author NullableDashboardUsageUser `json:"author,omitempty"` + // When the dashboard was created. + CreatedAt datadog.NullableTime `json:"created_at,omitempty"` + // The dashboard quality score, or `null` when no score is available. + DashboardQualityScore datadog.NullableFloat64 `json:"dashboard_quality_score,omitempty"` + // When the dashboard was most recently edited. + EditedAt datadog.NullableTime `json:"edited_at,omitempty"` + // The Datadog organization that owns the dashboard. + OrgId int64 `json:"org_id"` + // Teams the dashboard is tagged with. + Teams datadog.NullableList[string] `json:"teams,omitempty"` + // The dashboard title. + Title *string `json:"title,omitempty"` + // The total number of times the dashboard has been viewed. + TotalViews *int64 `json:"total_views,omitempty"` + // View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`. + TotalViewsByType map[string]int64 `json:"total_views_by_type,omitempty"` + // When the dashboard was most recently viewed. + ViewedAt datadog.NullableTime `json:"viewed_at,omitempty"` + // A user referenced from a dashboard usage record (author or viewer). + Viewer NullableDashboardUsageUser `json:"viewer,omitempty"` + // The total number of widgets on the dashboard. + WidgetCount datadog.NullableInt64 `json:"widget_count,omitempty"` + // Widget counts keyed by widget type. The map includes group widgets and widgets without requests. + WidgetCountByType map[string]int64 `json:"widget_count_by_type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDashboardUsageAttributes instantiates a new DashboardUsageAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDashboardUsageAttributes(orgId int64) *DashboardUsageAttributes { + this := DashboardUsageAttributes{} + this.OrgId = orgId + return &this +} + +// NewDashboardUsageAttributesWithDefaults instantiates a new DashboardUsageAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDashboardUsageAttributesWithDefaults() *DashboardUsageAttributes { + this := DashboardUsageAttributes{} + return &this +} + +// GetAuthor returns the Author field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetAuthor() DashboardUsageUser { + if o == nil || o.Author.Get() == nil { + var ret DashboardUsageUser + return ret + } + return *o.Author.Get() +} + +// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetAuthorOk() (*DashboardUsageUser, bool) { + if o == nil { + return nil, false + } + return o.Author.Get(), o.Author.IsSet() +} + +// HasAuthor returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasAuthor() bool { + return o != nil && o.Author.IsSet() +} + +// SetAuthor gets a reference to the given NullableDashboardUsageUser and assigns it to the Author field. +func (o *DashboardUsageAttributes) SetAuthor(v DashboardUsageUser) { + o.Author.Set(&v) +} + +// SetAuthorNil sets the value for Author to be an explicit nil. +func (o *DashboardUsageAttributes) SetAuthorNil() { + o.Author.Set(nil) +} + +// UnsetAuthor ensures that no value is present for Author, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetAuthor() { + o.Author.Unset() +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.CreatedAt.Get() +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CreatedAt.Get(), o.CreatedAt.IsSet() +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasCreatedAt() bool { + return o != nil && o.CreatedAt.IsSet() +} + +// SetCreatedAt gets a reference to the given datadog.NullableTime and assigns it to the CreatedAt field. +func (o *DashboardUsageAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt.Set(&v) +} + +// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil. +func (o *DashboardUsageAttributes) SetCreatedAtNil() { + o.CreatedAt.Set(nil) +} + +// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetCreatedAt() { + o.CreatedAt.Unset() +} + +// GetDashboardQualityScore returns the DashboardQualityScore field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetDashboardQualityScore() float64 { + if o == nil || o.DashboardQualityScore.Get() == nil { + var ret float64 + return ret + } + return *o.DashboardQualityScore.Get() +} + +// GetDashboardQualityScoreOk returns a tuple with the DashboardQualityScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetDashboardQualityScoreOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.DashboardQualityScore.Get(), o.DashboardQualityScore.IsSet() +} + +// HasDashboardQualityScore returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasDashboardQualityScore() bool { + return o != nil && o.DashboardQualityScore.IsSet() +} + +// SetDashboardQualityScore gets a reference to the given datadog.NullableFloat64 and assigns it to the DashboardQualityScore field. +func (o *DashboardUsageAttributes) SetDashboardQualityScore(v float64) { + o.DashboardQualityScore.Set(&v) +} + +// SetDashboardQualityScoreNil sets the value for DashboardQualityScore to be an explicit nil. +func (o *DashboardUsageAttributes) SetDashboardQualityScoreNil() { + o.DashboardQualityScore.Set(nil) +} + +// UnsetDashboardQualityScore ensures that no value is present for DashboardQualityScore, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetDashboardQualityScore() { + o.DashboardQualityScore.Unset() +} + +// GetEditedAt returns the EditedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetEditedAt() time.Time { + if o == nil || o.EditedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.EditedAt.Get() +} + +// GetEditedAtOk returns a tuple with the EditedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetEditedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.EditedAt.Get(), o.EditedAt.IsSet() +} + +// HasEditedAt returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasEditedAt() bool { + return o != nil && o.EditedAt.IsSet() +} + +// SetEditedAt gets a reference to the given datadog.NullableTime and assigns it to the EditedAt field. +func (o *DashboardUsageAttributes) SetEditedAt(v time.Time) { + o.EditedAt.Set(&v) +} + +// SetEditedAtNil sets the value for EditedAt to be an explicit nil. +func (o *DashboardUsageAttributes) SetEditedAtNil() { + o.EditedAt.Set(nil) +} + +// UnsetEditedAt ensures that no value is present for EditedAt, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetEditedAt() { + o.EditedAt.Unset() +} + +// GetOrgId returns the OrgId field value. +func (o *DashboardUsageAttributes) GetOrgId() int64 { + if o == nil { + var ret int64 + return ret + } + return o.OrgId +} + +// GetOrgIdOk returns a tuple with the OrgId field value +// and a boolean to check if the value has been set. +func (o *DashboardUsageAttributes) GetOrgIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OrgId, true +} + +// SetOrgId sets field value. +func (o *DashboardUsageAttributes) SetOrgId(v int64) { + o.OrgId = v +} + +// GetTeams returns the Teams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetTeams() []string { + if o == nil || o.Teams.Get() == nil { + var ret []string + return ret + } + return *o.Teams.Get() +} + +// GetTeamsOk returns a tuple with the Teams field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetTeamsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Teams.Get(), o.Teams.IsSet() +} + +// HasTeams returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasTeams() bool { + return o != nil && o.Teams.IsSet() +} + +// SetTeams gets a reference to the given datadog.NullableList[string] and assigns it to the Teams field. +func (o *DashboardUsageAttributes) SetTeams(v []string) { + o.Teams.Set(&v) +} + +// SetTeamsNil sets the value for Teams to be an explicit nil. +func (o *DashboardUsageAttributes) SetTeamsNil() { + o.Teams.Set(nil) +} + +// UnsetTeams ensures that no value is present for Teams, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetTeams() { + o.Teams.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *DashboardUsageAttributes) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageAttributes) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasTitle() bool { + return o != nil && o.Title != nil +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *DashboardUsageAttributes) SetTitle(v string) { + o.Title = &v +} + +// GetTotalViews returns the TotalViews field value if set, zero value otherwise. +func (o *DashboardUsageAttributes) GetTotalViews() int64 { + if o == nil || o.TotalViews == nil { + var ret int64 + return ret + } + return *o.TotalViews +} + +// GetTotalViewsOk returns a tuple with the TotalViews field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageAttributes) GetTotalViewsOk() (*int64, bool) { + if o == nil || o.TotalViews == nil { + return nil, false + } + return o.TotalViews, true +} + +// HasTotalViews returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasTotalViews() bool { + return o != nil && o.TotalViews != nil +} + +// SetTotalViews gets a reference to the given int64 and assigns it to the TotalViews field. +func (o *DashboardUsageAttributes) SetTotalViews(v int64) { + o.TotalViews = &v +} + +// GetTotalViewsByType returns the TotalViewsByType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetTotalViewsByType() map[string]int64 { + if o == nil { + var ret map[string]int64 + return ret + } + return o.TotalViewsByType +} + +// GetTotalViewsByTypeOk returns a tuple with the TotalViewsByType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetTotalViewsByTypeOk() (*map[string]int64, bool) { + if o == nil || o.TotalViewsByType == nil { + return nil, false + } + return &o.TotalViewsByType, true +} + +// HasTotalViewsByType returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasTotalViewsByType() bool { + return o != nil && o.TotalViewsByType != nil +} + +// SetTotalViewsByType gets a reference to the given map[string]int64 and assigns it to the TotalViewsByType field. +func (o *DashboardUsageAttributes) SetTotalViewsByType(v map[string]int64) { + o.TotalViewsByType = v +} + +// GetViewedAt returns the ViewedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetViewedAt() time.Time { + if o == nil || o.ViewedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.ViewedAt.Get() +} + +// GetViewedAtOk returns a tuple with the ViewedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetViewedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ViewedAt.Get(), o.ViewedAt.IsSet() +} + +// HasViewedAt returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasViewedAt() bool { + return o != nil && o.ViewedAt.IsSet() +} + +// SetViewedAt gets a reference to the given datadog.NullableTime and assigns it to the ViewedAt field. +func (o *DashboardUsageAttributes) SetViewedAt(v time.Time) { + o.ViewedAt.Set(&v) +} + +// SetViewedAtNil sets the value for ViewedAt to be an explicit nil. +func (o *DashboardUsageAttributes) SetViewedAtNil() { + o.ViewedAt.Set(nil) +} + +// UnsetViewedAt ensures that no value is present for ViewedAt, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetViewedAt() { + o.ViewedAt.Unset() +} + +// GetViewer returns the Viewer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetViewer() DashboardUsageUser { + if o == nil || o.Viewer.Get() == nil { + var ret DashboardUsageUser + return ret + } + return *o.Viewer.Get() +} + +// GetViewerOk returns a tuple with the Viewer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetViewerOk() (*DashboardUsageUser, bool) { + if o == nil { + return nil, false + } + return o.Viewer.Get(), o.Viewer.IsSet() +} + +// HasViewer returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasViewer() bool { + return o != nil && o.Viewer.IsSet() +} + +// SetViewer gets a reference to the given NullableDashboardUsageUser and assigns it to the Viewer field. +func (o *DashboardUsageAttributes) SetViewer(v DashboardUsageUser) { + o.Viewer.Set(&v) +} + +// SetViewerNil sets the value for Viewer to be an explicit nil. +func (o *DashboardUsageAttributes) SetViewerNil() { + o.Viewer.Set(nil) +} + +// UnsetViewer ensures that no value is present for Viewer, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetViewer() { + o.Viewer.Unset() +} + +// GetWidgetCount returns the WidgetCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetWidgetCount() int64 { + if o == nil || o.WidgetCount.Get() == nil { + var ret int64 + return ret + } + return *o.WidgetCount.Get() +} + +// GetWidgetCountOk returns a tuple with the WidgetCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetWidgetCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.WidgetCount.Get(), o.WidgetCount.IsSet() +} + +// HasWidgetCount returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasWidgetCount() bool { + return o != nil && o.WidgetCount.IsSet() +} + +// SetWidgetCount gets a reference to the given datadog.NullableInt64 and assigns it to the WidgetCount field. +func (o *DashboardUsageAttributes) SetWidgetCount(v int64) { + o.WidgetCount.Set(&v) +} + +// SetWidgetCountNil sets the value for WidgetCount to be an explicit nil. +func (o *DashboardUsageAttributes) SetWidgetCountNil() { + o.WidgetCount.Set(nil) +} + +// UnsetWidgetCount ensures that no value is present for WidgetCount, not even an explicit nil. +func (o *DashboardUsageAttributes) UnsetWidgetCount() { + o.WidgetCount.Unset() +} + +// GetWidgetCountByType returns the WidgetCountByType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardUsageAttributes) GetWidgetCountByType() map[string]int64 { + if o == nil { + var ret map[string]int64 + return ret + } + return o.WidgetCountByType +} + +// GetWidgetCountByTypeOk returns a tuple with the WidgetCountByType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *DashboardUsageAttributes) GetWidgetCountByTypeOk() (*map[string]int64, bool) { + if o == nil || o.WidgetCountByType == nil { + return nil, false + } + return &o.WidgetCountByType, true +} + +// HasWidgetCountByType returns a boolean if a field has been set. +func (o *DashboardUsageAttributes) HasWidgetCountByType() bool { + return o != nil && o.WidgetCountByType != nil +} + +// SetWidgetCountByType gets a reference to the given map[string]int64 and assigns it to the WidgetCountByType field. +func (o *DashboardUsageAttributes) SetWidgetCountByType(v map[string]int64) { + o.WidgetCountByType = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DashboardUsageAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Author.IsSet() { + toSerialize["author"] = o.Author.Get() + } + if o.CreatedAt.IsSet() { + toSerialize["created_at"] = o.CreatedAt.Get() + } + if o.DashboardQualityScore.IsSet() { + toSerialize["dashboard_quality_score"] = o.DashboardQualityScore.Get() + } + if o.EditedAt.IsSet() { + toSerialize["edited_at"] = o.EditedAt.Get() + } + toSerialize["org_id"] = o.OrgId + if o.Teams.IsSet() { + toSerialize["teams"] = o.Teams.Get() + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + if o.TotalViews != nil { + toSerialize["total_views"] = o.TotalViews + } + if o.TotalViewsByType != nil { + toSerialize["total_views_by_type"] = o.TotalViewsByType + } + if o.ViewedAt.IsSet() { + toSerialize["viewed_at"] = o.ViewedAt.Get() + } + if o.Viewer.IsSet() { + toSerialize["viewer"] = o.Viewer.Get() + } + if o.WidgetCount.IsSet() { + toSerialize["widget_count"] = o.WidgetCount.Get() + } + if o.WidgetCountByType != nil { + toSerialize["widget_count_by_type"] = o.WidgetCountByType + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DashboardUsageAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Author NullableDashboardUsageUser `json:"author,omitempty"` + CreatedAt datadog.NullableTime `json:"created_at,omitempty"` + DashboardQualityScore datadog.NullableFloat64 `json:"dashboard_quality_score,omitempty"` + EditedAt datadog.NullableTime `json:"edited_at,omitempty"` + OrgId *int64 `json:"org_id"` + Teams datadog.NullableList[string] `json:"teams,omitempty"` + Title *string `json:"title,omitempty"` + TotalViews *int64 `json:"total_views,omitempty"` + TotalViewsByType map[string]int64 `json:"total_views_by_type,omitempty"` + ViewedAt datadog.NullableTime `json:"viewed_at,omitempty"` + Viewer NullableDashboardUsageUser `json:"viewer,omitempty"` + WidgetCount datadog.NullableInt64 `json:"widget_count,omitempty"` + WidgetCountByType map[string]int64 `json:"widget_count_by_type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.OrgId == nil { + return fmt.Errorf("required field org_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"author", "created_at", "dashboard_quality_score", "edited_at", "org_id", "teams", "title", "total_views", "total_views_by_type", "viewed_at", "viewer", "widget_count", "widget_count_by_type"}) + } else { + return err + } + o.Author = all.Author + o.CreatedAt = all.CreatedAt + o.DashboardQualityScore = all.DashboardQualityScore + o.EditedAt = all.EditedAt + o.OrgId = *all.OrgId + o.Teams = all.Teams + o.Title = all.Title + o.TotalViews = all.TotalViews + o.TotalViewsByType = all.TotalViewsByType + o.ViewedAt = all.ViewedAt + o.Viewer = all.Viewer + o.WidgetCount = all.WidgetCount + o.WidgetCountByType = all.WidgetCountByType + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_dashboard_usage_response.go b/api/datadogV2/model_dashboard_usage_response.go new file mode 100644 index 00000000000..f3581c6cab0 --- /dev/null +++ b/api/datadogV2/model_dashboard_usage_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardUsageResponse Response containing usage statistics for a single dashboard. +type DashboardUsageResponse struct { + // A single dashboard usage record. + Data DashboardUsage `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDashboardUsageResponse instantiates a new DashboardUsageResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDashboardUsageResponse(data DashboardUsage) *DashboardUsageResponse { + this := DashboardUsageResponse{} + this.Data = data + return &this +} + +// NewDashboardUsageResponseWithDefaults instantiates a new DashboardUsageResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDashboardUsageResponseWithDefaults() *DashboardUsageResponse { + this := DashboardUsageResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *DashboardUsageResponse) GetData() DashboardUsage { + if o == nil { + var ret DashboardUsage + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *DashboardUsageResponse) GetDataOk() (*DashboardUsage, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *DashboardUsageResponse) SetData(v DashboardUsage) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DashboardUsageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DashboardUsageResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *DashboardUsage `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_dashboard_usage_type.go b/api/datadogV2/model_dashboard_usage_type.go new file mode 100644 index 00000000000..bd65f243ecd --- /dev/null +++ b/api/datadogV2/model_dashboard_usage_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardUsageType The type of the resource. Always `dashboards-usages`. +type DashboardUsageType string + +// List of DashboardUsageType. +const ( + DASHBOARDUSAGETYPE_DASHBOARDS_USAGES DashboardUsageType = "dashboards-usages" +) + +var allowedDashboardUsageTypeEnumValues = []DashboardUsageType{ + DASHBOARDUSAGETYPE_DASHBOARDS_USAGES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DashboardUsageType) GetAllowedValues() []DashboardUsageType { + return allowedDashboardUsageTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DashboardUsageType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DashboardUsageType(value) + return nil +} + +// NewDashboardUsageTypeFromValue returns a pointer to a valid DashboardUsageType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDashboardUsageTypeFromValue(v string) (*DashboardUsageType, error) { + ev := DashboardUsageType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DashboardUsageType: valid values are %v", v, allowedDashboardUsageTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DashboardUsageType) IsValid() bool { + for _, existing := range allowedDashboardUsageTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DashboardUsageType value. +func (v DashboardUsageType) Ptr() *DashboardUsageType { + return &v +} diff --git a/api/datadogV2/model_dashboard_usage_user.go b/api/datadogV2/model_dashboard_usage_user.go new file mode 100644 index 00000000000..258912175ff --- /dev/null +++ b/api/datadogV2/model_dashboard_usage_user.go @@ -0,0 +1,257 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DashboardUsageUser A user referenced from a dashboard usage record (author or viewer). +type DashboardUsageUser struct { + // Datadog handle (login) of the user. + Handle *string `json:"handle,omitempty"` + // The user ID. + Id *string `json:"id,omitempty"` + // Whether the user account is disabled. + IsDisabled *bool `json:"is_disabled,omitempty"` + // Display name of the user. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDashboardUsageUser instantiates a new DashboardUsageUser object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDashboardUsageUser() *DashboardUsageUser { + this := DashboardUsageUser{} + return &this +} + +// NewDashboardUsageUserWithDefaults instantiates a new DashboardUsageUser object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDashboardUsageUserWithDefaults() *DashboardUsageUser { + this := DashboardUsageUser{} + return &this +} + +// GetHandle returns the Handle field value if set, zero value otherwise. +func (o *DashboardUsageUser) GetHandle() string { + if o == nil || o.Handle == nil { + var ret string + return ret + } + return *o.Handle +} + +// GetHandleOk returns a tuple with the Handle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageUser) GetHandleOk() (*string, bool) { + if o == nil || o.Handle == nil { + return nil, false + } + return o.Handle, true +} + +// HasHandle returns a boolean if a field has been set. +func (o *DashboardUsageUser) HasHandle() bool { + return o != nil && o.Handle != nil +} + +// SetHandle gets a reference to the given string and assigns it to the Handle field. +func (o *DashboardUsageUser) SetHandle(v string) { + o.Handle = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DashboardUsageUser) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageUser) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DashboardUsageUser) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DashboardUsageUser) SetId(v string) { + o.Id = &v +} + +// GetIsDisabled returns the IsDisabled field value if set, zero value otherwise. +func (o *DashboardUsageUser) GetIsDisabled() bool { + if o == nil || o.IsDisabled == nil { + var ret bool + return ret + } + return *o.IsDisabled +} + +// GetIsDisabledOk returns a tuple with the IsDisabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageUser) GetIsDisabledOk() (*bool, bool) { + if o == nil || o.IsDisabled == nil { + return nil, false + } + return o.IsDisabled, true +} + +// HasIsDisabled returns a boolean if a field has been set. +func (o *DashboardUsageUser) HasIsDisabled() bool { + return o != nil && o.IsDisabled != nil +} + +// SetIsDisabled gets a reference to the given bool and assigns it to the IsDisabled field. +func (o *DashboardUsageUser) SetIsDisabled(v bool) { + o.IsDisabled = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DashboardUsageUser) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DashboardUsageUser) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DashboardUsageUser) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DashboardUsageUser) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DashboardUsageUser) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Handle != nil { + toSerialize["handle"] = o.Handle + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.IsDisabled != nil { + toSerialize["is_disabled"] = o.IsDisabled + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DashboardUsageUser) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Handle *string `json:"handle,omitempty"` + Id *string `json:"id,omitempty"` + IsDisabled *bool `json:"is_disabled,omitempty"` + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"handle", "id", "is_disabled", "name"}) + } else { + return err + } + o.Handle = all.Handle + o.Id = all.Id + o.IsDisabled = all.IsDisabled + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} + +// NullableDashboardUsageUser handles when a null is used for DashboardUsageUser. +type NullableDashboardUsageUser struct { + value *DashboardUsageUser + isSet bool +} + +// Get returns the associated value. +func (v NullableDashboardUsageUser) Get() *DashboardUsageUser { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableDashboardUsageUser) Set(val *DashboardUsageUser) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableDashboardUsageUser) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag/ +func (v *NullableDashboardUsageUser) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDashboardUsageUser initializes the struct as if Set has been called. +func NewNullableDashboardUsageUser(val *DashboardUsageUser) *NullableDashboardUsageUser { + return &NullableDashboardUsageUser{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableDashboardUsageUser) MarshalJSON() ([]byte, error) { + return datadog.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableDashboardUsageUser) UnmarshalJSON(src []byte) error { + v.isSet = true + + // this object is nullable so check if the payload is null or empty string + if string(src) == "" || string(src) == "{}" { + return nil + } + + return datadog.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_degradation_data_attributes_updates_items.go b/api/datadogV2/model_degradation_data_attributes_updates_items.go index 8778021a98c..693e05d1f8f 100644 --- a/api/datadogV2/model_degradation_data_attributes_updates_items.go +++ b/api/datadogV2/model_degradation_data_attributes_updates_items.go @@ -22,6 +22,8 @@ type DegradationDataAttributesUpdatesItems struct { Description *string `json:"description,omitempty"` // Identifier of the update. Id *uuid.UUID `json:"id,omitempty"` + // UUID of the user who last modified the resource. + LastModifiedByUserUuid *string `json:"last_modified_by_user_uuid,omitempty"` // Timestamp of when the update was last modified. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Timestamp of when the update started. @@ -162,6 +164,34 @@ func (o *DegradationDataAttributesUpdatesItems) SetId(v uuid.UUID) { o.Id = &v } +// GetLastModifiedByUserUuid returns the LastModifiedByUserUuid field value if set, zero value otherwise. +func (o *DegradationDataAttributesUpdatesItems) GetLastModifiedByUserUuid() string { + if o == nil || o.LastModifiedByUserUuid == nil { + var ret string + return ret + } + return *o.LastModifiedByUserUuid +} + +// GetLastModifiedByUserUuidOk returns a tuple with the LastModifiedByUserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DegradationDataAttributesUpdatesItems) GetLastModifiedByUserUuidOk() (*string, bool) { + if o == nil || o.LastModifiedByUserUuid == nil { + return nil, false + } + return o.LastModifiedByUserUuid, true +} + +// HasLastModifiedByUserUuid returns a boolean if a field has been set. +func (o *DegradationDataAttributesUpdatesItems) HasLastModifiedByUserUuid() bool { + return o != nil && o.LastModifiedByUserUuid != nil +} + +// SetLastModifiedByUserUuid gets a reference to the given string and assigns it to the LastModifiedByUserUuid field. +func (o *DegradationDataAttributesUpdatesItems) SetLastModifiedByUserUuid(v string) { + o.LastModifiedByUserUuid = &v +} + // GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise. func (o *DegradationDataAttributesUpdatesItems) GetModifiedAt() time.Time { if o == nil || o.ModifiedAt == nil { @@ -268,6 +298,9 @@ func (o DegradationDataAttributesUpdatesItems) MarshalJSON() ([]byte, error) { if o.Id != nil { toSerialize["id"] = o.Id } + if o.LastModifiedByUserUuid != nil { + toSerialize["last_modified_by_user_uuid"] = o.LastModifiedByUserUuid + } if o.ModifiedAt != nil { if o.ModifiedAt.Nanosecond() == 0 { toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") @@ -295,20 +328,21 @@ func (o DegradationDataAttributesUpdatesItems) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DegradationDataAttributesUpdatesItems) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ComponentsAffected []DegradationDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - Description *string `json:"description,omitempty"` - Id *uuid.UUID `json:"id,omitempty"` - ModifiedAt *time.Time `json:"modified_at,omitempty"` - StartedAt *time.Time `json:"started_at,omitempty"` - Status *CreateDegradationRequestDataAttributesStatus `json:"status,omitempty"` + ComponentsAffected []DegradationDataAttributesUpdatesItemsComponentsAffectedItems `json:"components_affected,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Description *string `json:"description,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + LastModifiedByUserUuid *string `json:"last_modified_by_user_uuid,omitempty"` + ModifiedAt *time.Time `json:"modified_at,omitempty"` + StartedAt *time.Time `json:"started_at,omitempty"` + Status *CreateDegradationRequestDataAttributesStatus `json:"status,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "created_at", "description", "id", "modified_at", "started_at", "status"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components_affected", "created_at", "description", "id", "last_modified_by_user_uuid", "modified_at", "started_at", "status"}) } else { return err } @@ -318,6 +352,7 @@ func (o *DegradationDataAttributesUpdatesItems) UnmarshalJSON(bytes []byte) (err o.CreatedAt = all.CreatedAt o.Description = all.Description o.Id = all.Id + o.LastModifiedByUserUuid = all.LastModifiedByUserUuid o.ModifiedAt = all.ModifiedAt o.StartedAt = all.StartedAt if all.Status != nil && !all.Status.IsValid() { diff --git a/api/datadogV2/model_entity_context_entity.go b/api/datadogV2/model_entity_context_entity.go new file mode 100644 index 00000000000..e9dbdf74264 --- /dev/null +++ b/api/datadogV2/model_entity_context_entity.go @@ -0,0 +1,177 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextEntity A single entity returned by the entity context endpoint. +type EntityContextEntity struct { + // The attributes of an entity context entry, grouping all the historical revisions of the entity. + Attributes EntityContextEntityAttributes `json:"attributes"` + // The unique identifier of the entity. + Id string `json:"id"` + // The type of the entity. Reflects the underlying entity kind from the entity context store + // (for example, `siem_entity_identity` for identities). Defaults to `entity` when the kind is unknown. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextEntity instantiates a new EntityContextEntity object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextEntity(attributes EntityContextEntityAttributes, id string, typeVar string) *EntityContextEntity { + this := EntityContextEntity{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewEntityContextEntityWithDefaults instantiates a new EntityContextEntity object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextEntityWithDefaults() *EntityContextEntity { + this := EntityContextEntity{} + var typeVar string = "entity" + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *EntityContextEntity) GetAttributes() EntityContextEntityAttributes { + if o == nil { + var ret EntityContextEntityAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *EntityContextEntity) GetAttributesOk() (*EntityContextEntityAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *EntityContextEntity) SetAttributes(v EntityContextEntityAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *EntityContextEntity) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *EntityContextEntity) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *EntityContextEntity) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *EntityContextEntity) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *EntityContextEntity) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *EntityContextEntity) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextEntity) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextEntity) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *EntityContextEntityAttributes `json:"attributes"` + Id *string `json:"id"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_entity_context_entity_attributes.go b/api/datadogV2/model_entity_context_entity_attributes.go new file mode 100644 index 00000000000..190966d1edb --- /dev/null +++ b/api/datadogV2/model_entity_context_entity_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextEntityAttributes The attributes of an entity context entry, grouping all the historical revisions of the entity. +type EntityContextEntityAttributes struct { + // The historical revisions of the entity, ordered chronologically. + Revisions []EntityContextRevision `json:"revisions"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextEntityAttributes instantiates a new EntityContextEntityAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextEntityAttributes(revisions []EntityContextRevision) *EntityContextEntityAttributes { + this := EntityContextEntityAttributes{} + this.Revisions = revisions + return &this +} + +// NewEntityContextEntityAttributesWithDefaults instantiates a new EntityContextEntityAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextEntityAttributesWithDefaults() *EntityContextEntityAttributes { + this := EntityContextEntityAttributes{} + return &this +} + +// GetRevisions returns the Revisions field value. +func (o *EntityContextEntityAttributes) GetRevisions() []EntityContextRevision { + if o == nil { + var ret []EntityContextRevision + return ret + } + return o.Revisions +} + +// GetRevisionsOk returns a tuple with the Revisions field value +// and a boolean to check if the value has been set. +func (o *EntityContextEntityAttributes) GetRevisionsOk() (*[]EntityContextRevision, bool) { + if o == nil { + return nil, false + } + return &o.Revisions, true +} + +// SetRevisions sets field value. +func (o *EntityContextEntityAttributes) SetRevisions(v []EntityContextRevision) { + o.Revisions = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextEntityAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["revisions"] = o.Revisions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextEntityAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Revisions *[]EntityContextRevision `json:"revisions"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Revisions == nil { + return fmt.Errorf("required field revisions missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"revisions"}) + } else { + return err + } + o.Revisions = *all.Revisions + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_entity_context_page.go b/api/datadogV2/model_entity_context_page.go new file mode 100644 index 00000000000..06dcb6d4655 --- /dev/null +++ b/api/datadogV2/model_entity_context_page.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextPage Pagination metadata for the entity context response. +type EntityContextPage struct { + // An opaque token to pass as `page_token` in a subsequent request to retrieve the next page of results. Empty when there are no more results. + NextToken string `json:"next_token"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextPage instantiates a new EntityContextPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextPage(nextToken string) *EntityContextPage { + this := EntityContextPage{} + this.NextToken = nextToken + return &this +} + +// NewEntityContextPageWithDefaults instantiates a new EntityContextPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextPageWithDefaults() *EntityContextPage { + this := EntityContextPage{} + return &this +} + +// GetNextToken returns the NextToken field value. +func (o *EntityContextPage) GetNextToken() string { + if o == nil { + var ret string + return ret + } + return o.NextToken +} + +// GetNextTokenOk returns a tuple with the NextToken field value +// and a boolean to check if the value has been set. +func (o *EntityContextPage) GetNextTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NextToken, true +} + +// SetNextToken sets field value. +func (o *EntityContextPage) SetNextToken(v string) { + o.NextToken = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["next_token"] = o.NextToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + NextToken *string `json:"next_token"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.NextToken == nil { + return fmt.Errorf("required field next_token missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"next_token"}) + } else { + return err + } + o.NextToken = *all.NextToken + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_entity_context_response.go b/api/datadogV2/model_entity_context_response.go new file mode 100644 index 00000000000..8610f2ad4d9 --- /dev/null +++ b/api/datadogV2/model_entity_context_response.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextResponse Response from the entity context endpoint, containing the matching entities and pagination metadata. +type EntityContextResponse struct { + // The list of entities matching the query. + Data []EntityContextEntity `json:"data"` + // Metadata returned alongside the entity context response. + Meta EntityContextResponseMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextResponse instantiates a new EntityContextResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextResponse(data []EntityContextEntity, meta EntityContextResponseMeta) *EntityContextResponse { + this := EntityContextResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewEntityContextResponseWithDefaults instantiates a new EntityContextResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextResponseWithDefaults() *EntityContextResponse { + this := EntityContextResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *EntityContextResponse) GetData() []EntityContextEntity { + if o == nil { + var ret []EntityContextEntity + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *EntityContextResponse) GetDataOk() (*[]EntityContextEntity, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *EntityContextResponse) SetData(v []EntityContextEntity) { + o.Data = v +} + +// GetMeta returns the Meta field value. +func (o *EntityContextResponse) GetMeta() EntityContextResponseMeta { + if o == nil { + var ret EntityContextResponseMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *EntityContextResponse) GetMetaOk() (*EntityContextResponseMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *EntityContextResponse) SetMeta(v EntityContextResponseMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]EntityContextEntity `json:"data"` + Meta *EntityContextResponseMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_entity_context_response_meta.go b/api/datadogV2/model_entity_context_response_meta.go new file mode 100644 index 00000000000..d9ef38269c9 --- /dev/null +++ b/api/datadogV2/model_entity_context_response_meta.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextResponseMeta Metadata returned alongside the entity context response. +type EntityContextResponseMeta struct { + // Pagination metadata for the entity context response. + Page EntityContextPage `json:"page"` + // The total number of entities matching the query, irrespective of pagination. + TotalCount int32 `json:"total_count"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextResponseMeta instantiates a new EntityContextResponseMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextResponseMeta(page EntityContextPage, totalCount int32) *EntityContextResponseMeta { + this := EntityContextResponseMeta{} + this.Page = page + this.TotalCount = totalCount + return &this +} + +// NewEntityContextResponseMetaWithDefaults instantiates a new EntityContextResponseMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextResponseMetaWithDefaults() *EntityContextResponseMeta { + this := EntityContextResponseMeta{} + return &this +} + +// GetPage returns the Page field value. +func (o *EntityContextResponseMeta) GetPage() EntityContextPage { + if o == nil { + var ret EntityContextPage + return ret + } + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *EntityContextResponseMeta) GetPageOk() (*EntityContextPage, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value. +func (o *EntityContextResponseMeta) SetPage(v EntityContextPage) { + o.Page = v +} + +// GetTotalCount returns the TotalCount field value. +func (o *EntityContextResponseMeta) GetTotalCount() int32 { + if o == nil { + var ret int32 + return ret + } + return o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value +// and a boolean to check if the value has been set. +func (o *EntityContextResponseMeta) GetTotalCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalCount, true +} + +// SetTotalCount sets field value. +func (o *EntityContextResponseMeta) SetTotalCount(v int32) { + o.TotalCount = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["page"] = o.Page + toSerialize["total_count"] = o.TotalCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextResponseMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *EntityContextPage `json:"page"` + TotalCount *int32 `json:"total_count"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Page == nil { + return fmt.Errorf("required field page missing") + } + if all.TotalCount == nil { + return fmt.Errorf("required field total_count missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page", "total_count"}) + } else { + return err + } + + hasInvalidField := false + if all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = *all.Page + o.TotalCount = *all.TotalCount + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_entity_context_revision.go b/api/datadogV2/model_entity_context_revision.go new file mode 100644 index 00000000000..c74a58c99b0 --- /dev/null +++ b/api/datadogV2/model_entity_context_revision.go @@ -0,0 +1,174 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// EntityContextRevision A single historical revision of an entity, including the time range during which the revision was observed. +type EntityContextRevision struct { + // The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity. + Attributes map[string]interface{} `json:"attributes"` + // The first time the entity was observed at this revision. + FirstSeenAt time.Time `json:"first_seen_at"` + // The last time the entity was observed at this revision. + LastSeenAt time.Time `json:"last_seen_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewEntityContextRevision instantiates a new EntityContextRevision object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEntityContextRevision(attributes map[string]interface{}, firstSeenAt time.Time, lastSeenAt time.Time) *EntityContextRevision { + this := EntityContextRevision{} + this.Attributes = attributes + this.FirstSeenAt = firstSeenAt + this.LastSeenAt = lastSeenAt + return &this +} + +// NewEntityContextRevisionWithDefaults instantiates a new EntityContextRevision object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewEntityContextRevisionWithDefaults() *EntityContextRevision { + this := EntityContextRevision{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *EntityContextRevision) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *EntityContextRevision) GetAttributesOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *EntityContextRevision) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetFirstSeenAt returns the FirstSeenAt field value. +func (o *EntityContextRevision) GetFirstSeenAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.FirstSeenAt +} + +// GetFirstSeenAtOk returns a tuple with the FirstSeenAt field value +// and a boolean to check if the value has been set. +func (o *EntityContextRevision) GetFirstSeenAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.FirstSeenAt, true +} + +// SetFirstSeenAt sets field value. +func (o *EntityContextRevision) SetFirstSeenAt(v time.Time) { + o.FirstSeenAt = v +} + +// GetLastSeenAt returns the LastSeenAt field value. +func (o *EntityContextRevision) GetLastSeenAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.LastSeenAt +} + +// GetLastSeenAtOk returns a tuple with the LastSeenAt field value +// and a boolean to check if the value has been set. +func (o *EntityContextRevision) GetLastSeenAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastSeenAt, true +} + +// SetLastSeenAt sets field value. +func (o *EntityContextRevision) SetLastSeenAt(v time.Time) { + o.LastSeenAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o EntityContextRevision) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + if o.FirstSeenAt.Nanosecond() == 0 { + toSerialize["first_seen_at"] = o.FirstSeenAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["first_seen_at"] = o.FirstSeenAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.LastSeenAt.Nanosecond() == 0 { + toSerialize["last_seen_at"] = o.LastSeenAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["last_seen_at"] = o.LastSeenAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *EntityContextRevision) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *map[string]interface{} `json:"attributes"` + FirstSeenAt *time.Time `json:"first_seen_at"` + LastSeenAt *time.Time `json:"last_seen_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.FirstSeenAt == nil { + return fmt.Errorf("required field first_seen_at missing") + } + if all.LastSeenAt == nil { + return fmt.Errorf("required field last_seen_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "first_seen_at", "last_seen_at"}) + } else { + return err + } + o.Attributes = *all.Attributes + o.FirstSeenAt = *all.FirstSeenAt + o.LastSeenAt = *all.LastSeenAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_transport_webhook_log_network.go b/api/datadogV2/model_get_blueprint_response.go similarity index 53% rename from api/datadogV2/model_transport_webhook_log_network.go rename to api/datadogV2/model_get_blueprint_response.go index 4564361d395..25ad9e7d851 100644 --- a/api/datadogV2/model_transport_webhook_log_network.go +++ b/api/datadogV2/model_get_blueprint_response.go @@ -8,68 +8,68 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TransportWebhookLogNetwork The network information for the event. -type TransportWebhookLogNetwork struct { - // The IP address information. - Ip *TransportWebhookLogNetworkIp `json:"ip,omitempty"` +// GetBlueprintResponse The response for retrieving a single blueprint. +type GetBlueprintResponse struct { + // A blueprint resource. + Data *BlueprintData `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewTransportWebhookLogNetwork instantiates a new TransportWebhookLogNetwork object. +// NewGetBlueprintResponse instantiates a new GetBlueprintResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewTransportWebhookLogNetwork() *TransportWebhookLogNetwork { - this := TransportWebhookLogNetwork{} +func NewGetBlueprintResponse() *GetBlueprintResponse { + this := GetBlueprintResponse{} return &this } -// NewTransportWebhookLogNetworkWithDefaults instantiates a new TransportWebhookLogNetwork object. +// NewGetBlueprintResponseWithDefaults instantiates a new GetBlueprintResponse object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogNetworkWithDefaults() *TransportWebhookLogNetwork { - this := TransportWebhookLogNetwork{} +func NewGetBlueprintResponseWithDefaults() *GetBlueprintResponse { + this := GetBlueprintResponse{} return &this } -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *TransportWebhookLogNetwork) GetIp() TransportWebhookLogNetworkIp { - if o == nil || o.Ip == nil { - var ret TransportWebhookLogNetworkIp +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetBlueprintResponse) GetData() BlueprintData { + if o == nil || o.Data == nil { + var ret BlueprintData return ret } - return *o.Ip + return *o.Data } -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransportWebhookLogNetwork) GetIpOk() (*TransportWebhookLogNetworkIp, bool) { - if o == nil || o.Ip == nil { +func (o *GetBlueprintResponse) GetDataOk() (*BlueprintData, bool) { + if o == nil || o.Data == nil { return nil, false } - return o.Ip, true + return o.Data, true } -// HasIp returns a boolean if a field has been set. -func (o *TransportWebhookLogNetwork) HasIp() bool { - return o != nil && o.Ip != nil +// HasData returns a boolean if a field has been set. +func (o *GetBlueprintResponse) HasData() bool { + return o != nil && o.Data != nil } -// SetIp gets a reference to the given TransportWebhookLogNetworkIp and assigns it to the Ip field. -func (o *TransportWebhookLogNetwork) SetIp(v TransportWebhookLogNetworkIp) { - o.Ip = &v +// SetData gets a reference to the given BlueprintData and assigns it to the Data field. +func (o *GetBlueprintResponse) SetData(v BlueprintData) { + o.Data = &v } // MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogNetwork) MarshalJSON() ([]byte, error) { +func (o GetBlueprintResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - if o.Ip != nil { - toSerialize["ip"] = o.Ip + if o.Data != nil { + toSerialize["data"] = o.Data } for key, value := range o.AdditionalProperties { @@ -79,25 +79,25 @@ func (o TransportWebhookLogNetwork) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogNetwork) UnmarshalJSON(bytes []byte) (err error) { +func (o *GetBlueprintResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Ip *TransportWebhookLogNetworkIp `json:"ip,omitempty"` + Data *BlueprintData `json:"data,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"ip"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) } else { return err } hasInvalidField := false - if all.Ip != nil && all.Ip.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } - o.Ip = all.Ip + o.Data = all.Data if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_get_blueprints_response.go b/api/datadogV2/model_get_blueprints_response.go new file mode 100644 index 00000000000..ad5b3704dc3 --- /dev/null +++ b/api/datadogV2/model_get_blueprints_response.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetBlueprintsResponse The response for retrieving multiple blueprints. +type GetBlueprintsResponse struct { + // An array of blueprints. + Data []BlueprintData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewGetBlueprintsResponse instantiates a new GetBlueprintsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewGetBlueprintsResponse() *GetBlueprintsResponse { + this := GetBlueprintsResponse{} + return &this +} + +// NewGetBlueprintsResponseWithDefaults instantiates a new GetBlueprintsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewGetBlueprintsResponseWithDefaults() *GetBlueprintsResponse { + this := GetBlueprintsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetBlueprintsResponse) GetData() []BlueprintData { + if o == nil || o.Data == nil { + var ret []BlueprintData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlueprintsResponse) GetDataOk() (*[]BlueprintData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetBlueprintsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []BlueprintData and assigns it to the Data field. +func (o *GetBlueprintsResponse) SetData(v []BlueprintData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o GetBlueprintsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *GetBlueprintsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []BlueprintData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_list_app_versions_response.go b/api/datadogV2/model_list_app_versions_response.go new file mode 100644 index 00000000000..8111f55e763 --- /dev/null +++ b/api/datadogV2/model_list_app_versions_response.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppVersionsResponse A paginated list of versions for an app. +type ListAppVersionsResponse struct { + // The list of app versions. + Data []AppVersion `json:"data,omitempty"` + // Pagination metadata. + Meta *ListAppsResponseMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppVersionsResponse instantiates a new ListAppVersionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppVersionsResponse() *ListAppVersionsResponse { + this := ListAppVersionsResponse{} + return &this +} + +// NewListAppVersionsResponseWithDefaults instantiates a new ListAppVersionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppVersionsResponseWithDefaults() *ListAppVersionsResponse { + this := ListAppVersionsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListAppVersionsResponse) GetData() []AppVersion { + if o == nil || o.Data == nil { + var ret []AppVersion + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppVersionsResponse) GetDataOk() (*[]AppVersion, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListAppVersionsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []AppVersion and assigns it to the Data field. +func (o *ListAppVersionsResponse) SetData(v []AppVersion) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ListAppVersionsResponse) GetMeta() ListAppsResponseMeta { + if o == nil || o.Meta == nil { + var ret ListAppsResponseMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppVersionsResponse) GetMetaOk() (*ListAppsResponseMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ListAppVersionsResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given ListAppsResponseMeta and assigns it to the Meta field. +func (o *ListAppVersionsResponse) SetMeta(v ListAppsResponseMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppVersionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []AppVersion `json:"data,omitempty"` + Meta *ListAppsResponseMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_blueprints_response.go b/api/datadogV2/model_list_blueprints_response.go new file mode 100644 index 00000000000..5341ecf7bd1 --- /dev/null +++ b/api/datadogV2/model_list_blueprints_response.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListBlueprintsResponse The response for listing available blueprints. +type ListBlueprintsResponse struct { + // An array of blueprint metadata. + Data []BlueprintMetadataData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListBlueprintsResponse instantiates a new ListBlueprintsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListBlueprintsResponse() *ListBlueprintsResponse { + this := ListBlueprintsResponse{} + return &this +} + +// NewListBlueprintsResponseWithDefaults instantiates a new ListBlueprintsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListBlueprintsResponseWithDefaults() *ListBlueprintsResponse { + this := ListBlueprintsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListBlueprintsResponse) GetData() []BlueprintMetadataData { + if o == nil || o.Data == nil { + var ret []BlueprintMetadataData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBlueprintsResponse) GetDataOk() (*[]BlueprintMetadataData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListBlueprintsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []BlueprintMetadataData and assigns it to the Data field. +func (o *ListBlueprintsResponse) SetData(v []BlueprintMetadataData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListBlueprintsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListBlueprintsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []BlueprintMetadataData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_list_dashboards_usage_response.go b/api/datadogV2/model_list_dashboards_usage_response.go new file mode 100644 index 00000000000..0e289122aae --- /dev/null +++ b/api/datadogV2/model_list_dashboards_usage_response.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListDashboardsUsageResponse Paginated list of dashboard usage records. +type ListDashboardsUsageResponse struct { + // Dashboard usage records, one per dashboard in the caller's organization. + Data []DashboardUsage `json:"data"` + // Pagination links for a list of dashboard usage records. + Links *ListDashboardsUsageResponseLinks `json:"links,omitempty"` + // Pagination metadata for a list of dashboard usage records. + Meta ListDashboardsUsageResponseMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListDashboardsUsageResponse instantiates a new ListDashboardsUsageResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListDashboardsUsageResponse(data []DashboardUsage, meta ListDashboardsUsageResponseMeta) *ListDashboardsUsageResponse { + this := ListDashboardsUsageResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewListDashboardsUsageResponseWithDefaults instantiates a new ListDashboardsUsageResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListDashboardsUsageResponseWithDefaults() *ListDashboardsUsageResponse { + this := ListDashboardsUsageResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ListDashboardsUsageResponse) GetData() []DashboardUsage { + if o == nil { + var ret []DashboardUsage + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponse) GetDataOk() (*[]DashboardUsage, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ListDashboardsUsageResponse) SetData(v []DashboardUsage) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ListDashboardsUsageResponse) GetLinks() ListDashboardsUsageResponseLinks { + if o == nil || o.Links == nil { + var ret ListDashboardsUsageResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponse) GetLinksOk() (*ListDashboardsUsageResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given ListDashboardsUsageResponseLinks and assigns it to the Links field. +func (o *ListDashboardsUsageResponse) SetLinks(v ListDashboardsUsageResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value. +func (o *ListDashboardsUsageResponse) GetMeta() ListDashboardsUsageResponseMeta { + if o == nil { + var ret ListDashboardsUsageResponseMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponse) GetMetaOk() (*ListDashboardsUsageResponseMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *ListDashboardsUsageResponse) SetMeta(v ListDashboardsUsageResponseMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListDashboardsUsageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListDashboardsUsageResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]DashboardUsage `json:"data"` + Links *ListDashboardsUsageResponseLinks `json:"links,omitempty"` + Meta *ListDashboardsUsageResponseMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_dashboards_usage_response_links.go b/api/datadogV2/model_list_dashboards_usage_response_links.go new file mode 100644 index 00000000000..db7b36bdd53 --- /dev/null +++ b/api/datadogV2/model_list_dashboards_usage_response_links.go @@ -0,0 +1,275 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListDashboardsUsageResponseLinks Pagination links for a list of dashboard usage records. +type ListDashboardsUsageResponseLinks struct { + // Link to the first page. + First *string `json:"first,omitempty"` + // Link to the last page, or `null` if the total is unknown. + Last datadog.NullableString `json:"last,omitempty"` + // Link to the next page. Absent when there is no next page. + Next datadog.NullableString `json:"next,omitempty"` + // Link to the previous page. Absent when there is no previous page. + Prev datadog.NullableString `json:"prev,omitempty"` + // Link to the current page. + Self *string `json:"self,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListDashboardsUsageResponseLinks instantiates a new ListDashboardsUsageResponseLinks object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListDashboardsUsageResponseLinks() *ListDashboardsUsageResponseLinks { + this := ListDashboardsUsageResponseLinks{} + return &this +} + +// NewListDashboardsUsageResponseLinksWithDefaults instantiates a new ListDashboardsUsageResponseLinks object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListDashboardsUsageResponseLinksWithDefaults() *ListDashboardsUsageResponseLinks { + this := ListDashboardsUsageResponseLinks{} + return &this +} + +// GetFirst returns the First field value if set, zero value otherwise. +func (o *ListDashboardsUsageResponseLinks) GetFirst() string { + if o == nil || o.First == nil { + var ret string + return ret + } + return *o.First +} + +// GetFirstOk returns a tuple with the First field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponseLinks) GetFirstOk() (*string, bool) { + if o == nil || o.First == nil { + return nil, false + } + return o.First, true +} + +// HasFirst returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseLinks) HasFirst() bool { + return o != nil && o.First != nil +} + +// SetFirst gets a reference to the given string and assigns it to the First field. +func (o *ListDashboardsUsageResponseLinks) SetFirst(v string) { + o.First = &v +} + +// GetLast returns the Last field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListDashboardsUsageResponseLinks) GetLast() string { + if o == nil || o.Last.Get() == nil { + var ret string + return ret + } + return *o.Last.Get() +} + +// GetLastOk returns a tuple with the Last field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ListDashboardsUsageResponseLinks) GetLastOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Last.Get(), o.Last.IsSet() +} + +// HasLast returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseLinks) HasLast() bool { + return o != nil && o.Last.IsSet() +} + +// SetLast gets a reference to the given datadog.NullableString and assigns it to the Last field. +func (o *ListDashboardsUsageResponseLinks) SetLast(v string) { + o.Last.Set(&v) +} + +// SetLastNil sets the value for Last to be an explicit nil. +func (o *ListDashboardsUsageResponseLinks) SetLastNil() { + o.Last.Set(nil) +} + +// UnsetLast ensures that no value is present for Last, not even an explicit nil. +func (o *ListDashboardsUsageResponseLinks) UnsetLast() { + o.Last.Unset() +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListDashboardsUsageResponseLinks) GetNext() string { + if o == nil || o.Next.Get() == nil { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ListDashboardsUsageResponseLinks) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseLinks) HasNext() bool { + return o != nil && o.Next.IsSet() +} + +// SetNext gets a reference to the given datadog.NullableString and assigns it to the Next field. +func (o *ListDashboardsUsageResponseLinks) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil. +func (o *ListDashboardsUsageResponseLinks) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil. +func (o *ListDashboardsUsageResponseLinks) UnsetNext() { + o.Next.Unset() +} + +// GetPrev returns the Prev field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListDashboardsUsageResponseLinks) GetPrev() string { + if o == nil || o.Prev.Get() == nil { + var ret string + return ret + } + return *o.Prev.Get() +} + +// GetPrevOk returns a tuple with the Prev field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ListDashboardsUsageResponseLinks) GetPrevOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Prev.Get(), o.Prev.IsSet() +} + +// HasPrev returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseLinks) HasPrev() bool { + return o != nil && o.Prev.IsSet() +} + +// SetPrev gets a reference to the given datadog.NullableString and assigns it to the Prev field. +func (o *ListDashboardsUsageResponseLinks) SetPrev(v string) { + o.Prev.Set(&v) +} + +// SetPrevNil sets the value for Prev to be an explicit nil. +func (o *ListDashboardsUsageResponseLinks) SetPrevNil() { + o.Prev.Set(nil) +} + +// UnsetPrev ensures that no value is present for Prev, not even an explicit nil. +func (o *ListDashboardsUsageResponseLinks) UnsetPrev() { + o.Prev.Unset() +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *ListDashboardsUsageResponseLinks) GetSelf() string { + if o == nil || o.Self == nil { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponseLinks) GetSelfOk() (*string, bool) { + if o == nil || o.Self == nil { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseLinks) HasSelf() bool { + return o != nil && o.Self != nil +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *ListDashboardsUsageResponseLinks) SetSelf(v string) { + o.Self = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListDashboardsUsageResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.First != nil { + toSerialize["first"] = o.First + } + if o.Last.IsSet() { + toSerialize["last"] = o.Last.Get() + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Prev.IsSet() { + toSerialize["prev"] = o.Prev.Get() + } + if o.Self != nil { + toSerialize["self"] = o.Self + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListDashboardsUsageResponseLinks) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + First *string `json:"first,omitempty"` + Last datadog.NullableString `json:"last,omitempty"` + Next datadog.NullableString `json:"next,omitempty"` + Prev datadog.NullableString `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"first", "last", "next", "prev", "self"}) + } else { + return err + } + o.First = all.First + o.Last = all.Last + o.Next = all.Next + o.Prev = all.Prev + o.Self = all.Self + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_list_dashboards_usage_response_meta.go b/api/datadogV2/model_list_dashboards_usage_response_meta.go new file mode 100644 index 00000000000..d603fbb2600 --- /dev/null +++ b/api/datadogV2/model_list_dashboards_usage_response_meta.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListDashboardsUsageResponseMeta Pagination metadata for a list of dashboard usage records. +type ListDashboardsUsageResponseMeta struct { + // Offset-based pagination schema. + Page *PaginationMetaPage `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListDashboardsUsageResponseMeta instantiates a new ListDashboardsUsageResponseMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListDashboardsUsageResponseMeta() *ListDashboardsUsageResponseMeta { + this := ListDashboardsUsageResponseMeta{} + return &this +} + +// NewListDashboardsUsageResponseMetaWithDefaults instantiates a new ListDashboardsUsageResponseMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListDashboardsUsageResponseMetaWithDefaults() *ListDashboardsUsageResponseMeta { + this := ListDashboardsUsageResponseMeta{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *ListDashboardsUsageResponseMeta) GetPage() PaginationMetaPage { + if o == nil || o.Page == nil { + var ret PaginationMetaPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDashboardsUsageResponseMeta) GetPageOk() (*PaginationMetaPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *ListDashboardsUsageResponseMeta) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given PaginationMetaPage and assigns it to the Page field. +func (o *ListDashboardsUsageResponseMeta) SetPage(v PaginationMetaPage) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListDashboardsUsageResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListDashboardsUsageResponseMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *PaginationMetaPage `json:"page,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page"}) + } else { + return err + } + + hasInvalidField := false + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_scorecard_scores_meta.go b/api/datadogV2/model_list_scorecard_scores_meta.go new file mode 100644 index 00000000000..9912ad5284a --- /dev/null +++ b/api/datadogV2/model_list_scorecard_scores_meta.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListScorecardScoresMeta Pagination metadata for scores. +type ListScorecardScoresMeta struct { + // The number of results returned in this page. + Count *int64 `json:"count,omitempty"` + // The page limit. + Limit *int64 `json:"limit,omitempty"` + // The page offset. + Offset *int64 `json:"offset,omitempty"` + // The total number of results. + Total *int64 `json:"total,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListScorecardScoresMeta instantiates a new ListScorecardScoresMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListScorecardScoresMeta() *ListScorecardScoresMeta { + this := ListScorecardScoresMeta{} + return &this +} + +// NewListScorecardScoresMetaWithDefaults instantiates a new ListScorecardScoresMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListScorecardScoresMetaWithDefaults() *ListScorecardScoresMeta { + this := ListScorecardScoresMeta{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *ListScorecardScoresMeta) GetCount() int64 { + if o == nil || o.Count == nil { + var ret int64 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresMeta) GetCountOk() (*int64, bool) { + if o == nil || o.Count == nil { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *ListScorecardScoresMeta) HasCount() bool { + return o != nil && o.Count != nil +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +func (o *ListScorecardScoresMeta) SetCount(v int64) { + o.Count = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *ListScorecardScoresMeta) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresMeta) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *ListScorecardScoresMeta) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *ListScorecardScoresMeta) SetLimit(v int64) { + o.Limit = &v +} + +// GetOffset returns the Offset field value if set, zero value otherwise. +func (o *ListScorecardScoresMeta) GetOffset() int64 { + if o == nil || o.Offset == nil { + var ret int64 + return ret + } + return *o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresMeta) GetOffsetOk() (*int64, bool) { + if o == nil || o.Offset == nil { + return nil, false + } + return o.Offset, true +} + +// HasOffset returns a boolean if a field has been set. +func (o *ListScorecardScoresMeta) HasOffset() bool { + return o != nil && o.Offset != nil +} + +// SetOffset gets a reference to the given int64 and assigns it to the Offset field. +func (o *ListScorecardScoresMeta) SetOffset(v int64) { + o.Offset = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *ListScorecardScoresMeta) GetTotal() int64 { + if o == nil || o.Total == nil { + var ret int64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresMeta) GetTotalOk() (*int64, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *ListScorecardScoresMeta) HasTotal() bool { + return o != nil && o.Total != nil +} + +// SetTotal gets a reference to the given int64 and assigns it to the Total field. +func (o *ListScorecardScoresMeta) SetTotal(v int64) { + o.Total = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListScorecardScoresMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Count != nil { + toSerialize["count"] = o.Count + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListScorecardScoresMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Count *int64 `json:"count,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + Total *int64 `json:"total,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"count", "limit", "offset", "total"}) + } else { + return err + } + o.Count = all.Count + o.Limit = all.Limit + o.Offset = all.Offset + o.Total = all.Total + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_list_scorecard_scores_response.go b/api/datadogV2/model_list_scorecard_scores_response.go new file mode 100644 index 00000000000..f5b8928546e --- /dev/null +++ b/api/datadogV2/model_list_scorecard_scores_response.go @@ -0,0 +1,184 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListScorecardScoresResponse A list of scorecard scores for a given aggregation type. +type ListScorecardScoresResponse struct { + // Array of score objects. + Data []ScorecardScoreData `json:"data,omitempty"` + // Links attributes. + Links *ListRulesResponseLinks `json:"links,omitempty"` + // Pagination metadata for scores. + Meta *ListScorecardScoresMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListScorecardScoresResponse instantiates a new ListScorecardScoresResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListScorecardScoresResponse() *ListScorecardScoresResponse { + this := ListScorecardScoresResponse{} + return &this +} + +// NewListScorecardScoresResponseWithDefaults instantiates a new ListScorecardScoresResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListScorecardScoresResponseWithDefaults() *ListScorecardScoresResponse { + this := ListScorecardScoresResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListScorecardScoresResponse) GetData() []ScorecardScoreData { + if o == nil || o.Data == nil { + var ret []ScorecardScoreData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresResponse) GetDataOk() (*[]ScorecardScoreData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListScorecardScoresResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []ScorecardScoreData and assigns it to the Data field. +func (o *ListScorecardScoresResponse) SetData(v []ScorecardScoreData) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ListScorecardScoresResponse) GetLinks() ListRulesResponseLinks { + if o == nil || o.Links == nil { + var ret ListRulesResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresResponse) GetLinksOk() (*ListRulesResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ListScorecardScoresResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given ListRulesResponseLinks and assigns it to the Links field. +func (o *ListScorecardScoresResponse) SetLinks(v ListRulesResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ListScorecardScoresResponse) GetMeta() ListScorecardScoresMeta { + if o == nil || o.Meta == nil { + var ret ListScorecardScoresMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListScorecardScoresResponse) GetMetaOk() (*ListScorecardScoresMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ListScorecardScoresResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given ListScorecardScoresMeta and assigns it to the Meta field. +func (o *ListScorecardScoresResponse) SetMeta(v ListScorecardScoresMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListScorecardScoresResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Links != nil { + toSerialize["links"] = o.Links + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListScorecardScoresResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []ScorecardScoreData `json:"data,omitempty"` + Links *ListRulesResponseLinks `json:"links,omitempty"` + Meta *ListScorecardScoresMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotated_interaction_item.go b/api/datadogV2/model_llm_obs_annotated_interaction_item.go index 116be59d97e..9fea69a4ccf 100644 --- a/api/datadogV2/model_llm_obs_annotated_interaction_item.go +++ b/api/datadogV2/model_llm_obs_annotated_interaction_item.go @@ -5,203 +5,101 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// LLMObsAnnotatedInteractionItem An interaction with its associated annotations. +// LLMObsAnnotatedInteractionItem - An interaction with its associated annotations. type LLMObsAnnotatedInteractionItem struct { - // List of annotations for this interaction. - Annotations []LLMObsAnnotationItem `json:"annotations"` - // Identifier of the content (trace ID or session ID) for this interaction. - ContentId string `json:"content_id"` - // Unique identifier of the interaction. - Id string `json:"id"` - // Type of interaction in an annotation queue. - Type LLMObsInteractionType `json:"type"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewLLMObsAnnotatedInteractionItem instantiates a new LLMObsAnnotatedInteractionItem object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewLLMObsAnnotatedInteractionItem(annotations []LLMObsAnnotationItem, contentId string, id string, typeVar LLMObsInteractionType) *LLMObsAnnotatedInteractionItem { - this := LLMObsAnnotatedInteractionItem{} - this.Annotations = annotations - this.ContentId = contentId - this.Id = id - this.Type = typeVar - return &this -} - -// NewLLMObsAnnotatedInteractionItemWithDefaults instantiates a new LLMObsAnnotatedInteractionItem object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewLLMObsAnnotatedInteractionItemWithDefaults() *LLMObsAnnotatedInteractionItem { - this := LLMObsAnnotatedInteractionItem{} - return &this -} - -// GetAnnotations returns the Annotations field value. -func (o *LLMObsAnnotatedInteractionItem) GetAnnotations() []LLMObsAnnotationItem { - if o == nil { - var ret []LLMObsAnnotationItem - return ret - } - return o.Annotations -} - -// GetAnnotationsOk returns a tuple with the Annotations field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotatedInteractionItem) GetAnnotationsOk() (*[]LLMObsAnnotationItem, bool) { - if o == nil { - return nil, false - } - return &o.Annotations, true -} - -// SetAnnotations sets field value. -func (o *LLMObsAnnotatedInteractionItem) SetAnnotations(v []LLMObsAnnotationItem) { - o.Annotations = v -} - -// GetContentId returns the ContentId field value. -func (o *LLMObsAnnotatedInteractionItem) GetContentId() string { - if o == nil { - var ret string - return ret - } - return o.ContentId -} - -// GetContentIdOk returns a tuple with the ContentId field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotatedInteractionItem) GetContentIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ContentId, true -} - -// SetContentId sets field value. -func (o *LLMObsAnnotatedInteractionItem) SetContentId(v string) { - o.ContentId = v -} + LLMObsTraceAnnotatedInteractionItem *LLMObsTraceAnnotatedInteractionItem + LLMObsDisplayBlockAnnotatedInteractionItem *LLMObsDisplayBlockAnnotatedInteractionItem -// GetId returns the Id field value. -func (o *LLMObsAnnotatedInteractionItem) GetId() string { - if o == nil { - var ret string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotatedInteractionItem) GetIdOk() (*string, bool) { - if o == nil { - return nil, false + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// LLMObsTraceAnnotatedInteractionItemAsLLMObsAnnotatedInteractionItem is a convenience function that returns LLMObsTraceAnnotatedInteractionItem wrapped in LLMObsAnnotatedInteractionItem. +func LLMObsTraceAnnotatedInteractionItemAsLLMObsAnnotatedInteractionItem(v *LLMObsTraceAnnotatedInteractionItem) LLMObsAnnotatedInteractionItem { + return LLMObsAnnotatedInteractionItem{LLMObsTraceAnnotatedInteractionItem: v} +} + +// LLMObsDisplayBlockAnnotatedInteractionItemAsLLMObsAnnotatedInteractionItem is a convenience function that returns LLMObsDisplayBlockAnnotatedInteractionItem wrapped in LLMObsAnnotatedInteractionItem. +func LLMObsDisplayBlockAnnotatedInteractionItemAsLLMObsAnnotatedInteractionItem(v *LLMObsDisplayBlockAnnotatedInteractionItem) LLMObsAnnotatedInteractionItem { + return LLMObsAnnotatedInteractionItem{LLMObsDisplayBlockAnnotatedInteractionItem: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *LLMObsAnnotatedInteractionItem) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into LLMObsTraceAnnotatedInteractionItem + err = datadog.Unmarshal(data, &obj.LLMObsTraceAnnotatedInteractionItem) + if err == nil { + if obj.LLMObsTraceAnnotatedInteractionItem != nil && obj.LLMObsTraceAnnotatedInteractionItem.UnparsedObject == nil { + jsonLLMObsTraceAnnotatedInteractionItem, _ := datadog.Marshal(obj.LLMObsTraceAnnotatedInteractionItem) + if string(jsonLLMObsTraceAnnotatedInteractionItem) == "{}" { // empty struct + obj.LLMObsTraceAnnotatedInteractionItem = nil + } else { + match++ + } + } else { + obj.LLMObsTraceAnnotatedInteractionItem = nil + } + } else { + obj.LLMObsTraceAnnotatedInteractionItem = nil + } + + // try to unmarshal data into LLMObsDisplayBlockAnnotatedInteractionItem + err = datadog.Unmarshal(data, &obj.LLMObsDisplayBlockAnnotatedInteractionItem) + if err == nil { + if obj.LLMObsDisplayBlockAnnotatedInteractionItem != nil && obj.LLMObsDisplayBlockAnnotatedInteractionItem.UnparsedObject == nil { + jsonLLMObsDisplayBlockAnnotatedInteractionItem, _ := datadog.Marshal(obj.LLMObsDisplayBlockAnnotatedInteractionItem) + if string(jsonLLMObsDisplayBlockAnnotatedInteractionItem) == "{}" { // empty struct + obj.LLMObsDisplayBlockAnnotatedInteractionItem = nil + } else { + match++ + } + } else { + obj.LLMObsDisplayBlockAnnotatedInteractionItem = nil + } + } else { + obj.LLMObsDisplayBlockAnnotatedInteractionItem = nil } - return &o.Id, true -} - -// SetId sets field value. -func (o *LLMObsAnnotatedInteractionItem) SetId(v string) { - o.Id = v -} -// GetType returns the Type field value. -func (o *LLMObsAnnotatedInteractionItem) GetType() LLMObsInteractionType { - if o == nil { - var ret LLMObsInteractionType - return ret + if match != 1 { // more than 1 match + // reset to nil + obj.LLMObsTraceAnnotatedInteractionItem = nil + obj.LLMObsDisplayBlockAnnotatedInteractionItem = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) } - return o.Type + return nil // exactly one match } -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotatedInteractionItem) GetTypeOk() (*LLMObsInteractionType, bool) { - if o == nil { - return nil, false +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj LLMObsAnnotatedInteractionItem) MarshalJSON() ([]byte, error) { + if obj.LLMObsTraceAnnotatedInteractionItem != nil { + return datadog.Marshal(&obj.LLMObsTraceAnnotatedInteractionItem) } - return &o.Type, true -} - -// SetType sets field value. -func (o *LLMObsAnnotatedInteractionItem) SetType(v LLMObsInteractionType) { - o.Type = v -} -// MarshalJSON serializes the struct using spec logic. -func (o LLMObsAnnotatedInteractionItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) + if obj.LLMObsDisplayBlockAnnotatedInteractionItem != nil { + return datadog.Marshal(&obj.LLMObsDisplayBlockAnnotatedInteractionItem) } - toSerialize["annotations"] = o.Annotations - toSerialize["content_id"] = o.ContentId - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type - for key, value := range o.AdditionalProperties { - toSerialize[key] = value + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) } - return datadog.Marshal(toSerialize) + return nil, nil // no data in oneOf schemas } -// UnmarshalJSON deserializes the given payload. -func (o *LLMObsAnnotatedInteractionItem) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Annotations *[]LLMObsAnnotationItem `json:"annotations"` - ContentId *string `json:"content_id"` - Id *string `json:"id"` - Type *LLMObsInteractionType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Annotations == nil { - return fmt.Errorf("required field annotations missing") - } - if all.ContentId == nil { - return fmt.Errorf("required field content_id missing") - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"annotations", "content_id", "id", "type"}) - } else { - return err - } - - hasInvalidField := false - o.Annotations = *all.Annotations - o.ContentId = *all.ContentId - o.Id = *all.Id - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties +// GetActualInstance returns the actual instance. +func (obj *LLMObsAnnotatedInteractionItem) GetActualInstance() interface{} { + if obj.LLMObsTraceAnnotatedInteractionItem != nil { + return obj.LLMObsTraceAnnotatedInteractionItem } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) + if obj.LLMObsDisplayBlockAnnotatedInteractionItem != nil { + return obj.LLMObsDisplayBlockAnnotatedInteractionItem } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go b/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go index 50cf6436a56..deff3522a7b 100644 --- a/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go +++ b/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go @@ -5,139 +5,101 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// LLMObsAnnotationQueueInteractionItem A single interaction to add to an annotation queue. +// LLMObsAnnotationQueueInteractionItem - A single interaction to add to an annotation queue. type LLMObsAnnotationQueueInteractionItem struct { - // Identifier of the content (trace ID or session ID) for this interaction. - ContentId string `json:"content_id"` - // Type of interaction in an annotation queue. - Type LLMObsInteractionType `json:"type"` + LLMObsTraceInteractionItem *LLMObsTraceInteractionItem + LLMObsDisplayBlockInteractionItem *LLMObsDisplayBlockInteractionItem + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` + UnparsedObject interface{} } -// NewLLMObsAnnotationQueueInteractionItem instantiates a new LLMObsAnnotationQueueInteractionItem object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewLLMObsAnnotationQueueInteractionItem(contentId string, typeVar LLMObsInteractionType) *LLMObsAnnotationQueueInteractionItem { - this := LLMObsAnnotationQueueInteractionItem{} - this.ContentId = contentId - this.Type = typeVar - return &this +// LLMObsTraceInteractionItemAsLLMObsAnnotationQueueInteractionItem is a convenience function that returns LLMObsTraceInteractionItem wrapped in LLMObsAnnotationQueueInteractionItem. +func LLMObsTraceInteractionItemAsLLMObsAnnotationQueueInteractionItem(v *LLMObsTraceInteractionItem) LLMObsAnnotationQueueInteractionItem { + return LLMObsAnnotationQueueInteractionItem{LLMObsTraceInteractionItem: v} } -// NewLLMObsAnnotationQueueInteractionItemWithDefaults instantiates a new LLMObsAnnotationQueueInteractionItem object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewLLMObsAnnotationQueueInteractionItemWithDefaults() *LLMObsAnnotationQueueInteractionItem { - this := LLMObsAnnotationQueueInteractionItem{} - return &this +// LLMObsDisplayBlockInteractionItemAsLLMObsAnnotationQueueInteractionItem is a convenience function that returns LLMObsDisplayBlockInteractionItem wrapped in LLMObsAnnotationQueueInteractionItem. +func LLMObsDisplayBlockInteractionItemAsLLMObsAnnotationQueueInteractionItem(v *LLMObsDisplayBlockInteractionItem) LLMObsAnnotationQueueInteractionItem { + return LLMObsAnnotationQueueInteractionItem{LLMObsDisplayBlockInteractionItem: v} } -// GetContentId returns the ContentId field value. -func (o *LLMObsAnnotationQueueInteractionItem) GetContentId() string { - if o == nil { - var ret string - return ret +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *LLMObsAnnotationQueueInteractionItem) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into LLMObsTraceInteractionItem + err = datadog.Unmarshal(data, &obj.LLMObsTraceInteractionItem) + if err == nil { + if obj.LLMObsTraceInteractionItem != nil && obj.LLMObsTraceInteractionItem.UnparsedObject == nil { + jsonLLMObsTraceInteractionItem, _ := datadog.Marshal(obj.LLMObsTraceInteractionItem) + if string(jsonLLMObsTraceInteractionItem) == "{}" { // empty struct + obj.LLMObsTraceInteractionItem = nil + } else { + match++ + } + } else { + obj.LLMObsTraceInteractionItem = nil + } + } else { + obj.LLMObsTraceInteractionItem = nil } - return o.ContentId -} -// GetContentIdOk returns a tuple with the ContentId field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionItem) GetContentIdOk() (*string, bool) { - if o == nil { - return nil, false + // try to unmarshal data into LLMObsDisplayBlockInteractionItem + err = datadog.Unmarshal(data, &obj.LLMObsDisplayBlockInteractionItem) + if err == nil { + if obj.LLMObsDisplayBlockInteractionItem != nil && obj.LLMObsDisplayBlockInteractionItem.UnparsedObject == nil { + jsonLLMObsDisplayBlockInteractionItem, _ := datadog.Marshal(obj.LLMObsDisplayBlockInteractionItem) + if string(jsonLLMObsDisplayBlockInteractionItem) == "{}" { // empty struct + obj.LLMObsDisplayBlockInteractionItem = nil + } else { + match++ + } + } else { + obj.LLMObsDisplayBlockInteractionItem = nil + } + } else { + obj.LLMObsDisplayBlockInteractionItem = nil } - return &o.ContentId, true -} - -// SetContentId sets field value. -func (o *LLMObsAnnotationQueueInteractionItem) SetContentId(v string) { - o.ContentId = v -} -// GetType returns the Type field value. -func (o *LLMObsAnnotationQueueInteractionItem) GetType() LLMObsInteractionType { - if o == nil { - var ret LLMObsInteractionType - return ret + if match != 1 { // more than 1 match + // reset to nil + obj.LLMObsTraceInteractionItem = nil + obj.LLMObsDisplayBlockInteractionItem = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) } - return o.Type + return nil // exactly one match } -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionItem) GetTypeOk() (*LLMObsInteractionType, bool) { - if o == nil { - return nil, false +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj LLMObsAnnotationQueueInteractionItem) MarshalJSON() ([]byte, error) { + if obj.LLMObsTraceInteractionItem != nil { + return datadog.Marshal(&obj.LLMObsTraceInteractionItem) } - return &o.Type, true -} - -// SetType sets field value. -func (o *LLMObsAnnotationQueueInteractionItem) SetType(v LLMObsInteractionType) { - o.Type = v -} -// MarshalJSON serializes the struct using spec logic. -func (o LLMObsAnnotationQueueInteractionItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) + if obj.LLMObsDisplayBlockInteractionItem != nil { + return datadog.Marshal(&obj.LLMObsDisplayBlockInteractionItem) } - toSerialize["content_id"] = o.ContentId - toSerialize["type"] = o.Type - for key, value := range o.AdditionalProperties { - toSerialize[key] = value + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) } - return datadog.Marshal(toSerialize) + return nil, nil // no data in oneOf schemas } -// UnmarshalJSON deserializes the given payload. -func (o *LLMObsAnnotationQueueInteractionItem) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - ContentId *string `json:"content_id"` - Type *LLMObsInteractionType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.ContentId == nil { - return fmt.Errorf("required field content_id missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"content_id", "type"}) - } else { - return err - } - - hasInvalidField := false - o.ContentId = *all.ContentId - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties +// GetActualInstance returns the actual instance. +func (obj *LLMObsAnnotationQueueInteractionItem) GetActualInstance() interface{} { + if obj.LLMObsTraceInteractionItem != nil { + return obj.LLMObsTraceInteractionItem } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) + if obj.LLMObsDisplayBlockInteractionItem != nil { + return obj.LLMObsDisplayBlockInteractionItem } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go b/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go index 8df925d300a..cc2bc055ed8 100644 --- a/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go +++ b/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go @@ -5,203 +5,101 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// LLMObsAnnotationQueueInteractionResponseItem A single interaction result. +// LLMObsAnnotationQueueInteractionResponseItem - A single interaction result. type LLMObsAnnotationQueueInteractionResponseItem struct { - // Whether this interaction already existed in the queue. - AlreadyExisted bool `json:"already_existed"` - // Identifier of the content (trace ID or session ID) for this interaction. - ContentId string `json:"content_id"` - // Unique identifier of the interaction. - Id string `json:"id"` - // Type of interaction in an annotation queue. - Type LLMObsInteractionType `json:"type"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewLLMObsAnnotationQueueInteractionResponseItem instantiates a new LLMObsAnnotationQueueInteractionResponseItem object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewLLMObsAnnotationQueueInteractionResponseItem(alreadyExisted bool, contentId string, id string, typeVar LLMObsInteractionType) *LLMObsAnnotationQueueInteractionResponseItem { - this := LLMObsAnnotationQueueInteractionResponseItem{} - this.AlreadyExisted = alreadyExisted - this.ContentId = contentId - this.Id = id - this.Type = typeVar - return &this -} - -// NewLLMObsAnnotationQueueInteractionResponseItemWithDefaults instantiates a new LLMObsAnnotationQueueInteractionResponseItem object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewLLMObsAnnotationQueueInteractionResponseItemWithDefaults() *LLMObsAnnotationQueueInteractionResponseItem { - this := LLMObsAnnotationQueueInteractionResponseItem{} - return &this -} - -// GetAlreadyExisted returns the AlreadyExisted field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetAlreadyExisted() bool { - if o == nil { - var ret bool - return ret - } - return o.AlreadyExisted -} - -// GetAlreadyExistedOk returns a tuple with the AlreadyExisted field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetAlreadyExistedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.AlreadyExisted, true -} - -// SetAlreadyExisted sets field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) SetAlreadyExisted(v bool) { - o.AlreadyExisted = v -} - -// GetContentId returns the ContentId field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetContentId() string { - if o == nil { - var ret string - return ret - } - return o.ContentId -} - -// GetContentIdOk returns a tuple with the ContentId field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetContentIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ContentId, true -} - -// SetContentId sets field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) SetContentId(v string) { - o.ContentId = v -} + LLMObsTraceInteractionResponseItem *LLMObsTraceInteractionResponseItem + LLMObsDisplayBlockInteractionResponseItem *LLMObsDisplayBlockInteractionResponseItem -// GetId returns the Id field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetId() string { - if o == nil { - var ret string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetIdOk() (*string, bool) { - if o == nil { - return nil, false + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// LLMObsTraceInteractionResponseItemAsLLMObsAnnotationQueueInteractionResponseItem is a convenience function that returns LLMObsTraceInteractionResponseItem wrapped in LLMObsAnnotationQueueInteractionResponseItem. +func LLMObsTraceInteractionResponseItemAsLLMObsAnnotationQueueInteractionResponseItem(v *LLMObsTraceInteractionResponseItem) LLMObsAnnotationQueueInteractionResponseItem { + return LLMObsAnnotationQueueInteractionResponseItem{LLMObsTraceInteractionResponseItem: v} +} + +// LLMObsDisplayBlockInteractionResponseItemAsLLMObsAnnotationQueueInteractionResponseItem is a convenience function that returns LLMObsDisplayBlockInteractionResponseItem wrapped in LLMObsAnnotationQueueInteractionResponseItem. +func LLMObsDisplayBlockInteractionResponseItemAsLLMObsAnnotationQueueInteractionResponseItem(v *LLMObsDisplayBlockInteractionResponseItem) LLMObsAnnotationQueueInteractionResponseItem { + return LLMObsAnnotationQueueInteractionResponseItem{LLMObsDisplayBlockInteractionResponseItem: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *LLMObsAnnotationQueueInteractionResponseItem) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into LLMObsTraceInteractionResponseItem + err = datadog.Unmarshal(data, &obj.LLMObsTraceInteractionResponseItem) + if err == nil { + if obj.LLMObsTraceInteractionResponseItem != nil && obj.LLMObsTraceInteractionResponseItem.UnparsedObject == nil { + jsonLLMObsTraceInteractionResponseItem, _ := datadog.Marshal(obj.LLMObsTraceInteractionResponseItem) + if string(jsonLLMObsTraceInteractionResponseItem) == "{}" { // empty struct + obj.LLMObsTraceInteractionResponseItem = nil + } else { + match++ + } + } else { + obj.LLMObsTraceInteractionResponseItem = nil + } + } else { + obj.LLMObsTraceInteractionResponseItem = nil + } + + // try to unmarshal data into LLMObsDisplayBlockInteractionResponseItem + err = datadog.Unmarshal(data, &obj.LLMObsDisplayBlockInteractionResponseItem) + if err == nil { + if obj.LLMObsDisplayBlockInteractionResponseItem != nil && obj.LLMObsDisplayBlockInteractionResponseItem.UnparsedObject == nil { + jsonLLMObsDisplayBlockInteractionResponseItem, _ := datadog.Marshal(obj.LLMObsDisplayBlockInteractionResponseItem) + if string(jsonLLMObsDisplayBlockInteractionResponseItem) == "{}" { // empty struct + obj.LLMObsDisplayBlockInteractionResponseItem = nil + } else { + match++ + } + } else { + obj.LLMObsDisplayBlockInteractionResponseItem = nil + } + } else { + obj.LLMObsDisplayBlockInteractionResponseItem = nil } - return &o.Id, true -} - -// SetId sets field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) SetId(v string) { - o.Id = v -} -// GetType returns the Type field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetType() LLMObsInteractionType { - if o == nil { - var ret LLMObsInteractionType - return ret + if match != 1 { // more than 1 match + // reset to nil + obj.LLMObsTraceInteractionResponseItem = nil + obj.LLMObsDisplayBlockInteractionResponseItem = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) } - return o.Type + return nil // exactly one match } -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *LLMObsAnnotationQueueInteractionResponseItem) GetTypeOk() (*LLMObsInteractionType, bool) { - if o == nil { - return nil, false +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj LLMObsAnnotationQueueInteractionResponseItem) MarshalJSON() ([]byte, error) { + if obj.LLMObsTraceInteractionResponseItem != nil { + return datadog.Marshal(&obj.LLMObsTraceInteractionResponseItem) } - return &o.Type, true -} - -// SetType sets field value. -func (o *LLMObsAnnotationQueueInteractionResponseItem) SetType(v LLMObsInteractionType) { - o.Type = v -} -// MarshalJSON serializes the struct using spec logic. -func (o LLMObsAnnotationQueueInteractionResponseItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) + if obj.LLMObsDisplayBlockInteractionResponseItem != nil { + return datadog.Marshal(&obj.LLMObsDisplayBlockInteractionResponseItem) } - toSerialize["already_existed"] = o.AlreadyExisted - toSerialize["content_id"] = o.ContentId - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type - for key, value := range o.AdditionalProperties { - toSerialize[key] = value + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) } - return datadog.Marshal(toSerialize) + return nil, nil // no data in oneOf schemas } -// UnmarshalJSON deserializes the given payload. -func (o *LLMObsAnnotationQueueInteractionResponseItem) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - AlreadyExisted *bool `json:"already_existed"` - ContentId *string `json:"content_id"` - Id *string `json:"id"` - Type *LLMObsInteractionType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.AlreadyExisted == nil { - return fmt.Errorf("required field already_existed missing") - } - if all.ContentId == nil { - return fmt.Errorf("required field content_id missing") - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"already_existed", "content_id", "id", "type"}) - } else { - return err - } - - hasInvalidField := false - o.AlreadyExisted = *all.AlreadyExisted - o.ContentId = *all.ContentId - o.Id = *all.Id - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties +// GetActualInstance returns the actual instance. +func (obj *LLMObsAnnotationQueueInteractionResponseItem) GetActualInstance() interface{} { + if obj.LLMObsTraceInteractionResponseItem != nil { + return obj.LLMObsTraceInteractionResponseItem } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) + if obj.LLMObsDisplayBlockInteractionResponseItem != nil { + return obj.LLMObsDisplayBlockInteractionResponseItem } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_llm_obs_anthropic_effort.go b/api/datadogV2/model_llm_obs_anthropic_effort.go new file mode 100644 index 00000000000..71150a66c54 --- /dev/null +++ b/api/datadogV2/model_llm_obs_anthropic_effort.go @@ -0,0 +1,114 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnthropicEffort The effort level for Anthropic inference. +type LLMObsAnthropicEffort string + +// List of LLMObsAnthropicEffort. +const ( + LLMOBSANTHROPICEFFORT_LOW LLMObsAnthropicEffort = "low" + LLMOBSANTHROPICEFFORT_MEDIUM LLMObsAnthropicEffort = "medium" + LLMOBSANTHROPICEFFORT_HIGH LLMObsAnthropicEffort = "high" + LLMOBSANTHROPICEFFORT_MAX LLMObsAnthropicEffort = "max" +) + +var allowedLLMObsAnthropicEffortEnumValues = []LLMObsAnthropicEffort{ + LLMOBSANTHROPICEFFORT_LOW, + LLMOBSANTHROPICEFFORT_MEDIUM, + LLMOBSANTHROPICEFFORT_HIGH, + LLMOBSANTHROPICEFFORT_MAX, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsAnthropicEffort) GetAllowedValues() []LLMObsAnthropicEffort { + return allowedLLMObsAnthropicEffortEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsAnthropicEffort) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsAnthropicEffort(value) + return nil +} + +// NewLLMObsAnthropicEffortFromValue returns a pointer to a valid LLMObsAnthropicEffort +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsAnthropicEffortFromValue(v string) (*LLMObsAnthropicEffort, error) { + ev := LLMObsAnthropicEffort(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsAnthropicEffort: valid values are %v", v, allowedLLMObsAnthropicEffortEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsAnthropicEffort) IsValid() bool { + for _, existing := range allowedLLMObsAnthropicEffortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsAnthropicEffort value. +func (v LLMObsAnthropicEffort) Ptr() *LLMObsAnthropicEffort { + return &v +} + +// NullableLLMObsAnthropicEffort handles when a null is used for LLMObsAnthropicEffort. +type NullableLLMObsAnthropicEffort struct { + value *LLMObsAnthropicEffort + isSet bool +} + +// Get returns the associated value. +func (v NullableLLMObsAnthropicEffort) Get() *LLMObsAnthropicEffort { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableLLMObsAnthropicEffort) Set(val *LLMObsAnthropicEffort) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableLLMObsAnthropicEffort) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableLLMObsAnthropicEffort) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLLMObsAnthropicEffort initializes the struct as if Set has been called. +func NewNullableLLMObsAnthropicEffort(val *LLMObsAnthropicEffort) *NullableLLMObsAnthropicEffort { + return &NullableLLMObsAnthropicEffort{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableLLMObsAnthropicEffort) MarshalJSON() ([]byte, error) { + return datadog.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableLLMObsAnthropicEffort) UnmarshalJSON(src []byte) error { + v.isSet = true + return datadog.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_llm_obs_anthropic_metadata.go b/api/datadogV2/model_llm_obs_anthropic_metadata.go new file mode 100644 index 00000000000..223094f001d --- /dev/null +++ b/api/datadogV2/model_llm_obs_anthropic_metadata.go @@ -0,0 +1,161 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnthropicMetadata Anthropic-specific metadata for an inference request. +type LLMObsAnthropicMetadata struct { + // The effort level for Anthropic inference. + Effort NullableLLMObsAnthropicEffort `json:"effort,omitempty"` + // Configuration for Anthropic extended thinking feature. + Thinking *LLMObsAnthropicThinkingConfig `json:"thinking,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnthropicMetadata instantiates a new LLMObsAnthropicMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnthropicMetadata() *LLMObsAnthropicMetadata { + this := LLMObsAnthropicMetadata{} + return &this +} + +// NewLLMObsAnthropicMetadataWithDefaults instantiates a new LLMObsAnthropicMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnthropicMetadataWithDefaults() *LLMObsAnthropicMetadata { + this := LLMObsAnthropicMetadata{} + return &this +} + +// GetEffort returns the Effort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsAnthropicMetadata) GetEffort() LLMObsAnthropicEffort { + if o == nil || o.Effort.Get() == nil { + var ret LLMObsAnthropicEffort + return ret + } + return *o.Effort.Get() +} + +// GetEffortOk returns a tuple with the Effort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsAnthropicMetadata) GetEffortOk() (*LLMObsAnthropicEffort, bool) { + if o == nil { + return nil, false + } + return o.Effort.Get(), o.Effort.IsSet() +} + +// HasEffort returns a boolean if a field has been set. +func (o *LLMObsAnthropicMetadata) HasEffort() bool { + return o != nil && o.Effort.IsSet() +} + +// SetEffort gets a reference to the given NullableLLMObsAnthropicEffort and assigns it to the Effort field. +func (o *LLMObsAnthropicMetadata) SetEffort(v LLMObsAnthropicEffort) { + o.Effort.Set(&v) +} + +// SetEffortNil sets the value for Effort to be an explicit nil. +func (o *LLMObsAnthropicMetadata) SetEffortNil() { + o.Effort.Set(nil) +} + +// UnsetEffort ensures that no value is present for Effort, not even an explicit nil. +func (o *LLMObsAnthropicMetadata) UnsetEffort() { + o.Effort.Unset() +} + +// GetThinking returns the Thinking field value if set, zero value otherwise. +func (o *LLMObsAnthropicMetadata) GetThinking() LLMObsAnthropicThinkingConfig { + if o == nil || o.Thinking == nil { + var ret LLMObsAnthropicThinkingConfig + return ret + } + return *o.Thinking +} + +// GetThinkingOk returns a tuple with the Thinking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAnthropicMetadata) GetThinkingOk() (*LLMObsAnthropicThinkingConfig, bool) { + if o == nil || o.Thinking == nil { + return nil, false + } + return o.Thinking, true +} + +// HasThinking returns a boolean if a field has been set. +func (o *LLMObsAnthropicMetadata) HasThinking() bool { + return o != nil && o.Thinking != nil +} + +// SetThinking gets a reference to the given LLMObsAnthropicThinkingConfig and assigns it to the Thinking field. +func (o *LLMObsAnthropicMetadata) SetThinking(v LLMObsAnthropicThinkingConfig) { + o.Thinking = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnthropicMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Effort.IsSet() { + toSerialize["effort"] = o.Effort.Get() + } + if o.Thinking != nil { + toSerialize["thinking"] = o.Thinking + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnthropicMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Effort NullableLLMObsAnthropicEffort `json:"effort,omitempty"` + Thinking *LLMObsAnthropicThinkingConfig `json:"thinking,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"effort", "thinking"}) + } else { + return err + } + + hasInvalidField := false + if all.Effort.Get() != nil && !all.Effort.Get().IsValid() { + hasInvalidField = true + } else { + o.Effort = all.Effort + } + if all.Thinking != nil && all.Thinking.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Thinking = all.Thinking + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_anthropic_thinking_config.go b/api/datadogV2/model_llm_obs_anthropic_thinking_config.go new file mode 100644 index 00000000000..dbe08f8b660 --- /dev/null +++ b/api/datadogV2/model_llm_obs_anthropic_thinking_config.go @@ -0,0 +1,157 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnthropicThinkingConfig Configuration for Anthropic extended thinking feature. +type LLMObsAnthropicThinkingConfig struct { + // Maximum token budget for extended thinking. Required when type is `enabled`. + BudgetTokens datadog.NullableInt64 `json:"budget_tokens,omitempty"` + // The thinking mode for Anthropic extended thinking. + Type LLMObsAnthropicThinkingType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnthropicThinkingConfig instantiates a new LLMObsAnthropicThinkingConfig object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnthropicThinkingConfig(typeVar LLMObsAnthropicThinkingType) *LLMObsAnthropicThinkingConfig { + this := LLMObsAnthropicThinkingConfig{} + this.Type = typeVar + return &this +} + +// NewLLMObsAnthropicThinkingConfigWithDefaults instantiates a new LLMObsAnthropicThinkingConfig object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnthropicThinkingConfigWithDefaults() *LLMObsAnthropicThinkingConfig { + this := LLMObsAnthropicThinkingConfig{} + return &this +} + +// GetBudgetTokens returns the BudgetTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsAnthropicThinkingConfig) GetBudgetTokens() int64 { + if o == nil || o.BudgetTokens.Get() == nil { + var ret int64 + return ret + } + return *o.BudgetTokens.Get() +} + +// GetBudgetTokensOk returns a tuple with the BudgetTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsAnthropicThinkingConfig) GetBudgetTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.BudgetTokens.Get(), o.BudgetTokens.IsSet() +} + +// HasBudgetTokens returns a boolean if a field has been set. +func (o *LLMObsAnthropicThinkingConfig) HasBudgetTokens() bool { + return o != nil && o.BudgetTokens.IsSet() +} + +// SetBudgetTokens gets a reference to the given datadog.NullableInt64 and assigns it to the BudgetTokens field. +func (o *LLMObsAnthropicThinkingConfig) SetBudgetTokens(v int64) { + o.BudgetTokens.Set(&v) +} + +// SetBudgetTokensNil sets the value for BudgetTokens to be an explicit nil. +func (o *LLMObsAnthropicThinkingConfig) SetBudgetTokensNil() { + o.BudgetTokens.Set(nil) +} + +// UnsetBudgetTokens ensures that no value is present for BudgetTokens, not even an explicit nil. +func (o *LLMObsAnthropicThinkingConfig) UnsetBudgetTokens() { + o.BudgetTokens.Unset() +} + +// GetType returns the Type field value. +func (o *LLMObsAnthropicThinkingConfig) GetType() LLMObsAnthropicThinkingType { + if o == nil { + var ret LLMObsAnthropicThinkingType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnthropicThinkingConfig) GetTypeOk() (*LLMObsAnthropicThinkingType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnthropicThinkingConfig) SetType(v LLMObsAnthropicThinkingType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnthropicThinkingConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.BudgetTokens.IsSet() { + toSerialize["budget_tokens"] = o.BudgetTokens.Get() + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnthropicThinkingConfig) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BudgetTokens datadog.NullableInt64 `json:"budget_tokens,omitempty"` + Type *LLMObsAnthropicThinkingType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"budget_tokens", "type"}) + } else { + return err + } + + hasInvalidField := false + o.BudgetTokens = all.BudgetTokens + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_anthropic_thinking_type.go b/api/datadogV2/model_llm_obs_anthropic_thinking_type.go new file mode 100644 index 00000000000..038459da8ed --- /dev/null +++ b/api/datadogV2/model_llm_obs_anthropic_thinking_type.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnthropicThinkingType The thinking mode for Anthropic extended thinking. +type LLMObsAnthropicThinkingType string + +// List of LLMObsAnthropicThinkingType. +const ( + LLMOBSANTHROPICTHINKINGTYPE_ENABLED LLMObsAnthropicThinkingType = "enabled" + LLMOBSANTHROPICTHINKINGTYPE_DISABLED LLMObsAnthropicThinkingType = "disabled" + LLMOBSANTHROPICTHINKINGTYPE_ADAPTIVE LLMObsAnthropicThinkingType = "adaptive" +) + +var allowedLLMObsAnthropicThinkingTypeEnumValues = []LLMObsAnthropicThinkingType{ + LLMOBSANTHROPICTHINKINGTYPE_ENABLED, + LLMOBSANTHROPICTHINKINGTYPE_DISABLED, + LLMOBSANTHROPICTHINKINGTYPE_ADAPTIVE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsAnthropicThinkingType) GetAllowedValues() []LLMObsAnthropicThinkingType { + return allowedLLMObsAnthropicThinkingTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsAnthropicThinkingType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsAnthropicThinkingType(value) + return nil +} + +// NewLLMObsAnthropicThinkingTypeFromValue returns a pointer to a valid LLMObsAnthropicThinkingType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsAnthropicThinkingTypeFromValue(v string) (*LLMObsAnthropicThinkingType, error) { + ev := LLMObsAnthropicThinkingType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsAnthropicThinkingType: valid values are %v", v, allowedLLMObsAnthropicThinkingTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsAnthropicThinkingType) IsValid() bool { + for _, existing := range allowedLLMObsAnthropicThinkingTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsAnthropicThinkingType value. +func (v LLMObsAnthropicThinkingType) Ptr() *LLMObsAnthropicThinkingType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_azure_open_ai_metadata.go b/api/datadogV2/model_llm_obs_azure_open_ai_metadata.go new file mode 100644 index 00000000000..d7daa33087d --- /dev/null +++ b/api/datadogV2/model_llm_obs_azure_open_ai_metadata.go @@ -0,0 +1,172 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAzureOpenAIMetadata Azure OpenAI-specific metadata for an integration account or inference request. +type LLMObsAzureOpenAIMetadata struct { + // The Azure OpenAI deployment ID. + DeploymentId *string `json:"deployment_id,omitempty"` + // The model version deployed in Azure. + ModelVersion *string `json:"model_version,omitempty"` + // The Azure OpenAI resource name. + ResourceName *string `json:"resource_name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAzureOpenAIMetadata instantiates a new LLMObsAzureOpenAIMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAzureOpenAIMetadata() *LLMObsAzureOpenAIMetadata { + this := LLMObsAzureOpenAIMetadata{} + return &this +} + +// NewLLMObsAzureOpenAIMetadataWithDefaults instantiates a new LLMObsAzureOpenAIMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAzureOpenAIMetadataWithDefaults() *LLMObsAzureOpenAIMetadata { + this := LLMObsAzureOpenAIMetadata{} + return &this +} + +// GetDeploymentId returns the DeploymentId field value if set, zero value otherwise. +func (o *LLMObsAzureOpenAIMetadata) GetDeploymentId() string { + if o == nil || o.DeploymentId == nil { + var ret string + return ret + } + return *o.DeploymentId +} + +// GetDeploymentIdOk returns a tuple with the DeploymentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAzureOpenAIMetadata) GetDeploymentIdOk() (*string, bool) { + if o == nil || o.DeploymentId == nil { + return nil, false + } + return o.DeploymentId, true +} + +// HasDeploymentId returns a boolean if a field has been set. +func (o *LLMObsAzureOpenAIMetadata) HasDeploymentId() bool { + return o != nil && o.DeploymentId != nil +} + +// SetDeploymentId gets a reference to the given string and assigns it to the DeploymentId field. +func (o *LLMObsAzureOpenAIMetadata) SetDeploymentId(v string) { + o.DeploymentId = &v +} + +// GetModelVersion returns the ModelVersion field value if set, zero value otherwise. +func (o *LLMObsAzureOpenAIMetadata) GetModelVersion() string { + if o == nil || o.ModelVersion == nil { + var ret string + return ret + } + return *o.ModelVersion +} + +// GetModelVersionOk returns a tuple with the ModelVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAzureOpenAIMetadata) GetModelVersionOk() (*string, bool) { + if o == nil || o.ModelVersion == nil { + return nil, false + } + return o.ModelVersion, true +} + +// HasModelVersion returns a boolean if a field has been set. +func (o *LLMObsAzureOpenAIMetadata) HasModelVersion() bool { + return o != nil && o.ModelVersion != nil +} + +// SetModelVersion gets a reference to the given string and assigns it to the ModelVersion field. +func (o *LLMObsAzureOpenAIMetadata) SetModelVersion(v string) { + o.ModelVersion = &v +} + +// GetResourceName returns the ResourceName field value if set, zero value otherwise. +func (o *LLMObsAzureOpenAIMetadata) GetResourceName() string { + if o == nil || o.ResourceName == nil { + var ret string + return ret + } + return *o.ResourceName +} + +// GetResourceNameOk returns a tuple with the ResourceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAzureOpenAIMetadata) GetResourceNameOk() (*string, bool) { + if o == nil || o.ResourceName == nil { + return nil, false + } + return o.ResourceName, true +} + +// HasResourceName returns a boolean if a field has been set. +func (o *LLMObsAzureOpenAIMetadata) HasResourceName() bool { + return o != nil && o.ResourceName != nil +} + +// SetResourceName gets a reference to the given string and assigns it to the ResourceName field. +func (o *LLMObsAzureOpenAIMetadata) SetResourceName(v string) { + o.ResourceName = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAzureOpenAIMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DeploymentId != nil { + toSerialize["deployment_id"] = o.DeploymentId + } + if o.ModelVersion != nil { + toSerialize["model_version"] = o.ModelVersion + } + if o.ResourceName != nil { + toSerialize["resource_name"] = o.ResourceName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAzureOpenAIMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DeploymentId *string `json:"deployment_id,omitempty"` + ModelVersion *string `json:"model_version,omitempty"` + ResourceName *string `json:"resource_name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"deployment_id", "model_version", "resource_name"}) + } else { + return err + } + o.DeploymentId = all.DeploymentId + o.ModelVersion = all.ModelVersion + o.ResourceName = all.ResourceName + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_bedrock_metadata.go b/api/datadogV2/model_llm_obs_bedrock_metadata.go new file mode 100644 index 00000000000..6268c50ba3e --- /dev/null +++ b/api/datadogV2/model_llm_obs_bedrock_metadata.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsBedrockMetadata Amazon Bedrock-specific metadata for an inference request. +type LLMObsBedrockMetadata struct { + // The AWS region for the Bedrock request. + Region *string `json:"region,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsBedrockMetadata instantiates a new LLMObsBedrockMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsBedrockMetadata() *LLMObsBedrockMetadata { + this := LLMObsBedrockMetadata{} + return &this +} + +// NewLLMObsBedrockMetadataWithDefaults instantiates a new LLMObsBedrockMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsBedrockMetadataWithDefaults() *LLMObsBedrockMetadata { + this := LLMObsBedrockMetadata{} + return &this +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *LLMObsBedrockMetadata) GetRegion() string { + if o == nil || o.Region == nil { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsBedrockMetadata) GetRegionOk() (*string, bool) { + if o == nil || o.Region == nil { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *LLMObsBedrockMetadata) HasRegion() bool { + return o != nil && o.Region != nil +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *LLMObsBedrockMetadata) SetRegion(v string) { + o.Region = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsBedrockMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Region != nil { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsBedrockMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Region *string `json:"region,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"region"}) + } else { + return err + } + o.Region = all.Region + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_content_block.go b/api/datadogV2/model_llm_obs_content_block.go new file mode 100644 index 00000000000..a304578bced --- /dev/null +++ b/api/datadogV2/model_llm_obs_content_block.go @@ -0,0 +1,487 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsContentBlock A single content block rendered inside a `display_block` interaction. +// `type` discriminates which other fields are meaningful: +// +// - `markdown` / `text`: `content` must be a string. +// - `header`: `content` must be a string; `level`, when set, must be one of `sm`, `md`, `lg`, `xl`. +// - `json`: `content` must be a well-formed JSON value (object, array, or scalar). +// - `image`: `url` is required. +// - `widget`: `tileDef` is required (any well-formed JSON; the frontend owns the renderable schema). +// - `llmobs_trace`: `traceId` is required; `interactionType`, when set, must be `trace` or `experiment_trace`. +// +// `height`, when set, must be positive. +type LLMObsContentBlock struct { + // Alternative text for an `image` block. + Alt *string `json:"alt,omitempty"` + // Block payload. A string for `markdown`, `header`, and `text`; an + // arbitrary JSON value (object, array, or scalar) for `json`. Omitted + // for `image`, `widget`, and `llmobs_trace`. + Content interface{} `json:"content,omitempty"` + // Optional rendered height. Must be positive when set. + Height *int64 `json:"height,omitempty"` + // Upstream interaction type referenced by an `llmobs_trace` block. + // Restricted to `trace` or `experiment_trace`. + InteractionType *LLMObsContentBlockLLMObsTraceInteractionType `json:"interactionType,omitempty"` + // Optional label rendered alongside the block. + Label *string `json:"label,omitempty"` + // Visual size for a `header` block. + Level *LLMObsContentBlockHeaderLevel `json:"level,omitempty"` + // Tile definition for a `widget` block. Required for `widget`. The + // schema is owned by the frontend renderer. + TileDef interface{} `json:"tileDef,omitempty"` + // Unix-millis time range used by chart blocks. + TimeFrame *LLMObsContentBlockTimeFrame `json:"timeFrame,omitempty"` + // Trace identifier. Required for `llmobs_trace` blocks. + TraceId *string `json:"traceId,omitempty"` + // Discriminator for a single `display_block` content block. Adding a + // variant requires coordinated changes in the frontend renderer. + Type LLMObsContentBlockType `json:"type"` + // URL of the image. Required for `image` blocks. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsContentBlock instantiates a new LLMObsContentBlock object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsContentBlock(typeVar LLMObsContentBlockType) *LLMObsContentBlock { + this := LLMObsContentBlock{} + this.Type = typeVar + return &this +} + +// NewLLMObsContentBlockWithDefaults instantiates a new LLMObsContentBlock object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsContentBlockWithDefaults() *LLMObsContentBlock { + this := LLMObsContentBlock{} + return &this +} + +// GetAlt returns the Alt field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetAlt() string { + if o == nil || o.Alt == nil { + var ret string + return ret + } + return *o.Alt +} + +// GetAltOk returns a tuple with the Alt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetAltOk() (*string, bool) { + if o == nil || o.Alt == nil { + return nil, false + } + return o.Alt, true +} + +// HasAlt returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasAlt() bool { + return o != nil && o.Alt != nil +} + +// SetAlt gets a reference to the given string and assigns it to the Alt field. +func (o *LLMObsContentBlock) SetAlt(v string) { + o.Alt = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetContent() interface{} { + if o == nil || o.Content == nil { + var ret interface{} + return ret + } + return o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetContentOk() (*interface{}, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return &o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasContent() bool { + return o != nil && o.Content != nil +} + +// SetContent gets a reference to the given interface{} and assigns it to the Content field. +func (o *LLMObsContentBlock) SetContent(v interface{}) { + o.Content = v +} + +// GetHeight returns the Height field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetHeight() int64 { + if o == nil || o.Height == nil { + var ret int64 + return ret + } + return *o.Height +} + +// GetHeightOk returns a tuple with the Height field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetHeightOk() (*int64, bool) { + if o == nil || o.Height == nil { + return nil, false + } + return o.Height, true +} + +// HasHeight returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasHeight() bool { + return o != nil && o.Height != nil +} + +// SetHeight gets a reference to the given int64 and assigns it to the Height field. +func (o *LLMObsContentBlock) SetHeight(v int64) { + o.Height = &v +} + +// GetInteractionType returns the InteractionType field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetInteractionType() LLMObsContentBlockLLMObsTraceInteractionType { + if o == nil || o.InteractionType == nil { + var ret LLMObsContentBlockLLMObsTraceInteractionType + return ret + } + return *o.InteractionType +} + +// GetInteractionTypeOk returns a tuple with the InteractionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetInteractionTypeOk() (*LLMObsContentBlockLLMObsTraceInteractionType, bool) { + if o == nil || o.InteractionType == nil { + return nil, false + } + return o.InteractionType, true +} + +// HasInteractionType returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasInteractionType() bool { + return o != nil && o.InteractionType != nil +} + +// SetInteractionType gets a reference to the given LLMObsContentBlockLLMObsTraceInteractionType and assigns it to the InteractionType field. +func (o *LLMObsContentBlock) SetInteractionType(v LLMObsContentBlockLLMObsTraceInteractionType) { + o.InteractionType = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetLabel() string { + if o == nil || o.Label == nil { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetLabelOk() (*string, bool) { + if o == nil || o.Label == nil { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasLabel() bool { + return o != nil && o.Label != nil +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *LLMObsContentBlock) SetLabel(v string) { + o.Label = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetLevel() LLMObsContentBlockHeaderLevel { + if o == nil || o.Level == nil { + var ret LLMObsContentBlockHeaderLevel + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetLevelOk() (*LLMObsContentBlockHeaderLevel, bool) { + if o == nil || o.Level == nil { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasLevel() bool { + return o != nil && o.Level != nil +} + +// SetLevel gets a reference to the given LLMObsContentBlockHeaderLevel and assigns it to the Level field. +func (o *LLMObsContentBlock) SetLevel(v LLMObsContentBlockHeaderLevel) { + o.Level = &v +} + +// GetTileDef returns the TileDef field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetTileDef() interface{} { + if o == nil || o.TileDef == nil { + var ret interface{} + return ret + } + return o.TileDef +} + +// GetTileDefOk returns a tuple with the TileDef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetTileDefOk() (*interface{}, bool) { + if o == nil || o.TileDef == nil { + return nil, false + } + return &o.TileDef, true +} + +// HasTileDef returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasTileDef() bool { + return o != nil && o.TileDef != nil +} + +// SetTileDef gets a reference to the given interface{} and assigns it to the TileDef field. +func (o *LLMObsContentBlock) SetTileDef(v interface{}) { + o.TileDef = v +} + +// GetTimeFrame returns the TimeFrame field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetTimeFrame() LLMObsContentBlockTimeFrame { + if o == nil || o.TimeFrame == nil { + var ret LLMObsContentBlockTimeFrame + return ret + } + return *o.TimeFrame +} + +// GetTimeFrameOk returns a tuple with the TimeFrame field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetTimeFrameOk() (*LLMObsContentBlockTimeFrame, bool) { + if o == nil || o.TimeFrame == nil { + return nil, false + } + return o.TimeFrame, true +} + +// HasTimeFrame returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasTimeFrame() bool { + return o != nil && o.TimeFrame != nil +} + +// SetTimeFrame gets a reference to the given LLMObsContentBlockTimeFrame and assigns it to the TimeFrame field. +func (o *LLMObsContentBlock) SetTimeFrame(v LLMObsContentBlockTimeFrame) { + o.TimeFrame = &v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetTraceId() string { + if o == nil || o.TraceId == nil { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetTraceIdOk() (*string, bool) { + if o == nil || o.TraceId == nil { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasTraceId() bool { + return o != nil && o.TraceId != nil +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *LLMObsContentBlock) SetTraceId(v string) { + o.TraceId = &v +} + +// GetType returns the Type field value. +func (o *LLMObsContentBlock) GetType() LLMObsContentBlockType { + if o == nil { + var ret LLMObsContentBlockType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetTypeOk() (*LLMObsContentBlockType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsContentBlock) SetType(v LLMObsContentBlockType) { + o.Type = v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *LLMObsContentBlock) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlock) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *LLMObsContentBlock) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *LLMObsContentBlock) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsContentBlock) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Alt != nil { + toSerialize["alt"] = o.Alt + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + if o.Height != nil { + toSerialize["height"] = o.Height + } + if o.InteractionType != nil { + toSerialize["interactionType"] = o.InteractionType + } + if o.Label != nil { + toSerialize["label"] = o.Label + } + if o.Level != nil { + toSerialize["level"] = o.Level + } + if o.TileDef != nil { + toSerialize["tileDef"] = o.TileDef + } + if o.TimeFrame != nil { + toSerialize["timeFrame"] = o.TimeFrame + } + if o.TraceId != nil { + toSerialize["traceId"] = o.TraceId + } + toSerialize["type"] = o.Type + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsContentBlock) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Alt *string `json:"alt,omitempty"` + Content interface{} `json:"content,omitempty"` + Height *int64 `json:"height,omitempty"` + InteractionType *LLMObsContentBlockLLMObsTraceInteractionType `json:"interactionType,omitempty"` + Label *string `json:"label,omitempty"` + Level *LLMObsContentBlockHeaderLevel `json:"level,omitempty"` + TileDef interface{} `json:"tileDef,omitempty"` + TimeFrame *LLMObsContentBlockTimeFrame `json:"timeFrame,omitempty"` + TraceId *string `json:"traceId,omitempty"` + Type *LLMObsContentBlockType `json:"type"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"alt", "content", "height", "interactionType", "label", "level", "tileDef", "timeFrame", "traceId", "type", "url"}) + } else { + return err + } + + hasInvalidField := false + o.Alt = all.Alt + o.Content = all.Content + o.Height = all.Height + if all.InteractionType != nil && !all.InteractionType.IsValid() { + hasInvalidField = true + } else { + o.InteractionType = all.InteractionType + } + o.Label = all.Label + if all.Level != nil && !all.Level.IsValid() { + hasInvalidField = true + } else { + o.Level = all.Level + } + o.TileDef = all.TileDef + if all.TimeFrame != nil && all.TimeFrame.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.TimeFrame = all.TimeFrame + o.TraceId = all.TraceId + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_content_block_header_level.go b/api/datadogV2/model_llm_obs_content_block_header_level.go new file mode 100644 index 00000000000..34a80094c1f --- /dev/null +++ b/api/datadogV2/model_llm_obs_content_block_header_level.go @@ -0,0 +1,70 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsContentBlockHeaderLevel Visual size for a `header` block. +type LLMObsContentBlockHeaderLevel string + +// List of LLMObsContentBlockHeaderLevel. +const ( + LLMOBSCONTENTBLOCKHEADERLEVEL_SM LLMObsContentBlockHeaderLevel = "sm" + LLMOBSCONTENTBLOCKHEADERLEVEL_MD LLMObsContentBlockHeaderLevel = "md" + LLMOBSCONTENTBLOCKHEADERLEVEL_LG LLMObsContentBlockHeaderLevel = "lg" + LLMOBSCONTENTBLOCKHEADERLEVEL_XL LLMObsContentBlockHeaderLevel = "xl" +) + +var allowedLLMObsContentBlockHeaderLevelEnumValues = []LLMObsContentBlockHeaderLevel{ + LLMOBSCONTENTBLOCKHEADERLEVEL_SM, + LLMOBSCONTENTBLOCKHEADERLEVEL_MD, + LLMOBSCONTENTBLOCKHEADERLEVEL_LG, + LLMOBSCONTENTBLOCKHEADERLEVEL_XL, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsContentBlockHeaderLevel) GetAllowedValues() []LLMObsContentBlockHeaderLevel { + return allowedLLMObsContentBlockHeaderLevelEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsContentBlockHeaderLevel) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsContentBlockHeaderLevel(value) + return nil +} + +// NewLLMObsContentBlockHeaderLevelFromValue returns a pointer to a valid LLMObsContentBlockHeaderLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsContentBlockHeaderLevelFromValue(v string) (*LLMObsContentBlockHeaderLevel, error) { + ev := LLMObsContentBlockHeaderLevel(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsContentBlockHeaderLevel: valid values are %v", v, allowedLLMObsContentBlockHeaderLevelEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsContentBlockHeaderLevel) IsValid() bool { + for _, existing := range allowedLLMObsContentBlockHeaderLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsContentBlockHeaderLevel value. +func (v LLMObsContentBlockHeaderLevel) Ptr() *LLMObsContentBlockHeaderLevel { + return &v +} diff --git a/api/datadogV2/model_llm_obs_content_block_llm_obs_trace_interaction_type.go b/api/datadogV2/model_llm_obs_content_block_llm_obs_trace_interaction_type.go new file mode 100644 index 00000000000..6b8db6d3ef8 --- /dev/null +++ b/api/datadogV2/model_llm_obs_content_block_llm_obs_trace_interaction_type.go @@ -0,0 +1,67 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsContentBlockLLMObsTraceInteractionType Upstream interaction type referenced by an `llmobs_trace` block. +// Restricted to `trace` or `experiment_trace`. +type LLMObsContentBlockLLMObsTraceInteractionType string + +// List of LLMObsContentBlockLLMObsTraceInteractionType. +const ( + LLMOBSCONTENTBLOCKLLMOBSTRACEINTERACTIONTYPE_TRACE LLMObsContentBlockLLMObsTraceInteractionType = "trace" + LLMOBSCONTENTBLOCKLLMOBSTRACEINTERACTIONTYPE_EXPERIMENT_TRACE LLMObsContentBlockLLMObsTraceInteractionType = "experiment_trace" +) + +var allowedLLMObsContentBlockLLMObsTraceInteractionTypeEnumValues = []LLMObsContentBlockLLMObsTraceInteractionType{ + LLMOBSCONTENTBLOCKLLMOBSTRACEINTERACTIONTYPE_TRACE, + LLMOBSCONTENTBLOCKLLMOBSTRACEINTERACTIONTYPE_EXPERIMENT_TRACE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsContentBlockLLMObsTraceInteractionType) GetAllowedValues() []LLMObsContentBlockLLMObsTraceInteractionType { + return allowedLLMObsContentBlockLLMObsTraceInteractionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsContentBlockLLMObsTraceInteractionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsContentBlockLLMObsTraceInteractionType(value) + return nil +} + +// NewLLMObsContentBlockLLMObsTraceInteractionTypeFromValue returns a pointer to a valid LLMObsContentBlockLLMObsTraceInteractionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsContentBlockLLMObsTraceInteractionTypeFromValue(v string) (*LLMObsContentBlockLLMObsTraceInteractionType, error) { + ev := LLMObsContentBlockLLMObsTraceInteractionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsContentBlockLLMObsTraceInteractionType: valid values are %v", v, allowedLLMObsContentBlockLLMObsTraceInteractionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsContentBlockLLMObsTraceInteractionType) IsValid() bool { + for _, existing := range allowedLLMObsContentBlockLLMObsTraceInteractionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsContentBlockLLMObsTraceInteractionType value. +func (v LLMObsContentBlockLLMObsTraceInteractionType) Ptr() *LLMObsContentBlockLLMObsTraceInteractionType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_content_block_time_frame.go b/api/datadogV2/model_llm_obs_content_block_time_frame.go new file mode 100644 index 00000000000..2697f132c7b --- /dev/null +++ b/api/datadogV2/model_llm_obs_content_block_time_frame.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsContentBlockTimeFrame Unix-millis time range used by chart blocks. +type LLMObsContentBlockTimeFrame struct { + // End of the range, in Unix milliseconds. + End int64 `json:"end"` + // Start of the range, in Unix milliseconds. + Start int64 `json:"start"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsContentBlockTimeFrame instantiates a new LLMObsContentBlockTimeFrame object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsContentBlockTimeFrame(end int64, start int64) *LLMObsContentBlockTimeFrame { + this := LLMObsContentBlockTimeFrame{} + this.End = end + this.Start = start + return &this +} + +// NewLLMObsContentBlockTimeFrameWithDefaults instantiates a new LLMObsContentBlockTimeFrame object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsContentBlockTimeFrameWithDefaults() *LLMObsContentBlockTimeFrame { + this := LLMObsContentBlockTimeFrame{} + return &this +} + +// GetEnd returns the End field value. +func (o *LLMObsContentBlockTimeFrame) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlockTimeFrame) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value. +func (o *LLMObsContentBlockTimeFrame) SetEnd(v int64) { + o.End = v +} + +// GetStart returns the Start field value. +func (o *LLMObsContentBlockTimeFrame) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *LLMObsContentBlockTimeFrame) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value. +func (o *LLMObsContentBlockTimeFrame) SetStart(v int64) { + o.Start = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsContentBlockTimeFrame) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["end"] = o.End + toSerialize["start"] = o.Start + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsContentBlockTimeFrame) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + End *int64 `json:"end"` + Start *int64 `json:"start"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.End == nil { + return fmt.Errorf("required field end missing") + } + if all.Start == nil { + return fmt.Errorf("required field start missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"end", "start"}) + } else { + return err + } + o.End = *all.End + o.Start = *all.Start + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_content_block_type.go b/api/datadogV2/model_llm_obs_content_block_type.go new file mode 100644 index 00000000000..ea6f125622e --- /dev/null +++ b/api/datadogV2/model_llm_obs_content_block_type.go @@ -0,0 +1,77 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsContentBlockType Discriminator for a single `display_block` content block. Adding a +// variant requires coordinated changes in the frontend renderer. +type LLMObsContentBlockType string + +// List of LLMObsContentBlockType. +const ( + LLMOBSCONTENTBLOCKTYPE_MARKDOWN LLMObsContentBlockType = "markdown" + LLMOBSCONTENTBLOCKTYPE_HEADER LLMObsContentBlockType = "header" + LLMOBSCONTENTBLOCKTYPE_TEXT LLMObsContentBlockType = "text" + LLMOBSCONTENTBLOCKTYPE_JSON LLMObsContentBlockType = "json" + LLMOBSCONTENTBLOCKTYPE_IMAGE LLMObsContentBlockType = "image" + LLMOBSCONTENTBLOCKTYPE_WIDGET LLMObsContentBlockType = "widget" + LLMOBSCONTENTBLOCKTYPE_LLMOBS_TRACE LLMObsContentBlockType = "llmobs_trace" +) + +var allowedLLMObsContentBlockTypeEnumValues = []LLMObsContentBlockType{ + LLMOBSCONTENTBLOCKTYPE_MARKDOWN, + LLMOBSCONTENTBLOCKTYPE_HEADER, + LLMOBSCONTENTBLOCKTYPE_TEXT, + LLMOBSCONTENTBLOCKTYPE_JSON, + LLMOBSCONTENTBLOCKTYPE_IMAGE, + LLMOBSCONTENTBLOCKTYPE_WIDGET, + LLMOBSCONTENTBLOCKTYPE_LLMOBS_TRACE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsContentBlockType) GetAllowedValues() []LLMObsContentBlockType { + return allowedLLMObsContentBlockTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsContentBlockType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsContentBlockType(value) + return nil +} + +// NewLLMObsContentBlockTypeFromValue returns a pointer to a valid LLMObsContentBlockType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsContentBlockTypeFromValue(v string) (*LLMObsContentBlockType, error) { + ev := LLMObsContentBlockType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsContentBlockType: valid values are %v", v, allowedLLMObsContentBlockTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsContentBlockType) IsValid() bool { + for _, existing := range allowedLLMObsContentBlockTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsContentBlockType value. +func (v LLMObsContentBlockType) Ptr() *LLMObsContentBlockType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_request.go b/api/datadogV2/model_llm_obs_data_deletion_request.go new file mode 100644 index 00000000000..5327a2f1c85 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionRequest Request to delete LLM Observability data. +type LLMObsDataDeletionRequest struct { + // Data object for an LLM Observability data deletion request. + Data LLMObsDataDeletionRequestData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionRequest instantiates a new LLMObsDataDeletionRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionRequest(data LLMObsDataDeletionRequestData) *LLMObsDataDeletionRequest { + this := LLMObsDataDeletionRequest{} + this.Data = data + return &this +} + +// NewLLMObsDataDeletionRequestWithDefaults instantiates a new LLMObsDataDeletionRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionRequestWithDefaults() *LLMObsDataDeletionRequest { + this := LLMObsDataDeletionRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsDataDeletionRequest) GetData() LLMObsDataDeletionRequestData { + if o == nil { + var ret LLMObsDataDeletionRequestData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequest) GetDataOk() (*LLMObsDataDeletionRequestData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsDataDeletionRequest) SetData(v LLMObsDataDeletionRequestData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsDataDeletionRequestData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_request_attributes.go b/api/datadogV2/model_llm_obs_data_deletion_request_attributes.go new file mode 100644 index 00000000000..500c681fb8b --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_request_attributes.go @@ -0,0 +1,200 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionRequestAttributes Attributes for an LLM Observability data deletion request. +type LLMObsDataDeletionRequestAttributes struct { + // Optional delay in seconds before the deletion is executed. + Delay *int64 `json:"delay,omitempty"` + // Start of the deletion time range in milliseconds since Unix epoch. + From int64 `json:"from"` + // Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + Query map[string]string `json:"query"` + // End of the deletion time range in milliseconds since Unix epoch. + To int64 `json:"to"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionRequestAttributes instantiates a new LLMObsDataDeletionRequestAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionRequestAttributes(from int64, query map[string]string, to int64) *LLMObsDataDeletionRequestAttributes { + this := LLMObsDataDeletionRequestAttributes{} + this.From = from + this.Query = query + this.To = to + return &this +} + +// NewLLMObsDataDeletionRequestAttributesWithDefaults instantiates a new LLMObsDataDeletionRequestAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionRequestAttributesWithDefaults() *LLMObsDataDeletionRequestAttributes { + this := LLMObsDataDeletionRequestAttributes{} + return &this +} + +// GetDelay returns the Delay field value if set, zero value otherwise. +func (o *LLMObsDataDeletionRequestAttributes) GetDelay() int64 { + if o == nil || o.Delay == nil { + var ret int64 + return ret + } + return *o.Delay +} + +// GetDelayOk returns a tuple with the Delay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestAttributes) GetDelayOk() (*int64, bool) { + if o == nil || o.Delay == nil { + return nil, false + } + return o.Delay, true +} + +// HasDelay returns a boolean if a field has been set. +func (o *LLMObsDataDeletionRequestAttributes) HasDelay() bool { + return o != nil && o.Delay != nil +} + +// SetDelay gets a reference to the given int64 and assigns it to the Delay field. +func (o *LLMObsDataDeletionRequestAttributes) SetDelay(v int64) { + o.Delay = &v +} + +// GetFrom returns the From field value. +func (o *LLMObsDataDeletionRequestAttributes) GetFrom() int64 { + if o == nil { + var ret int64 + return ret + } + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestAttributes) GetFromOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value. +func (o *LLMObsDataDeletionRequestAttributes) SetFrom(v int64) { + o.From = v +} + +// GetQuery returns the Query field value. +func (o *LLMObsDataDeletionRequestAttributes) GetQuery() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestAttributes) GetQueryOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *LLMObsDataDeletionRequestAttributes) SetQuery(v map[string]string) { + o.Query = v +} + +// GetTo returns the To field value. +func (o *LLMObsDataDeletionRequestAttributes) GetTo() int64 { + if o == nil { + var ret int64 + return ret + } + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestAttributes) GetToOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value. +func (o *LLMObsDataDeletionRequestAttributes) SetTo(v int64) { + o.To = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Delay != nil { + toSerialize["delay"] = o.Delay + } + toSerialize["from"] = o.From + toSerialize["query"] = o.Query + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Delay *int64 `json:"delay,omitempty"` + From *int64 `json:"from"` + Query *map[string]string `json:"query"` + To *int64 `json:"to"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.From == nil { + return fmt.Errorf("required field from missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + if all.To == nil { + return fmt.Errorf("required field to missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"delay", "from", "query", "to"}) + } else { + return err + } + o.Delay = all.Delay + o.From = *all.From + o.Query = *all.Query + o.To = *all.To + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_request_data.go b/api/datadogV2/model_llm_obs_data_deletion_request_data.go new file mode 100644 index 00000000000..6d65f201956 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_request_data.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionRequestData Data object for an LLM Observability data deletion request. +type LLMObsDataDeletionRequestData struct { + // Attributes for an LLM Observability data deletion request. + Attributes LLMObsDataDeletionRequestAttributes `json:"attributes"` + // Resource type for an LLM Observability data deletion request. + Type LLMObsDataDeletionRequestType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionRequestData instantiates a new LLMObsDataDeletionRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionRequestData(attributes LLMObsDataDeletionRequestAttributes, typeVar LLMObsDataDeletionRequestType) *LLMObsDataDeletionRequestData { + this := LLMObsDataDeletionRequestData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsDataDeletionRequestDataWithDefaults instantiates a new LLMObsDataDeletionRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionRequestDataWithDefaults() *LLMObsDataDeletionRequestData { + this := LLMObsDataDeletionRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsDataDeletionRequestData) GetAttributes() LLMObsDataDeletionRequestAttributes { + if o == nil { + var ret LLMObsDataDeletionRequestAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestData) GetAttributesOk() (*LLMObsDataDeletionRequestAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsDataDeletionRequestData) SetAttributes(v LLMObsDataDeletionRequestAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsDataDeletionRequestData) GetType() LLMObsDataDeletionRequestType { + if o == nil { + var ret LLMObsDataDeletionRequestType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionRequestData) GetTypeOk() (*LLMObsDataDeletionRequestType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDataDeletionRequestData) SetType(v LLMObsDataDeletionRequestType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsDataDeletionRequestAttributes `json:"attributes"` + Type *LLMObsDataDeletionRequestType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_request_type.go b/api/datadogV2/model_llm_obs_data_deletion_request_type.go new file mode 100644 index 00000000000..dd3cf8b1af3 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_request_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionRequestType Resource type for an LLM Observability data deletion request. +type LLMObsDataDeletionRequestType string + +// List of LLMObsDataDeletionRequestType. +const ( + LLMOBSDATADELETIONREQUESTTYPE_CREATE_DELETION_REQ LLMObsDataDeletionRequestType = "create_deletion_req" +) + +var allowedLLMObsDataDeletionRequestTypeEnumValues = []LLMObsDataDeletionRequestType{ + LLMOBSDATADELETIONREQUESTTYPE_CREATE_DELETION_REQ, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsDataDeletionRequestType) GetAllowedValues() []LLMObsDataDeletionRequestType { + return allowedLLMObsDataDeletionRequestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsDataDeletionRequestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsDataDeletionRequestType(value) + return nil +} + +// NewLLMObsDataDeletionRequestTypeFromValue returns a pointer to a valid LLMObsDataDeletionRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsDataDeletionRequestTypeFromValue(v string) (*LLMObsDataDeletionRequestType, error) { + ev := LLMObsDataDeletionRequestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsDataDeletionRequestType: valid values are %v", v, allowedLLMObsDataDeletionRequestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsDataDeletionRequestType) IsValid() bool { + for _, existing := range allowedLLMObsDataDeletionRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsDataDeletionRequestType value. +func (v LLMObsDataDeletionRequestType) Ptr() *LLMObsDataDeletionRequestType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_response.go b/api/datadogV2/model_llm_obs_data_deletion_response.go new file mode 100644 index 00000000000..56df7a36543 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionResponse Response containing details of a submitted LLM Observability data deletion request. +type LLMObsDataDeletionResponse struct { + // Data object for an LLM Observability data deletion response. + Data LLMObsDataDeletionResponseData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionResponse instantiates a new LLMObsDataDeletionResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionResponse(data LLMObsDataDeletionResponseData) *LLMObsDataDeletionResponse { + this := LLMObsDataDeletionResponse{} + this.Data = data + return &this +} + +// NewLLMObsDataDeletionResponseWithDefaults instantiates a new LLMObsDataDeletionResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionResponseWithDefaults() *LLMObsDataDeletionResponse { + this := LLMObsDataDeletionResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsDataDeletionResponse) GetData() LLMObsDataDeletionResponseData { + if o == nil { + var ret LLMObsDataDeletionResponseData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponse) GetDataOk() (*LLMObsDataDeletionResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsDataDeletionResponse) SetData(v LLMObsDataDeletionResponseData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsDataDeletionResponseData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_response_attributes.go b/api/datadogV2/model_llm_obs_data_deletion_response_attributes.go new file mode 100644 index 00000000000..807caf7ea16 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_response_attributes.go @@ -0,0 +1,298 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionResponseAttributes Attributes of a submitted LLM Observability data deletion request. +type LLMObsDataDeletionResponseAttributes struct { + // Timestamp when the deletion request was created. + CreatedAt time.Time `json:"created_at"` + // UUID of the user who created the deletion request. + CreatedBy string `json:"created_by"` + // Start of the deletion time range in milliseconds since Unix epoch. + FromTime int64 `json:"from_time"` + // ID of the organization that submitted the deletion request. + OrgId int64 `json:"org_id"` + // Product name for the deletion request. + Product string `json:"product"` + // The query string used to select data for deletion. + Query string `json:"query"` + // End of the deletion time range in milliseconds since Unix epoch. + ToTime int64 `json:"to_time"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionResponseAttributes instantiates a new LLMObsDataDeletionResponseAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionResponseAttributes(createdAt time.Time, createdBy string, fromTime int64, orgId int64, product string, query string, toTime int64) *LLMObsDataDeletionResponseAttributes { + this := LLMObsDataDeletionResponseAttributes{} + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.FromTime = fromTime + this.OrgId = orgId + this.Product = product + this.Query = query + this.ToTime = toTime + return &this +} + +// NewLLMObsDataDeletionResponseAttributesWithDefaults instantiates a new LLMObsDataDeletionResponseAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionResponseAttributesWithDefaults() *LLMObsDataDeletionResponseAttributes { + this := LLMObsDataDeletionResponseAttributes{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *LLMObsDataDeletionResponseAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *LLMObsDataDeletionResponseAttributes) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetFromTime returns the FromTime field value. +func (o *LLMObsDataDeletionResponseAttributes) GetFromTime() int64 { + if o == nil { + var ret int64 + return ret + } + return o.FromTime +} + +// GetFromTimeOk returns a tuple with the FromTime field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetFromTimeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.FromTime, true +} + +// SetFromTime sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetFromTime(v int64) { + o.FromTime = v +} + +// GetOrgId returns the OrgId field value. +func (o *LLMObsDataDeletionResponseAttributes) GetOrgId() int64 { + if o == nil { + var ret int64 + return ret + } + return o.OrgId +} + +// GetOrgIdOk returns a tuple with the OrgId field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetOrgIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OrgId, true +} + +// SetOrgId sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetOrgId(v int64) { + o.OrgId = v +} + +// GetProduct returns the Product field value. +func (o *LLMObsDataDeletionResponseAttributes) GetProduct() string { + if o == nil { + var ret string + return ret + } + return o.Product +} + +// GetProductOk returns a tuple with the Product field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetProductOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Product, true +} + +// SetProduct sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetProduct(v string) { + o.Product = v +} + +// GetQuery returns the Query field value. +func (o *LLMObsDataDeletionResponseAttributes) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetQuery(v string) { + o.Query = v +} + +// GetToTime returns the ToTime field value. +func (o *LLMObsDataDeletionResponseAttributes) GetToTime() int64 { + if o == nil { + var ret int64 + return ret + } + return o.ToTime +} + +// GetToTimeOk returns a tuple with the ToTime field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseAttributes) GetToTimeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ToTime, true +} + +// SetToTime sets field value. +func (o *LLMObsDataDeletionResponseAttributes) SetToTime(v int64) { + o.ToTime = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionResponseAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["from_time"] = o.FromTime + toSerialize["org_id"] = o.OrgId + toSerialize["product"] = o.Product + toSerialize["query"] = o.Query + toSerialize["to_time"] = o.ToTime + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionResponseAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + FromTime *int64 `json:"from_time"` + OrgId *int64 `json:"org_id"` + Product *string `json:"product"` + Query *string `json:"query"` + ToTime *int64 `json:"to_time"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.FromTime == nil { + return fmt.Errorf("required field from_time missing") + } + if all.OrgId == nil { + return fmt.Errorf("required field org_id missing") + } + if all.Product == nil { + return fmt.Errorf("required field product missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + if all.ToTime == nil { + return fmt.Errorf("required field to_time missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "created_by", "from_time", "org_id", "product", "query", "to_time"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + o.FromTime = *all.FromTime + o.OrgId = *all.OrgId + o.Product = *all.Product + o.Query = *all.Query + o.ToTime = *all.ToTime + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_response_data.go b/api/datadogV2/model_llm_obs_data_deletion_response_data.go new file mode 100644 index 00000000000..75e05685478 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_response_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionResponseData Data object for an LLM Observability data deletion response. +type LLMObsDataDeletionResponseData struct { + // Attributes of a submitted LLM Observability data deletion request. + Attributes LLMObsDataDeletionResponseAttributes `json:"attributes"` + // Unique identifier of the deletion request. + Id string `json:"id"` + // Resource type for an LLM Observability data deletion response. + Type LLMObsDataDeletionResponseType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDataDeletionResponseData instantiates a new LLMObsDataDeletionResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDataDeletionResponseData(attributes LLMObsDataDeletionResponseAttributes, id string, typeVar LLMObsDataDeletionResponseType) *LLMObsDataDeletionResponseData { + this := LLMObsDataDeletionResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsDataDeletionResponseDataWithDefaults instantiates a new LLMObsDataDeletionResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDataDeletionResponseDataWithDefaults() *LLMObsDataDeletionResponseData { + this := LLMObsDataDeletionResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsDataDeletionResponseData) GetAttributes() LLMObsDataDeletionResponseAttributes { + if o == nil { + var ret LLMObsDataDeletionResponseAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseData) GetAttributesOk() (*LLMObsDataDeletionResponseAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsDataDeletionResponseData) SetAttributes(v LLMObsDataDeletionResponseAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsDataDeletionResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsDataDeletionResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsDataDeletionResponseData) GetType() LLMObsDataDeletionResponseType { + if o == nil { + var ret LLMObsDataDeletionResponseType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDataDeletionResponseData) GetTypeOk() (*LLMObsDataDeletionResponseType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDataDeletionResponseData) SetType(v LLMObsDataDeletionResponseType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDataDeletionResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDataDeletionResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsDataDeletionResponseAttributes `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsDataDeletionResponseType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_data_deletion_response_type.go b/api/datadogV2/model_llm_obs_data_deletion_response_type.go new file mode 100644 index 00000000000..75a06576237 --- /dev/null +++ b/api/datadogV2/model_llm_obs_data_deletion_response_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDataDeletionResponseType Resource type for an LLM Observability data deletion response. +type LLMObsDataDeletionResponseType string + +// List of LLMObsDataDeletionResponseType. +const ( + LLMOBSDATADELETIONRESPONSETYPE_DELETION_REQUEST LLMObsDataDeletionResponseType = "deletion_request" +) + +var allowedLLMObsDataDeletionResponseTypeEnumValues = []LLMObsDataDeletionResponseType{ + LLMOBSDATADELETIONRESPONSETYPE_DELETION_REQUEST, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsDataDeletionResponseType) GetAllowedValues() []LLMObsDataDeletionResponseType { + return allowedLLMObsDataDeletionResponseTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsDataDeletionResponseType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsDataDeletionResponseType(value) + return nil +} + +// NewLLMObsDataDeletionResponseTypeFromValue returns a pointer to a valid LLMObsDataDeletionResponseType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsDataDeletionResponseTypeFromValue(v string) (*LLMObsDataDeletionResponseType, error) { + ev := LLMObsDataDeletionResponseType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsDataDeletionResponseType: valid values are %v", v, allowedLLMObsDataDeletionResponseTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsDataDeletionResponseType) IsValid() bool { + for _, existing := range allowedLLMObsDataDeletionResponseTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsDataDeletionResponseType value. +func (v LLMObsDataDeletionResponseType) Ptr() *LLMObsDataDeletionResponseType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_display_block_annotated_interaction_item.go b/api/datadogV2/model_llm_obs_display_block_annotated_interaction_item.go new file mode 100644 index 00000000000..bf60cc0c774 --- /dev/null +++ b/api/datadogV2/model_llm_obs_display_block_annotated_interaction_item.go @@ -0,0 +1,240 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDisplayBlockAnnotatedInteractionItem A display_block interaction with its associated annotations. +type LLMObsDisplayBlockAnnotatedInteractionItem struct { + // List of annotations for this interaction. + Annotations []LLMObsAnnotationItem `json:"annotations"` + // Server-generated deterministic identifier derived from the block list. + ContentId string `json:"content_id"` + // List of content blocks that make up a `display_block` interaction. + // Must contain at least one block. + DisplayBlock []LLMObsContentBlock `json:"display_block"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Type discriminator for a `display_block` interaction. + Type LLMObsDisplayBlockInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDisplayBlockAnnotatedInteractionItem instantiates a new LLMObsDisplayBlockAnnotatedInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDisplayBlockAnnotatedInteractionItem(annotations []LLMObsAnnotationItem, contentId string, displayBlock []LLMObsContentBlock, id string, typeVar LLMObsDisplayBlockInteractionType) *LLMObsDisplayBlockAnnotatedInteractionItem { + this := LLMObsDisplayBlockAnnotatedInteractionItem{} + this.Annotations = annotations + this.ContentId = contentId + this.DisplayBlock = displayBlock + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsDisplayBlockAnnotatedInteractionItemWithDefaults instantiates a new LLMObsDisplayBlockAnnotatedInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDisplayBlockAnnotatedInteractionItemWithDefaults() *LLMObsDisplayBlockAnnotatedInteractionItem { + this := LLMObsDisplayBlockAnnotatedInteractionItem{} + return &this +} + +// GetAnnotations returns the Annotations field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetAnnotations() []LLMObsAnnotationItem { + if o == nil { + var ret []LLMObsAnnotationItem + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetAnnotationsOk() (*[]LLMObsAnnotationItem, bool) { + if o == nil { + return nil, false + } + return &o.Annotations, true +} + +// SetAnnotations sets field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) SetAnnotations(v []LLMObsAnnotationItem) { + o.Annotations = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) SetContentId(v string) { + o.ContentId = v +} + +// GetDisplayBlock returns the DisplayBlock field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetDisplayBlock() []LLMObsContentBlock { + if o == nil { + var ret []LLMObsContentBlock + return ret + } + return o.DisplayBlock +} + +// GetDisplayBlockOk returns a tuple with the DisplayBlock field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetDisplayBlockOk() (*[]LLMObsContentBlock, bool) { + if o == nil { + return nil, false + } + return &o.DisplayBlock, true +} + +// SetDisplayBlock sets field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) SetDisplayBlock(v []LLMObsContentBlock) { + o.DisplayBlock = v +} + +// GetId returns the Id field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetType() LLMObsDisplayBlockInteractionType { + if o == nil { + var ret LLMObsDisplayBlockInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) GetTypeOk() (*LLMObsDisplayBlockInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) SetType(v LLMObsDisplayBlockInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDisplayBlockAnnotatedInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["annotations"] = o.Annotations + toSerialize["content_id"] = o.ContentId + toSerialize["display_block"] = o.DisplayBlock + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDisplayBlockAnnotatedInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Annotations *[]LLMObsAnnotationItem `json:"annotations"` + ContentId *string `json:"content_id"` + DisplayBlock *[]LLMObsContentBlock `json:"display_block"` + Id *string `json:"id"` + Type *LLMObsDisplayBlockInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Annotations == nil { + return fmt.Errorf("required field annotations missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.DisplayBlock == nil { + return fmt.Errorf("required field display_block missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"annotations", "content_id", "display_block", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Annotations = *all.Annotations + o.ContentId = *all.ContentId + o.DisplayBlock = *all.DisplayBlock + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_display_block_interaction_item.go b/api/datadogV2/model_llm_obs_display_block_interaction_item.go new file mode 100644 index 00000000000..d5c3e82b7af --- /dev/null +++ b/api/datadogV2/model_llm_obs_display_block_interaction_item.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDisplayBlockInteractionItem An interaction whose rendered content is supplied directly as a list +// of display blocks. The server generates `content_id` deterministically +// from the block list. +type LLMObsDisplayBlockInteractionItem struct { + // List of content blocks that make up a `display_block` interaction. + // Must contain at least one block. + DisplayBlock []LLMObsContentBlock `json:"display_block"` + // Type discriminator for a `display_block` interaction. + Type LLMObsDisplayBlockInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDisplayBlockInteractionItem instantiates a new LLMObsDisplayBlockInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDisplayBlockInteractionItem(displayBlock []LLMObsContentBlock, typeVar LLMObsDisplayBlockInteractionType) *LLMObsDisplayBlockInteractionItem { + this := LLMObsDisplayBlockInteractionItem{} + this.DisplayBlock = displayBlock + this.Type = typeVar + return &this +} + +// NewLLMObsDisplayBlockInteractionItemWithDefaults instantiates a new LLMObsDisplayBlockInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDisplayBlockInteractionItemWithDefaults() *LLMObsDisplayBlockInteractionItem { + this := LLMObsDisplayBlockInteractionItem{} + return &this +} + +// GetDisplayBlock returns the DisplayBlock field value. +func (o *LLMObsDisplayBlockInteractionItem) GetDisplayBlock() []LLMObsContentBlock { + if o == nil { + var ret []LLMObsContentBlock + return ret + } + return o.DisplayBlock +} + +// GetDisplayBlockOk returns a tuple with the DisplayBlock field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionItem) GetDisplayBlockOk() (*[]LLMObsContentBlock, bool) { + if o == nil { + return nil, false + } + return &o.DisplayBlock, true +} + +// SetDisplayBlock sets field value. +func (o *LLMObsDisplayBlockInteractionItem) SetDisplayBlock(v []LLMObsContentBlock) { + o.DisplayBlock = v +} + +// GetType returns the Type field value. +func (o *LLMObsDisplayBlockInteractionItem) GetType() LLMObsDisplayBlockInteractionType { + if o == nil { + var ret LLMObsDisplayBlockInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionItem) GetTypeOk() (*LLMObsDisplayBlockInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDisplayBlockInteractionItem) SetType(v LLMObsDisplayBlockInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDisplayBlockInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["display_block"] = o.DisplayBlock + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDisplayBlockInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DisplayBlock *[]LLMObsContentBlock `json:"display_block"` + Type *LLMObsDisplayBlockInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.DisplayBlock == nil { + return fmt.Errorf("required field display_block missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"display_block", "type"}) + } else { + return err + } + + hasInvalidField := false + o.DisplayBlock = *all.DisplayBlock + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_display_block_interaction_response_item.go b/api/datadogV2/model_llm_obs_display_block_interaction_response_item.go new file mode 100644 index 00000000000..3b3c89db758 --- /dev/null +++ b/api/datadogV2/model_llm_obs_display_block_interaction_response_item.go @@ -0,0 +1,240 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDisplayBlockInteractionResponseItem A display_block interaction result. +type LLMObsDisplayBlockInteractionResponseItem struct { + // Whether this interaction already existed in the queue. + AlreadyExisted bool `json:"already_existed"` + // Server-generated deterministic identifier derived from the block list. + ContentId string `json:"content_id"` + // List of content blocks that make up a `display_block` interaction. + // Must contain at least one block. + DisplayBlock []LLMObsContentBlock `json:"display_block"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Type discriminator for a `display_block` interaction. + Type LLMObsDisplayBlockInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDisplayBlockInteractionResponseItem instantiates a new LLMObsDisplayBlockInteractionResponseItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDisplayBlockInteractionResponseItem(alreadyExisted bool, contentId string, displayBlock []LLMObsContentBlock, id string, typeVar LLMObsDisplayBlockInteractionType) *LLMObsDisplayBlockInteractionResponseItem { + this := LLMObsDisplayBlockInteractionResponseItem{} + this.AlreadyExisted = alreadyExisted + this.ContentId = contentId + this.DisplayBlock = displayBlock + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsDisplayBlockInteractionResponseItemWithDefaults instantiates a new LLMObsDisplayBlockInteractionResponseItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDisplayBlockInteractionResponseItemWithDefaults() *LLMObsDisplayBlockInteractionResponseItem { + this := LLMObsDisplayBlockInteractionResponseItem{} + return &this +} + +// GetAlreadyExisted returns the AlreadyExisted field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetAlreadyExisted() bool { + if o == nil { + var ret bool + return ret + } + return o.AlreadyExisted +} + +// GetAlreadyExistedOk returns a tuple with the AlreadyExisted field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetAlreadyExistedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AlreadyExisted, true +} + +// SetAlreadyExisted sets field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) SetAlreadyExisted(v bool) { + o.AlreadyExisted = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) SetContentId(v string) { + o.ContentId = v +} + +// GetDisplayBlock returns the DisplayBlock field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetDisplayBlock() []LLMObsContentBlock { + if o == nil { + var ret []LLMObsContentBlock + return ret + } + return o.DisplayBlock +} + +// GetDisplayBlockOk returns a tuple with the DisplayBlock field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetDisplayBlockOk() (*[]LLMObsContentBlock, bool) { + if o == nil { + return nil, false + } + return &o.DisplayBlock, true +} + +// SetDisplayBlock sets field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) SetDisplayBlock(v []LLMObsContentBlock) { + o.DisplayBlock = v +} + +// GetId returns the Id field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetType() LLMObsDisplayBlockInteractionType { + if o == nil { + var ret LLMObsDisplayBlockInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDisplayBlockInteractionResponseItem) GetTypeOk() (*LLMObsDisplayBlockInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDisplayBlockInteractionResponseItem) SetType(v LLMObsDisplayBlockInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDisplayBlockInteractionResponseItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["already_existed"] = o.AlreadyExisted + toSerialize["content_id"] = o.ContentId + toSerialize["display_block"] = o.DisplayBlock + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDisplayBlockInteractionResponseItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AlreadyExisted *bool `json:"already_existed"` + ContentId *string `json:"content_id"` + DisplayBlock *[]LLMObsContentBlock `json:"display_block"` + Id *string `json:"id"` + Type *LLMObsDisplayBlockInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AlreadyExisted == nil { + return fmt.Errorf("required field already_existed missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.DisplayBlock == nil { + return fmt.Errorf("required field display_block missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"already_existed", "content_id", "display_block", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.AlreadyExisted = *all.AlreadyExisted + o.ContentId = *all.ContentId + o.DisplayBlock = *all.DisplayBlock + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_display_block_interaction_type.go b/api/datadogV2/model_llm_obs_display_block_interaction_type.go new file mode 100644 index 00000000000..66c573fb19e --- /dev/null +++ b/api/datadogV2/model_llm_obs_display_block_interaction_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDisplayBlockInteractionType Type discriminator for a `display_block` interaction. +type LLMObsDisplayBlockInteractionType string + +// List of LLMObsDisplayBlockInteractionType. +const ( + LLMOBSDISPLAYBLOCKINTERACTIONTYPE_DISPLAY_BLOCK LLMObsDisplayBlockInteractionType = "display_block" +) + +var allowedLLMObsDisplayBlockInteractionTypeEnumValues = []LLMObsDisplayBlockInteractionType{ + LLMOBSDISPLAYBLOCKINTERACTIONTYPE_DISPLAY_BLOCK, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsDisplayBlockInteractionType) GetAllowedValues() []LLMObsDisplayBlockInteractionType { + return allowedLLMObsDisplayBlockInteractionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsDisplayBlockInteractionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsDisplayBlockInteractionType(value) + return nil +} + +// NewLLMObsDisplayBlockInteractionTypeFromValue returns a pointer to a valid LLMObsDisplayBlockInteractionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsDisplayBlockInteractionTypeFromValue(v string) (*LLMObsDisplayBlockInteractionType, error) { + ev := LLMObsDisplayBlockInteractionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsDisplayBlockInteractionType: valid values are %v", v, allowedLLMObsDisplayBlockInteractionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsDisplayBlockInteractionType) IsValid() bool { + for _, existing := range allowedLLMObsDisplayBlockInteractionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsDisplayBlockInteractionType value. +func (v LLMObsDisplayBlockInteractionType) Ptr() *LLMObsDisplayBlockInteractionType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_experiment_eval_metric_event.go b/api/datadogV2/model_llm_obs_experiment_eval_metric_event.go new file mode 100644 index 00000000000..cf3e445dff3 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_eval_metric_event.go @@ -0,0 +1,687 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentEvalMetricEvent An evaluation metric event associated with an experiment span. +type LLMObsExperimentEvalMetricEvent struct { + // Assessment result for an LLM Observability experiment metric. + Assessment *LLMObsMetricAssessment `json:"assessment,omitempty"` + // Boolean value. Present when `metric_type` is `boolean`. + BooleanValue datadog.NullableBool `json:"boolean_value,omitempty"` + // Categorical value. Present when `metric_type` is `categorical`. + CategoricalValue datadog.NullableString `json:"categorical_value,omitempty"` + // Source type of the evaluation. + EvalSourceType *string `json:"eval_source_type,omitempty"` + // Unique identifier of the evaluation metric event. + Id *string `json:"id,omitempty"` + // JSON value. Present when `metric_type` is `json`. + JsonValue map[string]interface{} `json:"json_value,omitempty"` + // Label or name for the metric. + Label *string `json:"label,omitempty"` + // Arbitrary metadata associated with the metric. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Source of the metric. Either `custom` (user-submitted) or `summary` (experiment-level aggregate). + MetricSource *string `json:"metric_source,omitempty"` + // Type of metric recorded for an LLM Observability experiment. + MetricType *LLMObsMetricScoreType `json:"metric_type,omitempty"` + // Human-readable reasoning for the metric value. + Reasoning datadog.NullableString `json:"reasoning,omitempty"` + // Numeric score. Present when `metric_type` is `score`. + ScoreValue datadog.NullableFloat64 `json:"score_value,omitempty"` + // Span ID this metric is associated with. + SpanId *string `json:"span_id,omitempty"` + // Tags associated with the metric. + Tags []string `json:"tags,omitempty"` + // Timestamp when the metric was recorded, in milliseconds since Unix epoch. + TimestampMs *int64 `json:"timestamp_ms,omitempty"` + // Trace ID linking this metric to a span. + TraceId *string `json:"trace_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentEvalMetricEvent instantiates a new LLMObsExperimentEvalMetricEvent object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentEvalMetricEvent() *LLMObsExperimentEvalMetricEvent { + this := LLMObsExperimentEvalMetricEvent{} + return &this +} + +// NewLLMObsExperimentEvalMetricEventWithDefaults instantiates a new LLMObsExperimentEvalMetricEvent object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentEvalMetricEventWithDefaults() *LLMObsExperimentEvalMetricEvent { + this := LLMObsExperimentEvalMetricEvent{} + return &this +} + +// GetAssessment returns the Assessment field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetAssessment() LLMObsMetricAssessment { + if o == nil || o.Assessment == nil { + var ret LLMObsMetricAssessment + return ret + } + return *o.Assessment +} + +// GetAssessmentOk returns a tuple with the Assessment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetAssessmentOk() (*LLMObsMetricAssessment, bool) { + if o == nil || o.Assessment == nil { + return nil, false + } + return o.Assessment, true +} + +// HasAssessment returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasAssessment() bool { + return o != nil && o.Assessment != nil +} + +// SetAssessment gets a reference to the given LLMObsMetricAssessment and assigns it to the Assessment field. +func (o *LLMObsExperimentEvalMetricEvent) SetAssessment(v LLMObsMetricAssessment) { + o.Assessment = &v +} + +// GetBooleanValue returns the BooleanValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetBooleanValue() bool { + if o == nil || o.BooleanValue.Get() == nil { + var ret bool + return ret + } + return *o.BooleanValue.Get() +} + +// GetBooleanValueOk returns a tuple with the BooleanValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetBooleanValueOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.BooleanValue.Get(), o.BooleanValue.IsSet() +} + +// HasBooleanValue returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasBooleanValue() bool { + return o != nil && o.BooleanValue.IsSet() +} + +// SetBooleanValue gets a reference to the given datadog.NullableBool and assigns it to the BooleanValue field. +func (o *LLMObsExperimentEvalMetricEvent) SetBooleanValue(v bool) { + o.BooleanValue.Set(&v) +} + +// SetBooleanValueNil sets the value for BooleanValue to be an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) SetBooleanValueNil() { + o.BooleanValue.Set(nil) +} + +// UnsetBooleanValue ensures that no value is present for BooleanValue, not even an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) UnsetBooleanValue() { + o.BooleanValue.Unset() +} + +// GetCategoricalValue returns the CategoricalValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetCategoricalValue() string { + if o == nil || o.CategoricalValue.Get() == nil { + var ret string + return ret + } + return *o.CategoricalValue.Get() +} + +// GetCategoricalValueOk returns a tuple with the CategoricalValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetCategoricalValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CategoricalValue.Get(), o.CategoricalValue.IsSet() +} + +// HasCategoricalValue returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasCategoricalValue() bool { + return o != nil && o.CategoricalValue.IsSet() +} + +// SetCategoricalValue gets a reference to the given datadog.NullableString and assigns it to the CategoricalValue field. +func (o *LLMObsExperimentEvalMetricEvent) SetCategoricalValue(v string) { + o.CategoricalValue.Set(&v) +} + +// SetCategoricalValueNil sets the value for CategoricalValue to be an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) SetCategoricalValueNil() { + o.CategoricalValue.Set(nil) +} + +// UnsetCategoricalValue ensures that no value is present for CategoricalValue, not even an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) UnsetCategoricalValue() { + o.CategoricalValue.Unset() +} + +// GetEvalSourceType returns the EvalSourceType field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetEvalSourceType() string { + if o == nil || o.EvalSourceType == nil { + var ret string + return ret + } + return *o.EvalSourceType +} + +// GetEvalSourceTypeOk returns a tuple with the EvalSourceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetEvalSourceTypeOk() (*string, bool) { + if o == nil || o.EvalSourceType == nil { + return nil, false + } + return o.EvalSourceType, true +} + +// HasEvalSourceType returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasEvalSourceType() bool { + return o != nil && o.EvalSourceType != nil +} + +// SetEvalSourceType gets a reference to the given string and assigns it to the EvalSourceType field. +func (o *LLMObsExperimentEvalMetricEvent) SetEvalSourceType(v string) { + o.EvalSourceType = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LLMObsExperimentEvalMetricEvent) SetId(v string) { + o.Id = &v +} + +// GetJsonValue returns the JsonValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetJsonValue() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.JsonValue +} + +// GetJsonValueOk returns a tuple with the JsonValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetJsonValueOk() (*map[string]interface{}, bool) { + if o == nil || o.JsonValue == nil { + return nil, false + } + return &o.JsonValue, true +} + +// HasJsonValue returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasJsonValue() bool { + return o != nil && o.JsonValue != nil +} + +// SetJsonValue gets a reference to the given map[string]interface{} and assigns it to the JsonValue field. +func (o *LLMObsExperimentEvalMetricEvent) SetJsonValue(v map[string]interface{}) { + o.JsonValue = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetLabel() string { + if o == nil || o.Label == nil { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetLabelOk() (*string, bool) { + if o == nil || o.Label == nil { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasLabel() bool { + return o != nil && o.Label != nil +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *LLMObsExperimentEvalMetricEvent) SetLabel(v string) { + o.Label = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return &o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasMetadata() bool { + return o != nil && o.Metadata != nil +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *LLMObsExperimentEvalMetricEvent) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetMetricSource returns the MetricSource field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetMetricSource() string { + if o == nil || o.MetricSource == nil { + var ret string + return ret + } + return *o.MetricSource +} + +// GetMetricSourceOk returns a tuple with the MetricSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetMetricSourceOk() (*string, bool) { + if o == nil || o.MetricSource == nil { + return nil, false + } + return o.MetricSource, true +} + +// HasMetricSource returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasMetricSource() bool { + return o != nil && o.MetricSource != nil +} + +// SetMetricSource gets a reference to the given string and assigns it to the MetricSource field. +func (o *LLMObsExperimentEvalMetricEvent) SetMetricSource(v string) { + o.MetricSource = &v +} + +// GetMetricType returns the MetricType field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetMetricType() LLMObsMetricScoreType { + if o == nil || o.MetricType == nil { + var ret LLMObsMetricScoreType + return ret + } + return *o.MetricType +} + +// GetMetricTypeOk returns a tuple with the MetricType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetMetricTypeOk() (*LLMObsMetricScoreType, bool) { + if o == nil || o.MetricType == nil { + return nil, false + } + return o.MetricType, true +} + +// HasMetricType returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasMetricType() bool { + return o != nil && o.MetricType != nil +} + +// SetMetricType gets a reference to the given LLMObsMetricScoreType and assigns it to the MetricType field. +func (o *LLMObsExperimentEvalMetricEvent) SetMetricType(v LLMObsMetricScoreType) { + o.MetricType = &v +} + +// GetReasoning returns the Reasoning field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetReasoning() string { + if o == nil || o.Reasoning.Get() == nil { + var ret string + return ret + } + return *o.Reasoning.Get() +} + +// GetReasoningOk returns a tuple with the Reasoning field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetReasoningOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Reasoning.Get(), o.Reasoning.IsSet() +} + +// HasReasoning returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasReasoning() bool { + return o != nil && o.Reasoning.IsSet() +} + +// SetReasoning gets a reference to the given datadog.NullableString and assigns it to the Reasoning field. +func (o *LLMObsExperimentEvalMetricEvent) SetReasoning(v string) { + o.Reasoning.Set(&v) +} + +// SetReasoningNil sets the value for Reasoning to be an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) SetReasoningNil() { + o.Reasoning.Set(nil) +} + +// UnsetReasoning ensures that no value is present for Reasoning, not even an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) UnsetReasoning() { + o.Reasoning.Unset() +} + +// GetScoreValue returns the ScoreValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentEvalMetricEvent) GetScoreValue() float64 { + if o == nil || o.ScoreValue.Get() == nil { + var ret float64 + return ret + } + return *o.ScoreValue.Get() +} + +// GetScoreValueOk returns a tuple with the ScoreValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentEvalMetricEvent) GetScoreValueOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.ScoreValue.Get(), o.ScoreValue.IsSet() +} + +// HasScoreValue returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasScoreValue() bool { + return o != nil && o.ScoreValue.IsSet() +} + +// SetScoreValue gets a reference to the given datadog.NullableFloat64 and assigns it to the ScoreValue field. +func (o *LLMObsExperimentEvalMetricEvent) SetScoreValue(v float64) { + o.ScoreValue.Set(&v) +} + +// SetScoreValueNil sets the value for ScoreValue to be an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) SetScoreValueNil() { + o.ScoreValue.Set(nil) +} + +// UnsetScoreValue ensures that no value is present for ScoreValue, not even an explicit nil. +func (o *LLMObsExperimentEvalMetricEvent) UnsetScoreValue() { + o.ScoreValue.Unset() +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetSpanId() string { + if o == nil || o.SpanId == nil { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetSpanIdOk() (*string, bool) { + if o == nil || o.SpanId == nil { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasSpanId() bool { + return o != nil && o.SpanId != nil +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *LLMObsExperimentEvalMetricEvent) SetSpanId(v string) { + o.SpanId = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *LLMObsExperimentEvalMetricEvent) SetTags(v []string) { + o.Tags = v +} + +// GetTimestampMs returns the TimestampMs field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetTimestampMs() int64 { + if o == nil || o.TimestampMs == nil { + var ret int64 + return ret + } + return *o.TimestampMs +} + +// GetTimestampMsOk returns a tuple with the TimestampMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetTimestampMsOk() (*int64, bool) { + if o == nil || o.TimestampMs == nil { + return nil, false + } + return o.TimestampMs, true +} + +// HasTimestampMs returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasTimestampMs() bool { + return o != nil && o.TimestampMs != nil +} + +// SetTimestampMs gets a reference to the given int64 and assigns it to the TimestampMs field. +func (o *LLMObsExperimentEvalMetricEvent) SetTimestampMs(v int64) { + o.TimestampMs = &v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *LLMObsExperimentEvalMetricEvent) GetTraceId() string { + if o == nil || o.TraceId == nil { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEvalMetricEvent) GetTraceIdOk() (*string, bool) { + if o == nil || o.TraceId == nil { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *LLMObsExperimentEvalMetricEvent) HasTraceId() bool { + return o != nil && o.TraceId != nil +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *LLMObsExperimentEvalMetricEvent) SetTraceId(v string) { + o.TraceId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentEvalMetricEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Assessment != nil { + toSerialize["assessment"] = o.Assessment + } + if o.BooleanValue.IsSet() { + toSerialize["boolean_value"] = o.BooleanValue.Get() + } + if o.CategoricalValue.IsSet() { + toSerialize["categorical_value"] = o.CategoricalValue.Get() + } + if o.EvalSourceType != nil { + toSerialize["eval_source_type"] = o.EvalSourceType + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.JsonValue != nil { + toSerialize["json_value"] = o.JsonValue + } + if o.Label != nil { + toSerialize["label"] = o.Label + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.MetricSource != nil { + toSerialize["metric_source"] = o.MetricSource + } + if o.MetricType != nil { + toSerialize["metric_type"] = o.MetricType + } + if o.Reasoning.IsSet() { + toSerialize["reasoning"] = o.Reasoning.Get() + } + if o.ScoreValue.IsSet() { + toSerialize["score_value"] = o.ScoreValue.Get() + } + if o.SpanId != nil { + toSerialize["span_id"] = o.SpanId + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.TimestampMs != nil { + toSerialize["timestamp_ms"] = o.TimestampMs + } + if o.TraceId != nil { + toSerialize["trace_id"] = o.TraceId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentEvalMetricEvent) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Assessment *LLMObsMetricAssessment `json:"assessment,omitempty"` + BooleanValue datadog.NullableBool `json:"boolean_value,omitempty"` + CategoricalValue datadog.NullableString `json:"categorical_value,omitempty"` + EvalSourceType *string `json:"eval_source_type,omitempty"` + Id *string `json:"id,omitempty"` + JsonValue map[string]interface{} `json:"json_value,omitempty"` + Label *string `json:"label,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + MetricSource *string `json:"metric_source,omitempty"` + MetricType *LLMObsMetricScoreType `json:"metric_type,omitempty"` + Reasoning datadog.NullableString `json:"reasoning,omitempty"` + ScoreValue datadog.NullableFloat64 `json:"score_value,omitempty"` + SpanId *string `json:"span_id,omitempty"` + Tags []string `json:"tags,omitempty"` + TimestampMs *int64 `json:"timestamp_ms,omitempty"` + TraceId *string `json:"trace_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"assessment", "boolean_value", "categorical_value", "eval_source_type", "id", "json_value", "label", "metadata", "metric_source", "metric_type", "reasoning", "score_value", "span_id", "tags", "timestamp_ms", "trace_id"}) + } else { + return err + } + + hasInvalidField := false + if all.Assessment != nil && !all.Assessment.IsValid() { + hasInvalidField = true + } else { + o.Assessment = all.Assessment + } + o.BooleanValue = all.BooleanValue + o.CategoricalValue = all.CategoricalValue + o.EvalSourceType = all.EvalSourceType + o.Id = all.Id + o.JsonValue = all.JsonValue + o.Label = all.Label + o.Metadata = all.Metadata + o.MetricSource = all.MetricSource + if all.MetricType != nil && !all.MetricType.IsValid() { + hasInvalidField = true + } else { + o.MetricType = all.MetricType + } + o.Reasoning = all.Reasoning + o.ScoreValue = all.ScoreValue + o.SpanId = all.SpanId + o.Tags = all.Tags + o.TimestampMs = all.TimestampMs + o.TraceId = all.TraceId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experiment_events_type.go b/api/datadogV2/model_llm_obs_experiment_events_type.go new file mode 100644 index 00000000000..4ccf6e06ee4 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_events_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentEventsType Resource type for an experiment events collection. +type LLMObsExperimentEventsType string + +// List of LLMObsExperimentEventsType. +const ( + LLMOBSEXPERIMENTEVENTSTYPE_EXPERIMENT_EVENTS LLMObsExperimentEventsType = "experiment_events" +) + +var allowedLLMObsExperimentEventsTypeEnumValues = []LLMObsExperimentEventsType{ + LLMOBSEXPERIMENTEVENTSTYPE_EXPERIMENT_EVENTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsExperimentEventsType) GetAllowedValues() []LLMObsExperimentEventsType { + return allowedLLMObsExperimentEventsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsExperimentEventsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsExperimentEventsType(value) + return nil +} + +// NewLLMObsExperimentEventsTypeFromValue returns a pointer to a valid LLMObsExperimentEventsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsExperimentEventsTypeFromValue(v string) (*LLMObsExperimentEventsType, error) { + ev := LLMObsExperimentEventsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsExperimentEventsType: valid values are %v", v, allowedLLMObsExperimentEventsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsExperimentEventsType) IsValid() bool { + for _, existing := range allowedLLMObsExperimentEventsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsExperimentEventsType value. +func (v LLMObsExperimentEventsType) Ptr() *LLMObsExperimentEventsType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_experiment_events_v2_data_attributes_response.go b/api/datadogV2/model_llm_obs_experiment_events_v2_data_attributes_response.go new file mode 100644 index 00000000000..6ec4a5e734b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_events_v2_data_attributes_response.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentEventsV2DataAttributesResponse Attributes of an experiment events response. +type LLMObsExperimentEventsV2DataAttributesResponse struct { + // Experiment spans, each enriched with their associated evaluation metrics. + Spans []LLMObsExperimentSpanWithEvals `json:"spans"` + // Experiment-level summary evaluation metrics (not tied to individual spans). + SummaryMetrics []LLMObsExperimentEvalMetricEvent `json:"summary_metrics"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentEventsV2DataAttributesResponse instantiates a new LLMObsExperimentEventsV2DataAttributesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentEventsV2DataAttributesResponse(spans []LLMObsExperimentSpanWithEvals, summaryMetrics []LLMObsExperimentEvalMetricEvent) *LLMObsExperimentEventsV2DataAttributesResponse { + this := LLMObsExperimentEventsV2DataAttributesResponse{} + this.Spans = spans + this.SummaryMetrics = summaryMetrics + return &this +} + +// NewLLMObsExperimentEventsV2DataAttributesResponseWithDefaults instantiates a new LLMObsExperimentEventsV2DataAttributesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentEventsV2DataAttributesResponseWithDefaults() *LLMObsExperimentEventsV2DataAttributesResponse { + this := LLMObsExperimentEventsV2DataAttributesResponse{} + return &this +} + +// GetSpans returns the Spans field value. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) GetSpans() []LLMObsExperimentSpanWithEvals { + if o == nil { + var ret []LLMObsExperimentSpanWithEvals + return ret + } + return o.Spans +} + +// GetSpansOk returns a tuple with the Spans field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) GetSpansOk() (*[]LLMObsExperimentSpanWithEvals, bool) { + if o == nil { + return nil, false + } + return &o.Spans, true +} + +// SetSpans sets field value. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) SetSpans(v []LLMObsExperimentSpanWithEvals) { + o.Spans = v +} + +// GetSummaryMetrics returns the SummaryMetrics field value. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) GetSummaryMetrics() []LLMObsExperimentEvalMetricEvent { + if o == nil { + var ret []LLMObsExperimentEvalMetricEvent + return ret + } + return o.SummaryMetrics +} + +// GetSummaryMetricsOk returns a tuple with the SummaryMetrics field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) GetSummaryMetricsOk() (*[]LLMObsExperimentEvalMetricEvent, bool) { + if o == nil { + return nil, false + } + return &o.SummaryMetrics, true +} + +// SetSummaryMetrics sets field value. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) SetSummaryMetrics(v []LLMObsExperimentEvalMetricEvent) { + o.SummaryMetrics = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentEventsV2DataAttributesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["spans"] = o.Spans + toSerialize["summary_metrics"] = o.SummaryMetrics + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentEventsV2DataAttributesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Spans *[]LLMObsExperimentSpanWithEvals `json:"spans"` + SummaryMetrics *[]LLMObsExperimentEvalMetricEvent `json:"summary_metrics"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Spans == nil { + return fmt.Errorf("required field spans missing") + } + if all.SummaryMetrics == nil { + return fmt.Errorf("required field summary_metrics missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"spans", "summary_metrics"}) + } else { + return err + } + o.Spans = *all.Spans + o.SummaryMetrics = *all.SummaryMetrics + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experiment_events_v2_data_response.go b/api/datadogV2/model_llm_obs_experiment_events_v2_data_response.go new file mode 100644 index 00000000000..f0fe7926885 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_events_v2_data_response.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentEventsV2DataResponse JSON:API data object for an experiment events response. +type LLMObsExperimentEventsV2DataResponse struct { + // Attributes of an experiment events response. + Attributes LLMObsExperimentEventsV2DataAttributesResponse `json:"attributes"` + // Identifier for this events resource. + Id string `json:"id"` + // Resource type for an experiment events collection. + Type LLMObsExperimentEventsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentEventsV2DataResponse instantiates a new LLMObsExperimentEventsV2DataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentEventsV2DataResponse(attributes LLMObsExperimentEventsV2DataAttributesResponse, id string, typeVar LLMObsExperimentEventsType) *LLMObsExperimentEventsV2DataResponse { + this := LLMObsExperimentEventsV2DataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentEventsV2DataResponseWithDefaults instantiates a new LLMObsExperimentEventsV2DataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentEventsV2DataResponseWithDefaults() *LLMObsExperimentEventsV2DataResponse { + this := LLMObsExperimentEventsV2DataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentEventsV2DataResponse) GetAttributes() LLMObsExperimentEventsV2DataAttributesResponse { + if o == nil { + var ret LLMObsExperimentEventsV2DataAttributesResponse + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2DataResponse) GetAttributesOk() (*LLMObsExperimentEventsV2DataAttributesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentEventsV2DataResponse) SetAttributes(v LLMObsExperimentEventsV2DataAttributesResponse) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsExperimentEventsV2DataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2DataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsExperimentEventsV2DataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentEventsV2DataResponse) GetType() LLMObsExperimentEventsType { + if o == nil { + var ret LLMObsExperimentEventsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2DataResponse) GetTypeOk() (*LLMObsExperimentEventsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentEventsV2DataResponse) SetType(v LLMObsExperimentEventsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentEventsV2DataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentEventsV2DataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentEventsV2DataAttributesResponse `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsExperimentEventsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experiment_events_v2_response.go b/api/datadogV2/model_llm_obs_experiment_events_v2_response.go new file mode 100644 index 00000000000..32cbdecf997 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_events_v2_response.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentEventsV2Response Response for listing experiment events (v2/v3). Returns spans and summary metrics in a single resource. +type LLMObsExperimentEventsV2Response struct { + // JSON:API data object for an experiment events response. + Data LLMObsExperimentEventsV2DataResponse `json:"data"` + // Pagination cursor metadata. + Meta *LLMObsCursorMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentEventsV2Response instantiates a new LLMObsExperimentEventsV2Response object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentEventsV2Response(data LLMObsExperimentEventsV2DataResponse) *LLMObsExperimentEventsV2Response { + this := LLMObsExperimentEventsV2Response{} + this.Data = data + return &this +} + +// NewLLMObsExperimentEventsV2ResponseWithDefaults instantiates a new LLMObsExperimentEventsV2Response object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentEventsV2ResponseWithDefaults() *LLMObsExperimentEventsV2Response { + this := LLMObsExperimentEventsV2Response{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentEventsV2Response) GetData() LLMObsExperimentEventsV2DataResponse { + if o == nil { + var ret LLMObsExperimentEventsV2DataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2Response) GetDataOk() (*LLMObsExperimentEventsV2DataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentEventsV2Response) SetData(v LLMObsExperimentEventsV2DataResponse) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *LLMObsExperimentEventsV2Response) GetMeta() LLMObsCursorMeta { + if o == nil || o.Meta == nil { + var ret LLMObsCursorMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentEventsV2Response) GetMetaOk() (*LLMObsCursorMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *LLMObsExperimentEventsV2Response) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given LLMObsCursorMeta and assigns it to the Meta field. +func (o *LLMObsExperimentEventsV2Response) SetMeta(v LLMObsCursorMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentEventsV2Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentEventsV2Response) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentEventsV2DataResponse `json:"data"` + Meta *LLMObsCursorMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experiment_run_data_response.go b/api/datadogV2/model_llm_obs_experiment_run_data_response.go new file mode 100644 index 00000000000..7c2db73f00b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_run_data_response.go @@ -0,0 +1,249 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentRunDataResponse Data object for an LLM Observability experiment run. +type LLMObsExperimentRunDataResponse struct { + // Aggregated metric data for this run. + AggregateData map[string]interface{} `json:"aggregate_data,omitempty"` + // Timestamp when the run was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Identifier of the experiment this run belongs to. + ExperimentId *string `json:"experiment_id,omitempty"` + // Unique identifier of the experiment run. + Id *string `json:"id,omitempty"` + // Sequential number of this run within the experiment. + RunNumber *int32 `json:"run_number,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentRunDataResponse instantiates a new LLMObsExperimentRunDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentRunDataResponse() *LLMObsExperimentRunDataResponse { + this := LLMObsExperimentRunDataResponse{} + return &this +} + +// NewLLMObsExperimentRunDataResponseWithDefaults instantiates a new LLMObsExperimentRunDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentRunDataResponseWithDefaults() *LLMObsExperimentRunDataResponse { + this := LLMObsExperimentRunDataResponse{} + return &this +} + +// GetAggregateData returns the AggregateData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentRunDataResponse) GetAggregateData() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.AggregateData +} + +// GetAggregateDataOk returns a tuple with the AggregateData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentRunDataResponse) GetAggregateDataOk() (*map[string]interface{}, bool) { + if o == nil || o.AggregateData == nil { + return nil, false + } + return &o.AggregateData, true +} + +// HasAggregateData returns a boolean if a field has been set. +func (o *LLMObsExperimentRunDataResponse) HasAggregateData() bool { + return o != nil && o.AggregateData != nil +} + +// SetAggregateData gets a reference to the given map[string]interface{} and assigns it to the AggregateData field. +func (o *LLMObsExperimentRunDataResponse) SetAggregateData(v map[string]interface{}) { + o.AggregateData = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *LLMObsExperimentRunDataResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentRunDataResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *LLMObsExperimentRunDataResponse) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *LLMObsExperimentRunDataResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetExperimentId returns the ExperimentId field value if set, zero value otherwise. +func (o *LLMObsExperimentRunDataResponse) GetExperimentId() string { + if o == nil || o.ExperimentId == nil { + var ret string + return ret + } + return *o.ExperimentId +} + +// GetExperimentIdOk returns a tuple with the ExperimentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentRunDataResponse) GetExperimentIdOk() (*string, bool) { + if o == nil || o.ExperimentId == nil { + return nil, false + } + return o.ExperimentId, true +} + +// HasExperimentId returns a boolean if a field has been set. +func (o *LLMObsExperimentRunDataResponse) HasExperimentId() bool { + return o != nil && o.ExperimentId != nil +} + +// SetExperimentId gets a reference to the given string and assigns it to the ExperimentId field. +func (o *LLMObsExperimentRunDataResponse) SetExperimentId(v string) { + o.ExperimentId = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LLMObsExperimentRunDataResponse) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentRunDataResponse) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LLMObsExperimentRunDataResponse) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LLMObsExperimentRunDataResponse) SetId(v string) { + o.Id = &v +} + +// GetRunNumber returns the RunNumber field value if set, zero value otherwise. +func (o *LLMObsExperimentRunDataResponse) GetRunNumber() int32 { + if o == nil || o.RunNumber == nil { + var ret int32 + return ret + } + return *o.RunNumber +} + +// GetRunNumberOk returns a tuple with the RunNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentRunDataResponse) GetRunNumberOk() (*int32, bool) { + if o == nil || o.RunNumber == nil { + return nil, false + } + return o.RunNumber, true +} + +// HasRunNumber returns a boolean if a field has been set. +func (o *LLMObsExperimentRunDataResponse) HasRunNumber() bool { + return o != nil && o.RunNumber != nil +} + +// SetRunNumber gets a reference to the given int32 and assigns it to the RunNumber field. +func (o *LLMObsExperimentRunDataResponse) SetRunNumber(v int32) { + o.RunNumber = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentRunDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AggregateData != nil { + toSerialize["aggregate_data"] = o.AggregateData + } + if o.CreatedAt != nil { + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.ExperimentId != nil { + toSerialize["experiment_id"] = o.ExperimentId + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.RunNumber != nil { + toSerialize["run_number"] = o.RunNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentRunDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AggregateData map[string]interface{} `json:"aggregate_data,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + ExperimentId *string `json:"experiment_id,omitempty"` + Id *string `json:"id,omitempty"` + RunNumber *int32 `json:"run_number,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"aggregate_data", "created_at", "experiment_id", "id", "run_number"}) + } else { + return err + } + o.AggregateData = all.AggregateData + o.CreatedAt = all.CreatedAt + o.ExperimentId = all.ExperimentId + o.Id = all.Id + o.RunNumber = all.RunNumber + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experiment_span_with_evals.go b/api/datadogV2/model_llm_obs_experiment_span_with_evals.go new file mode 100644 index 00000000000..f7f94983a9d --- /dev/null +++ b/api/datadogV2/model_llm_obs_experiment_span_with_evals.go @@ -0,0 +1,546 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentSpanWithEvals An experiment span enriched with its associated evaluation metrics. +type LLMObsExperimentSpanWithEvals struct { + // ID of the dataset record this span evaluated. + DatasetRecordId datadog.NullableString `json:"dataset_record_id,omitempty"` + // Duration of the span in nanoseconds. + Duration *float64 `json:"duration,omitempty"` + // Evaluation metrics associated with this span. + EvalMetrics []LLMObsExperimentEvalMetricEvent `json:"eval_metrics,omitempty"` + // Unique identifier of the span. + Id *string `json:"id,omitempty"` + // Metadata associated with an experiment span. + Meta *LLMObsExperimentSpanMeta `json:"meta,omitempty"` + // Numeric metrics attached to the span. + Metrics map[string]float64 `json:"metrics,omitempty"` + // Name of the span. + Name *string `json:"name,omitempty"` + // Parent span ID, if any. + ParentId *string `json:"parent_id,omitempty"` + // Span ID. + SpanId *string `json:"span_id,omitempty"` + // Start time in nanoseconds since Unix epoch. + StartNs *int64 `json:"start_ns,omitempty"` + // Status of the span. + Status *LLMObsExperimentSpanStatus `json:"status,omitempty"` + // Tags associated with the span. + Tags []string `json:"tags,omitempty"` + // Trace ID. + TraceId *string `json:"trace_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentSpanWithEvals instantiates a new LLMObsExperimentSpanWithEvals object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentSpanWithEvals() *LLMObsExperimentSpanWithEvals { + this := LLMObsExperimentSpanWithEvals{} + return &this +} + +// NewLLMObsExperimentSpanWithEvalsWithDefaults instantiates a new LLMObsExperimentSpanWithEvals object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentSpanWithEvalsWithDefaults() *LLMObsExperimentSpanWithEvals { + this := LLMObsExperimentSpanWithEvals{} + return &this +} + +// GetDatasetRecordId returns the DatasetRecordId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentSpanWithEvals) GetDatasetRecordId() string { + if o == nil || o.DatasetRecordId.Get() == nil { + var ret string + return ret + } + return *o.DatasetRecordId.Get() +} + +// GetDatasetRecordIdOk returns a tuple with the DatasetRecordId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentSpanWithEvals) GetDatasetRecordIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DatasetRecordId.Get(), o.DatasetRecordId.IsSet() +} + +// HasDatasetRecordId returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasDatasetRecordId() bool { + return o != nil && o.DatasetRecordId.IsSet() +} + +// SetDatasetRecordId gets a reference to the given datadog.NullableString and assigns it to the DatasetRecordId field. +func (o *LLMObsExperimentSpanWithEvals) SetDatasetRecordId(v string) { + o.DatasetRecordId.Set(&v) +} + +// SetDatasetRecordIdNil sets the value for DatasetRecordId to be an explicit nil. +func (o *LLMObsExperimentSpanWithEvals) SetDatasetRecordIdNil() { + o.DatasetRecordId.Set(nil) +} + +// UnsetDatasetRecordId ensures that no value is present for DatasetRecordId, not even an explicit nil. +func (o *LLMObsExperimentSpanWithEvals) UnsetDatasetRecordId() { + o.DatasetRecordId.Unset() +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetDuration() float64 { + if o == nil || o.Duration == nil { + var ret float64 + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetDurationOk() (*float64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given float64 and assigns it to the Duration field. +func (o *LLMObsExperimentSpanWithEvals) SetDuration(v float64) { + o.Duration = &v +} + +// GetEvalMetrics returns the EvalMetrics field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetEvalMetrics() []LLMObsExperimentEvalMetricEvent { + if o == nil || o.EvalMetrics == nil { + var ret []LLMObsExperimentEvalMetricEvent + return ret + } + return o.EvalMetrics +} + +// GetEvalMetricsOk returns a tuple with the EvalMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetEvalMetricsOk() (*[]LLMObsExperimentEvalMetricEvent, bool) { + if o == nil || o.EvalMetrics == nil { + return nil, false + } + return &o.EvalMetrics, true +} + +// HasEvalMetrics returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasEvalMetrics() bool { + return o != nil && o.EvalMetrics != nil +} + +// SetEvalMetrics gets a reference to the given []LLMObsExperimentEvalMetricEvent and assigns it to the EvalMetrics field. +func (o *LLMObsExperimentSpanWithEvals) SetEvalMetrics(v []LLMObsExperimentEvalMetricEvent) { + o.EvalMetrics = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LLMObsExperimentSpanWithEvals) SetId(v string) { + o.Id = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetMeta() LLMObsExperimentSpanMeta { + if o == nil || o.Meta == nil { + var ret LLMObsExperimentSpanMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetMetaOk() (*LLMObsExperimentSpanMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given LLMObsExperimentSpanMeta and assigns it to the Meta field. +func (o *LLMObsExperimentSpanWithEvals) SetMeta(v LLMObsExperimentSpanMeta) { + o.Meta = &v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetMetrics() map[string]float64 { + if o == nil || o.Metrics == nil { + var ret map[string]float64 + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetMetricsOk() (*map[string]float64, bool) { + if o == nil || o.Metrics == nil { + return nil, false + } + return &o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasMetrics() bool { + return o != nil && o.Metrics != nil +} + +// SetMetrics gets a reference to the given map[string]float64 and assigns it to the Metrics field. +func (o *LLMObsExperimentSpanWithEvals) SetMetrics(v map[string]float64) { + o.Metrics = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsExperimentSpanWithEvals) SetName(v string) { + o.Name = &v +} + +// GetParentId returns the ParentId field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetParentId() string { + if o == nil || o.ParentId == nil { + var ret string + return ret + } + return *o.ParentId +} + +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetParentIdOk() (*string, bool) { + if o == nil || o.ParentId == nil { + return nil, false + } + return o.ParentId, true +} + +// HasParentId returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasParentId() bool { + return o != nil && o.ParentId != nil +} + +// SetParentId gets a reference to the given string and assigns it to the ParentId field. +func (o *LLMObsExperimentSpanWithEvals) SetParentId(v string) { + o.ParentId = &v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetSpanId() string { + if o == nil || o.SpanId == nil { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetSpanIdOk() (*string, bool) { + if o == nil || o.SpanId == nil { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasSpanId() bool { + return o != nil && o.SpanId != nil +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *LLMObsExperimentSpanWithEvals) SetSpanId(v string) { + o.SpanId = &v +} + +// GetStartNs returns the StartNs field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetStartNs() int64 { + if o == nil || o.StartNs == nil { + var ret int64 + return ret + } + return *o.StartNs +} + +// GetStartNsOk returns a tuple with the StartNs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetStartNsOk() (*int64, bool) { + if o == nil || o.StartNs == nil { + return nil, false + } + return o.StartNs, true +} + +// HasStartNs returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasStartNs() bool { + return o != nil && o.StartNs != nil +} + +// SetStartNs gets a reference to the given int64 and assigns it to the StartNs field. +func (o *LLMObsExperimentSpanWithEvals) SetStartNs(v int64) { + o.StartNs = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetStatus() LLMObsExperimentSpanStatus { + if o == nil || o.Status == nil { + var ret LLMObsExperimentSpanStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetStatusOk() (*LLMObsExperimentSpanStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given LLMObsExperimentSpanStatus and assigns it to the Status field. +func (o *LLMObsExperimentSpanWithEvals) SetStatus(v LLMObsExperimentSpanStatus) { + o.Status = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *LLMObsExperimentSpanWithEvals) SetTags(v []string) { + o.Tags = v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *LLMObsExperimentSpanWithEvals) GetTraceId() string { + if o == nil || o.TraceId == nil { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentSpanWithEvals) GetTraceIdOk() (*string, bool) { + if o == nil || o.TraceId == nil { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *LLMObsExperimentSpanWithEvals) HasTraceId() bool { + return o != nil && o.TraceId != nil +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *LLMObsExperimentSpanWithEvals) SetTraceId(v string) { + o.TraceId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentSpanWithEvals) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DatasetRecordId.IsSet() { + toSerialize["dataset_record_id"] = o.DatasetRecordId.Get() + } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + if o.EvalMetrics != nil { + toSerialize["eval_metrics"] = o.EvalMetrics + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Metrics != nil { + toSerialize["metrics"] = o.Metrics + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ParentId != nil { + toSerialize["parent_id"] = o.ParentId + } + if o.SpanId != nil { + toSerialize["span_id"] = o.SpanId + } + if o.StartNs != nil { + toSerialize["start_ns"] = o.StartNs + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.TraceId != nil { + toSerialize["trace_id"] = o.TraceId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentSpanWithEvals) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DatasetRecordId datadog.NullableString `json:"dataset_record_id,omitempty"` + Duration *float64 `json:"duration,omitempty"` + EvalMetrics []LLMObsExperimentEvalMetricEvent `json:"eval_metrics,omitempty"` + Id *string `json:"id,omitempty"` + Meta *LLMObsExperimentSpanMeta `json:"meta,omitempty"` + Metrics map[string]float64 `json:"metrics,omitempty"` + Name *string `json:"name,omitempty"` + ParentId *string `json:"parent_id,omitempty"` + SpanId *string `json:"span_id,omitempty"` + StartNs *int64 `json:"start_ns,omitempty"` + Status *LLMObsExperimentSpanStatus `json:"status,omitempty"` + Tags []string `json:"tags,omitempty"` + TraceId *string `json:"trace_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"dataset_record_id", "duration", "eval_metrics", "id", "meta", "metrics", "name", "parent_id", "span_id", "start_ns", "status", "tags", "trace_id"}) + } else { + return err + } + + hasInvalidField := false + o.DatasetRecordId = all.DatasetRecordId + o.Duration = all.Duration + o.EvalMetrics = all.EvalMetrics + o.Id = all.Id + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + o.Metrics = all.Metrics + o.Name = all.Name + o.ParentId = all.ParentId + o.SpanId = all.SpanId + o.StartNs = all.StartNs + if all.Status != nil && !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = all.Status + } + o.Tags = all.Tags + o.TraceId = all.TraceId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_aggregate.go b/api/datadogV2/model_llm_obs_experimentation_analytics_aggregate.go new file mode 100644 index 00000000000..3975c6f596c --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_aggregate.go @@ -0,0 +1,339 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsAggregate Analytics aggregation parameters. +type LLMObsExperimentationAnalyticsAggregate struct { + // List of metric computations to perform. + Compute []LLMObsExperimentationAnalyticsCompute `json:"compute"` + // Filter to a specific dataset version. + DatasetVersion datadog.NullableInt64 `json:"dataset_version,omitempty"` + // Fields to group results by. + GroupBy []LLMObsExperimentationAnalyticsGroupBy `json:"group_by,omitempty"` + // Data indexes to query. At least one is required. + Indexes []string `json:"indexes"` + // Maximum number of results to return. + Limit datadog.NullableInt32 `json:"limit,omitempty"` + // Search query for filtering analytics data. + Search LLMObsExperimentationAnalyticsSearch `json:"search"` + // Unix-millisecond time range for filtering analytics data. + Time *LLMObsExperimentationAnalyticsTimeRange `json:"time,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsAggregate instantiates a new LLMObsExperimentationAnalyticsAggregate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsAggregate(compute []LLMObsExperimentationAnalyticsCompute, indexes []string, search LLMObsExperimentationAnalyticsSearch) *LLMObsExperimentationAnalyticsAggregate { + this := LLMObsExperimentationAnalyticsAggregate{} + this.Compute = compute + this.Indexes = indexes + this.Search = search + return &this +} + +// NewLLMObsExperimentationAnalyticsAggregateWithDefaults instantiates a new LLMObsExperimentationAnalyticsAggregate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsAggregateWithDefaults() *LLMObsExperimentationAnalyticsAggregate { + this := LLMObsExperimentationAnalyticsAggregate{} + return &this +} + +// GetCompute returns the Compute field value. +func (o *LLMObsExperimentationAnalyticsAggregate) GetCompute() []LLMObsExperimentationAnalyticsCompute { + if o == nil { + var ret []LLMObsExperimentationAnalyticsCompute + return ret + } + return o.Compute +} + +// GetComputeOk returns a tuple with the Compute field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) GetComputeOk() (*[]LLMObsExperimentationAnalyticsCompute, bool) { + if o == nil { + return nil, false + } + return &o.Compute, true +} + +// SetCompute sets field value. +func (o *LLMObsExperimentationAnalyticsAggregate) SetCompute(v []LLMObsExperimentationAnalyticsCompute) { + o.Compute = v +} + +// GetDatasetVersion returns the DatasetVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationAnalyticsAggregate) GetDatasetVersion() int64 { + if o == nil || o.DatasetVersion.Get() == nil { + var ret int64 + return ret + } + return *o.DatasetVersion.Get() +} + +// GetDatasetVersionOk returns a tuple with the DatasetVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationAnalyticsAggregate) GetDatasetVersionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.DatasetVersion.Get(), o.DatasetVersion.IsSet() +} + +// HasDatasetVersion returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) HasDatasetVersion() bool { + return o != nil && o.DatasetVersion.IsSet() +} + +// SetDatasetVersion gets a reference to the given datadog.NullableInt64 and assigns it to the DatasetVersion field. +func (o *LLMObsExperimentationAnalyticsAggregate) SetDatasetVersion(v int64) { + o.DatasetVersion.Set(&v) +} + +// SetDatasetVersionNil sets the value for DatasetVersion to be an explicit nil. +func (o *LLMObsExperimentationAnalyticsAggregate) SetDatasetVersionNil() { + o.DatasetVersion.Set(nil) +} + +// UnsetDatasetVersion ensures that no value is present for DatasetVersion, not even an explicit nil. +func (o *LLMObsExperimentationAnalyticsAggregate) UnsetDatasetVersion() { + o.DatasetVersion.Unset() +} + +// GetGroupBy returns the GroupBy field value if set, zero value otherwise. +func (o *LLMObsExperimentationAnalyticsAggregate) GetGroupBy() []LLMObsExperimentationAnalyticsGroupBy { + if o == nil || o.GroupBy == nil { + var ret []LLMObsExperimentationAnalyticsGroupBy + return ret + } + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) GetGroupByOk() (*[]LLMObsExperimentationAnalyticsGroupBy, bool) { + if o == nil || o.GroupBy == nil { + return nil, false + } + return &o.GroupBy, true +} + +// HasGroupBy returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) HasGroupBy() bool { + return o != nil && o.GroupBy != nil +} + +// SetGroupBy gets a reference to the given []LLMObsExperimentationAnalyticsGroupBy and assigns it to the GroupBy field. +func (o *LLMObsExperimentationAnalyticsAggregate) SetGroupBy(v []LLMObsExperimentationAnalyticsGroupBy) { + o.GroupBy = v +} + +// GetIndexes returns the Indexes field value. +func (o *LLMObsExperimentationAnalyticsAggregate) GetIndexes() []string { + if o == nil { + var ret []string + return ret + } + return o.Indexes +} + +// GetIndexesOk returns a tuple with the Indexes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) GetIndexesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Indexes, true +} + +// SetIndexes sets field value. +func (o *LLMObsExperimentationAnalyticsAggregate) SetIndexes(v []string) { + o.Indexes = v +} + +// GetLimit returns the Limit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationAnalyticsAggregate) GetLimit() int32 { + if o == nil || o.Limit.Get() == nil { + var ret int32 + return ret + } + return *o.Limit.Get() +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationAnalyticsAggregate) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Limit.Get(), o.Limit.IsSet() +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) HasLimit() bool { + return o != nil && o.Limit.IsSet() +} + +// SetLimit gets a reference to the given datadog.NullableInt32 and assigns it to the Limit field. +func (o *LLMObsExperimentationAnalyticsAggregate) SetLimit(v int32) { + o.Limit.Set(&v) +} + +// SetLimitNil sets the value for Limit to be an explicit nil. +func (o *LLMObsExperimentationAnalyticsAggregate) SetLimitNil() { + o.Limit.Set(nil) +} + +// UnsetLimit ensures that no value is present for Limit, not even an explicit nil. +func (o *LLMObsExperimentationAnalyticsAggregate) UnsetLimit() { + o.Limit.Unset() +} + +// GetSearch returns the Search field value. +func (o *LLMObsExperimentationAnalyticsAggregate) GetSearch() LLMObsExperimentationAnalyticsSearch { + if o == nil { + var ret LLMObsExperimentationAnalyticsSearch + return ret + } + return o.Search +} + +// GetSearchOk returns a tuple with the Search field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) GetSearchOk() (*LLMObsExperimentationAnalyticsSearch, bool) { + if o == nil { + return nil, false + } + return &o.Search, true +} + +// SetSearch sets field value. +func (o *LLMObsExperimentationAnalyticsAggregate) SetSearch(v LLMObsExperimentationAnalyticsSearch) { + o.Search = v +} + +// GetTime returns the Time field value if set, zero value otherwise. +func (o *LLMObsExperimentationAnalyticsAggregate) GetTime() LLMObsExperimentationAnalyticsTimeRange { + if o == nil || o.Time == nil { + var ret LLMObsExperimentationAnalyticsTimeRange + return ret + } + return *o.Time +} + +// GetTimeOk returns a tuple with the Time field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) GetTimeOk() (*LLMObsExperimentationAnalyticsTimeRange, bool) { + if o == nil || o.Time == nil { + return nil, false + } + return o.Time, true +} + +// HasTime returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsAggregate) HasTime() bool { + return o != nil && o.Time != nil +} + +// SetTime gets a reference to the given LLMObsExperimentationAnalyticsTimeRange and assigns it to the Time field. +func (o *LLMObsExperimentationAnalyticsAggregate) SetTime(v LLMObsExperimentationAnalyticsTimeRange) { + o.Time = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsAggregate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["compute"] = o.Compute + if o.DatasetVersion.IsSet() { + toSerialize["dataset_version"] = o.DatasetVersion.Get() + } + if o.GroupBy != nil { + toSerialize["group_by"] = o.GroupBy + } + toSerialize["indexes"] = o.Indexes + if o.Limit.IsSet() { + toSerialize["limit"] = o.Limit.Get() + } + toSerialize["search"] = o.Search + if o.Time != nil { + toSerialize["time"] = o.Time + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsAggregate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Compute *[]LLMObsExperimentationAnalyticsCompute `json:"compute"` + DatasetVersion datadog.NullableInt64 `json:"dataset_version,omitempty"` + GroupBy []LLMObsExperimentationAnalyticsGroupBy `json:"group_by,omitempty"` + Indexes *[]string `json:"indexes"` + Limit datadog.NullableInt32 `json:"limit,omitempty"` + Search *LLMObsExperimentationAnalyticsSearch `json:"search"` + Time *LLMObsExperimentationAnalyticsTimeRange `json:"time,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Compute == nil { + return fmt.Errorf("required field compute missing") + } + if all.Indexes == nil { + return fmt.Errorf("required field indexes missing") + } + if all.Search == nil { + return fmt.Errorf("required field search missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"compute", "dataset_version", "group_by", "indexes", "limit", "search", "time"}) + } else { + return err + } + + hasInvalidField := false + o.Compute = *all.Compute + o.DatasetVersion = all.DatasetVersion + o.GroupBy = all.GroupBy + o.Indexes = *all.Indexes + o.Limit = all.Limit + if all.Search.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Search = *all.Search + if all.Time != nil && all.Time.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Time = all.Time + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_compute.go b/api/datadogV2/model_llm_obs_experimentation_analytics_compute.go new file mode 100644 index 00000000000..36d5da2ed39 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_compute.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsCompute A single metric computation definition. +type LLMObsExperimentationAnalyticsCompute struct { + // Name of the metric to compute. + Metric string `json:"metric"` + // Optional alias for this computation in the response. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsCompute instantiates a new LLMObsExperimentationAnalyticsCompute object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsCompute(metric string) *LLMObsExperimentationAnalyticsCompute { + this := LLMObsExperimentationAnalyticsCompute{} + this.Metric = metric + return &this +} + +// NewLLMObsExperimentationAnalyticsComputeWithDefaults instantiates a new LLMObsExperimentationAnalyticsCompute object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsComputeWithDefaults() *LLMObsExperimentationAnalyticsCompute { + this := LLMObsExperimentationAnalyticsCompute{} + return &this +} + +// GetMetric returns the Metric field value. +func (o *LLMObsExperimentationAnalyticsCompute) GetMetric() string { + if o == nil { + var ret string + return ret + } + return o.Metric +} + +// GetMetricOk returns a tuple with the Metric field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsCompute) GetMetricOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metric, true +} + +// SetMetric sets field value. +func (o *LLMObsExperimentationAnalyticsCompute) SetMetric(v string) { + o.Metric = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsExperimentationAnalyticsCompute) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsCompute) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsCompute) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsExperimentationAnalyticsCompute) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsCompute) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["metric"] = o.Metric + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsCompute) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Metric *string `json:"metric"` + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Metric == nil { + return fmt.Errorf("required field metric missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"metric", "name"}) + } else { + return err + } + o.Metric = *all.Metric + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_request.go b/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_request.go new file mode 100644 index 00000000000..d4e3a978d94 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsDataAttributesRequest Attributes for an analytics request. +type LLMObsExperimentationAnalyticsDataAttributesRequest struct { + // Analytics aggregation parameters. + Aggregate LLMObsExperimentationAnalyticsAggregate `json:"aggregate"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsDataAttributesRequest instantiates a new LLMObsExperimentationAnalyticsDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsDataAttributesRequest(aggregate LLMObsExperimentationAnalyticsAggregate) *LLMObsExperimentationAnalyticsDataAttributesRequest { + this := LLMObsExperimentationAnalyticsDataAttributesRequest{} + this.Aggregate = aggregate + return &this +} + +// NewLLMObsExperimentationAnalyticsDataAttributesRequestWithDefaults instantiates a new LLMObsExperimentationAnalyticsDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsDataAttributesRequestWithDefaults() *LLMObsExperimentationAnalyticsDataAttributesRequest { + this := LLMObsExperimentationAnalyticsDataAttributesRequest{} + return &this +} + +// GetAggregate returns the Aggregate field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesRequest) GetAggregate() LLMObsExperimentationAnalyticsAggregate { + if o == nil { + var ret LLMObsExperimentationAnalyticsAggregate + return ret + } + return o.Aggregate +} + +// GetAggregateOk returns a tuple with the Aggregate field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataAttributesRequest) GetAggregateOk() (*LLMObsExperimentationAnalyticsAggregate, bool) { + if o == nil { + return nil, false + } + return &o.Aggregate, true +} + +// SetAggregate sets field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesRequest) SetAggregate(v LLMObsExperimentationAnalyticsAggregate) { + o.Aggregate = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["aggregate"] = o.Aggregate + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Aggregate *LLMObsExperimentationAnalyticsAggregate `json:"aggregate"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Aggregate == nil { + return fmt.Errorf("required field aggregate missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"aggregate"}) + } else { + return err + } + + hasInvalidField := false + if all.Aggregate.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Aggregate = *all.Aggregate + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_response.go b/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_response.go new file mode 100644 index 00000000000..dbcac60a634 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_data_attributes_response.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsDataAttributesResponse Attributes of an analytics response. +type LLMObsExperimentationAnalyticsDataAttributesResponse struct { + // Total number of events matched by the query before grouping. + HitCount int64 `json:"hit_count"` + // Analytics query result containing all buckets. + Result LLMObsExperimentationAnalyticsResult `json:"result"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsDataAttributesResponse instantiates a new LLMObsExperimentationAnalyticsDataAttributesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsDataAttributesResponse(hitCount int64, result LLMObsExperimentationAnalyticsResult) *LLMObsExperimentationAnalyticsDataAttributesResponse { + this := LLMObsExperimentationAnalyticsDataAttributesResponse{} + this.HitCount = hitCount + this.Result = result + return &this +} + +// NewLLMObsExperimentationAnalyticsDataAttributesResponseWithDefaults instantiates a new LLMObsExperimentationAnalyticsDataAttributesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsDataAttributesResponseWithDefaults() *LLMObsExperimentationAnalyticsDataAttributesResponse { + this := LLMObsExperimentationAnalyticsDataAttributesResponse{} + return &this +} + +// GetHitCount returns the HitCount field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) GetHitCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.HitCount +} + +// GetHitCountOk returns a tuple with the HitCount field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) GetHitCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.HitCount, true +} + +// SetHitCount sets field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) SetHitCount(v int64) { + o.HitCount = v +} + +// GetResult returns the Result field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) GetResult() LLMObsExperimentationAnalyticsResult { + if o == nil { + var ret LLMObsExperimentationAnalyticsResult + return ret + } + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) GetResultOk() (*LLMObsExperimentationAnalyticsResult, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) SetResult(v LLMObsExperimentationAnalyticsResult) { + o.Result = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsDataAttributesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["hit_count"] = o.HitCount + toSerialize["result"] = o.Result + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsDataAttributesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + HitCount *int64 `json:"hit_count"` + Result *LLMObsExperimentationAnalyticsResult `json:"result"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.HitCount == nil { + return fmt.Errorf("required field hit_count missing") + } + if all.Result == nil { + return fmt.Errorf("required field result missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"hit_count", "result"}) + } else { + return err + } + + hasInvalidField := false + o.HitCount = *all.HitCount + if all.Result.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Result = *all.Result + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_data_request.go b/api/datadogV2/model_llm_obs_experimentation_analytics_data_request.go new file mode 100644 index 00000000000..9767c5ff50f --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_data_request.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsDataRequest Data object for an analytics request. +type LLMObsExperimentationAnalyticsDataRequest struct { + // Attributes for an analytics request. + Attributes LLMObsExperimentationAnalyticsDataAttributesRequest `json:"attributes"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsDataRequest instantiates a new LLMObsExperimentationAnalyticsDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsDataRequest(attributes LLMObsExperimentationAnalyticsDataAttributesRequest, typeVar LLMObsExperimentationType) *LLMObsExperimentationAnalyticsDataRequest { + this := LLMObsExperimentationAnalyticsDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationAnalyticsDataRequestWithDefaults instantiates a new LLMObsExperimentationAnalyticsDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsDataRequestWithDefaults() *LLMObsExperimentationAnalyticsDataRequest { + this := LLMObsExperimentationAnalyticsDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationAnalyticsDataRequest) GetAttributes() LLMObsExperimentationAnalyticsDataAttributesRequest { + if o == nil { + var ret LLMObsExperimentationAnalyticsDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataRequest) GetAttributesOk() (*LLMObsExperimentationAnalyticsDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationAnalyticsDataRequest) SetAttributes(v LLMObsExperimentationAnalyticsDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationAnalyticsDataRequest) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataRequest) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationAnalyticsDataRequest) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationAnalyticsDataAttributesRequest `json:"attributes"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_data_response.go b/api/datadogV2/model_llm_obs_experimentation_analytics_data_response.go new file mode 100644 index 00000000000..fb431e60999 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_data_response.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsDataResponse JSON:API data object for an analytics response. +type LLMObsExperimentationAnalyticsDataResponse struct { + // Attributes of an analytics response. + Attributes LLMObsExperimentationAnalyticsDataAttributesResponse `json:"attributes"` + // Server-generated identifier for this analytics result. + Id string `json:"id"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsDataResponse instantiates a new LLMObsExperimentationAnalyticsDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsDataResponse(attributes LLMObsExperimentationAnalyticsDataAttributesResponse, id string, typeVar LLMObsExperimentationType) *LLMObsExperimentationAnalyticsDataResponse { + this := LLMObsExperimentationAnalyticsDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationAnalyticsDataResponseWithDefaults instantiates a new LLMObsExperimentationAnalyticsDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsDataResponseWithDefaults() *LLMObsExperimentationAnalyticsDataResponse { + this := LLMObsExperimentationAnalyticsDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetAttributes() LLMObsExperimentationAnalyticsDataAttributesResponse { + if o == nil { + var ret LLMObsExperimentationAnalyticsDataAttributesResponse + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetAttributesOk() (*LLMObsExperimentationAnalyticsDataAttributesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) SetAttributes(v LLMObsExperimentationAnalyticsDataAttributesResponse) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsDataResponse) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationAnalyticsDataResponse) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationAnalyticsDataAttributesResponse `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_group_by.go b/api/datadogV2/model_llm_obs_experimentation_analytics_group_by.go new file mode 100644 index 00000000000..5f6d18f4ccd --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_group_by.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsGroupBy A field to group analytics results by. +type LLMObsExperimentationAnalyticsGroupBy struct { + // Field name to group by. + Field string `json:"field"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsGroupBy instantiates a new LLMObsExperimentationAnalyticsGroupBy object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsGroupBy(field string) *LLMObsExperimentationAnalyticsGroupBy { + this := LLMObsExperimentationAnalyticsGroupBy{} + this.Field = field + return &this +} + +// NewLLMObsExperimentationAnalyticsGroupByWithDefaults instantiates a new LLMObsExperimentationAnalyticsGroupBy object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsGroupByWithDefaults() *LLMObsExperimentationAnalyticsGroupBy { + this := LLMObsExperimentationAnalyticsGroupBy{} + return &this +} + +// GetField returns the Field field value. +func (o *LLMObsExperimentationAnalyticsGroupBy) GetField() string { + if o == nil { + var ret string + return ret + } + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsGroupBy) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value. +func (o *LLMObsExperimentationAnalyticsGroupBy) SetField(v string) { + o.Field = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsGroupBy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["field"] = o.Field + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsGroupBy) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Field *string `json:"field"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Field == nil { + return fmt.Errorf("required field field missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"field"}) + } else { + return err + } + o.Field = *all.Field + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_request.go b/api/datadogV2/model_llm_obs_experimentation_analytics_request.go new file mode 100644 index 00000000000..aab8d26005b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsRequest Request to run an analytics aggregation over LLM Observability experimentation data. +type LLMObsExperimentationAnalyticsRequest struct { + // Data object for an analytics request. + Data LLMObsExperimentationAnalyticsDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsRequest instantiates a new LLMObsExperimentationAnalyticsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsRequest(data LLMObsExperimentationAnalyticsDataRequest) *LLMObsExperimentationAnalyticsRequest { + this := LLMObsExperimentationAnalyticsRequest{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationAnalyticsRequestWithDefaults instantiates a new LLMObsExperimentationAnalyticsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsRequestWithDefaults() *LLMObsExperimentationAnalyticsRequest { + this := LLMObsExperimentationAnalyticsRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationAnalyticsRequest) GetData() LLMObsExperimentationAnalyticsDataRequest { + if o == nil { + var ret LLMObsExperimentationAnalyticsDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsRequest) GetDataOk() (*LLMObsExperimentationAnalyticsDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationAnalyticsRequest) SetData(v LLMObsExperimentationAnalyticsDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationAnalyticsDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_response.go b/api/datadogV2/model_llm_obs_experimentation_analytics_response.go new file mode 100644 index 00000000000..19208013bb4 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsResponse Response to an analytics query. +type LLMObsExperimentationAnalyticsResponse struct { + // JSON:API data object for an analytics response. + Data LLMObsExperimentationAnalyticsDataResponse `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsResponse instantiates a new LLMObsExperimentationAnalyticsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsResponse(data LLMObsExperimentationAnalyticsDataResponse) *LLMObsExperimentationAnalyticsResponse { + this := LLMObsExperimentationAnalyticsResponse{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationAnalyticsResponseWithDefaults instantiates a new LLMObsExperimentationAnalyticsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsResponseWithDefaults() *LLMObsExperimentationAnalyticsResponse { + this := LLMObsExperimentationAnalyticsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationAnalyticsResponse) GetData() LLMObsExperimentationAnalyticsDataResponse { + if o == nil { + var ret LLMObsExperimentationAnalyticsDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsResponse) GetDataOk() (*LLMObsExperimentationAnalyticsDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationAnalyticsResponse) SetData(v LLMObsExperimentationAnalyticsDataResponse) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationAnalyticsDataResponse `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_result.go b/api/datadogV2/model_llm_obs_experimentation_analytics_result.go new file mode 100644 index 00000000000..b26a8edac7c --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_result.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsResult Analytics query result containing all buckets. +type LLMObsExperimentationAnalyticsResult struct { + // List of result buckets. + Values []LLMObsExperimentationAnalyticsValue `json:"values"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsResult instantiates a new LLMObsExperimentationAnalyticsResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsResult(values []LLMObsExperimentationAnalyticsValue) *LLMObsExperimentationAnalyticsResult { + this := LLMObsExperimentationAnalyticsResult{} + this.Values = values + return &this +} + +// NewLLMObsExperimentationAnalyticsResultWithDefaults instantiates a new LLMObsExperimentationAnalyticsResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsResultWithDefaults() *LLMObsExperimentationAnalyticsResult { + this := LLMObsExperimentationAnalyticsResult{} + return &this +} + +// GetValues returns the Values field value. +func (o *LLMObsExperimentationAnalyticsResult) GetValues() []LLMObsExperimentationAnalyticsValue { + if o == nil { + var ret []LLMObsExperimentationAnalyticsValue + return ret + } + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsResult) GetValuesOk() (*[]LLMObsExperimentationAnalyticsValue, bool) { + if o == nil { + return nil, false + } + return &o.Values, true +} + +// SetValues sets field value. +func (o *LLMObsExperimentationAnalyticsResult) SetValues(v []LLMObsExperimentationAnalyticsValue) { + o.Values = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["values"] = o.Values + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Values *[]LLMObsExperimentationAnalyticsValue `json:"values"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Values == nil { + return fmt.Errorf("required field values missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"values"}) + } else { + return err + } + o.Values = *all.Values + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_search.go b/api/datadogV2/model_llm_obs_experimentation_analytics_search.go new file mode 100644 index 00000000000..cd24100086c --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_search.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsSearch Search query for filtering analytics data. +type LLMObsExperimentationAnalyticsSearch struct { + // Filter expression. + Query string `json:"query"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsSearch instantiates a new LLMObsExperimentationAnalyticsSearch object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsSearch(query string) *LLMObsExperimentationAnalyticsSearch { + this := LLMObsExperimentationAnalyticsSearch{} + this.Query = query + return &this +} + +// NewLLMObsExperimentationAnalyticsSearchWithDefaults instantiates a new LLMObsExperimentationAnalyticsSearch object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsSearchWithDefaults() *LLMObsExperimentationAnalyticsSearch { + this := LLMObsExperimentationAnalyticsSearch{} + return &this +} + +// GetQuery returns the Query field value. +func (o *LLMObsExperimentationAnalyticsSearch) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsSearch) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *LLMObsExperimentationAnalyticsSearch) SetQuery(v string) { + o.Query = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsSearch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["query"] = o.Query + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsSearch) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Query *string `json:"query"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"query"}) + } else { + return err + } + o.Query = *all.Query + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_time_range.go b/api/datadogV2/model_llm_obs_experimentation_analytics_time_range.go new file mode 100644 index 00000000000..11b080c348b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_time_range.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsTimeRange Unix-millisecond time range for filtering analytics data. +type LLMObsExperimentationAnalyticsTimeRange struct { + // Start of the time range in milliseconds since Unix epoch. + From int64 `json:"from"` + // End of the time range in milliseconds since Unix epoch. + To int64 `json:"to"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsTimeRange instantiates a new LLMObsExperimentationAnalyticsTimeRange object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsTimeRange(from int64, to int64) *LLMObsExperimentationAnalyticsTimeRange { + this := LLMObsExperimentationAnalyticsTimeRange{} + this.From = from + this.To = to + return &this +} + +// NewLLMObsExperimentationAnalyticsTimeRangeWithDefaults instantiates a new LLMObsExperimentationAnalyticsTimeRange object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsTimeRangeWithDefaults() *LLMObsExperimentationAnalyticsTimeRange { + this := LLMObsExperimentationAnalyticsTimeRange{} + return &this +} + +// GetFrom returns the From field value. +func (o *LLMObsExperimentationAnalyticsTimeRange) GetFrom() int64 { + if o == nil { + var ret int64 + return ret + } + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsTimeRange) GetFromOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value. +func (o *LLMObsExperimentationAnalyticsTimeRange) SetFrom(v int64) { + o.From = v +} + +// GetTo returns the To field value. +func (o *LLMObsExperimentationAnalyticsTimeRange) GetTo() int64 { + if o == nil { + var ret int64 + return ret + } + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsTimeRange) GetToOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value. +func (o *LLMObsExperimentationAnalyticsTimeRange) SetTo(v int64) { + o.To = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsTimeRange) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsTimeRange) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + From *int64 `json:"from"` + To *int64 `json:"to"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.From == nil { + return fmt.Errorf("required field from missing") + } + if all.To == nil { + return fmt.Errorf("required field to missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"from", "to"}) + } else { + return err + } + o.From = *all.From + o.To = *all.To + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_analytics_value.go b/api/datadogV2/model_llm_obs_experimentation_analytics_value.go new file mode 100644 index 00000000000..b3446cabe66 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_analytics_value.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationAnalyticsValue A single analytics result bucket. +type LLMObsExperimentationAnalyticsValue struct { + // The group-by field values for this bucket. + By map[string]interface{} `json:"by,omitempty"` + // Computed metric values for this bucket. + Metrics map[string]interface{} `json:"metrics"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationAnalyticsValue instantiates a new LLMObsExperimentationAnalyticsValue object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationAnalyticsValue(metrics map[string]interface{}) *LLMObsExperimentationAnalyticsValue { + this := LLMObsExperimentationAnalyticsValue{} + this.Metrics = metrics + return &this +} + +// NewLLMObsExperimentationAnalyticsValueWithDefaults instantiates a new LLMObsExperimentationAnalyticsValue object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationAnalyticsValueWithDefaults() *LLMObsExperimentationAnalyticsValue { + this := LLMObsExperimentationAnalyticsValue{} + return &this +} + +// GetBy returns the By field value if set, zero value otherwise. +func (o *LLMObsExperimentationAnalyticsValue) GetBy() map[string]interface{} { + if o == nil || o.By == nil { + var ret map[string]interface{} + return ret + } + return o.By +} + +// GetByOk returns a tuple with the By field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsValue) GetByOk() (*map[string]interface{}, bool) { + if o == nil || o.By == nil { + return nil, false + } + return &o.By, true +} + +// HasBy returns a boolean if a field has been set. +func (o *LLMObsExperimentationAnalyticsValue) HasBy() bool { + return o != nil && o.By != nil +} + +// SetBy gets a reference to the given map[string]interface{} and assigns it to the By field. +func (o *LLMObsExperimentationAnalyticsValue) SetBy(v map[string]interface{}) { + o.By = v +} + +// GetMetrics returns the Metrics field value. +func (o *LLMObsExperimentationAnalyticsValue) GetMetrics() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationAnalyticsValue) GetMetricsOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Metrics, true +} + +// SetMetrics sets field value. +func (o *LLMObsExperimentationAnalyticsValue) SetMetrics(v map[string]interface{}) { + o.Metrics = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationAnalyticsValue) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.By != nil { + toSerialize["by"] = o.By + } + toSerialize["metrics"] = o.Metrics + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationAnalyticsValue) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + By map[string]interface{} `json:"by,omitempty"` + Metrics *map[string]interface{} `json:"metrics"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Metrics == nil { + return fmt.Errorf("required field metrics missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"by", "metrics"}) + } else { + return err + } + o.By = all.By + o.Metrics = *all.Metrics + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_content_preview.go b/api/datadogV2/model_llm_obs_experimentation_content_preview.go new file mode 100644 index 00000000000..f44e38c6617 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_content_preview.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationContentPreview Options to control content preview truncation. +type LLMObsExperimentationContentPreview struct { + // Maximum number of characters to include in content previews. + Limit *int64 `json:"limit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationContentPreview instantiates a new LLMObsExperimentationContentPreview object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationContentPreview() *LLMObsExperimentationContentPreview { + this := LLMObsExperimentationContentPreview{} + return &this +} + +// NewLLMObsExperimentationContentPreviewWithDefaults instantiates a new LLMObsExperimentationContentPreview object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationContentPreviewWithDefaults() *LLMObsExperimentationContentPreview { + this := LLMObsExperimentationContentPreview{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LLMObsExperimentationContentPreview) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationContentPreview) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsExperimentationContentPreview) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *LLMObsExperimentationContentPreview) SetLimit(v int64) { + o.Limit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationContentPreview) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationContentPreview) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Limit *int64 `json:"limit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"limit"}) + } else { + return err + } + o.Limit = all.Limit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_cursor_page.go b/api/datadogV2/model_llm_obs_experimentation_cursor_page.go new file mode 100644 index 00000000000..40fe3d6e891 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_cursor_page.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationCursorPage Cursor-based pagination parameters. +type LLMObsExperimentationCursorPage struct { + // Opaque cursor returned from a previous response to fetch the next page. + Cursor *string `json:"cursor,omitempty"` + // Maximum number of results per page. + Limit *int64 `json:"limit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationCursorPage instantiates a new LLMObsExperimentationCursorPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationCursorPage() *LLMObsExperimentationCursorPage { + this := LLMObsExperimentationCursorPage{} + return &this +} + +// NewLLMObsExperimentationCursorPageWithDefaults instantiates a new LLMObsExperimentationCursorPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationCursorPageWithDefaults() *LLMObsExperimentationCursorPage { + this := LLMObsExperimentationCursorPage{} + return &this +} + +// GetCursor returns the Cursor field value if set, zero value otherwise. +func (o *LLMObsExperimentationCursorPage) GetCursor() string { + if o == nil || o.Cursor == nil { + var ret string + return ret + } + return *o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationCursorPage) GetCursorOk() (*string, bool) { + if o == nil || o.Cursor == nil { + return nil, false + } + return o.Cursor, true +} + +// HasCursor returns a boolean if a field has been set. +func (o *LLMObsExperimentationCursorPage) HasCursor() bool { + return o != nil && o.Cursor != nil +} + +// SetCursor gets a reference to the given string and assigns it to the Cursor field. +func (o *LLMObsExperimentationCursorPage) SetCursor(v string) { + o.Cursor = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LLMObsExperimentationCursorPage) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationCursorPage) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsExperimentationCursorPage) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *LLMObsExperimentationCursorPage) SetLimit(v int64) { + o.Limit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationCursorPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cursor != nil { + toSerialize["cursor"] = o.Cursor + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationCursorPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cursor *string `json:"cursor,omitempty"` + Limit *int64 `json:"limit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cursor", "limit"}) + } else { + return err + } + o.Cursor = all.Cursor + o.Limit = all.Limit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_filter.go b/api/datadogV2/model_llm_obs_experimentation_filter.go new file mode 100644 index 00000000000..b7e6a9e4b50 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_filter.go @@ -0,0 +1,260 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationFilter Filter criteria for an experimentation search request. +type LLMObsExperimentationFilter struct { + // When `true`, include soft-deleted entities alongside active ones. + IncludeDeleted *bool `json:"include_deleted,omitempty"` + // When `true`, return only soft-deleted entities. + IsDeleted *bool `json:"is_deleted,omitempty"` + // Free-text search query. + Query *string `json:"query,omitempty"` + // Entity types to search. Valid values are `projects`, `datasets`, `dataset_records`, `experiments`, and `experiment_runs`. + Scope []string `json:"scope"` + // Filter dataset records by a specific dataset version. + Version datadog.NullableInt64 `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationFilter instantiates a new LLMObsExperimentationFilter object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationFilter(scope []string) *LLMObsExperimentationFilter { + this := LLMObsExperimentationFilter{} + var includeDeleted bool = false + this.IncludeDeleted = &includeDeleted + var isDeleted bool = false + this.IsDeleted = &isDeleted + this.Scope = scope + return &this +} + +// NewLLMObsExperimentationFilterWithDefaults instantiates a new LLMObsExperimentationFilter object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationFilterWithDefaults() *LLMObsExperimentationFilter { + this := LLMObsExperimentationFilter{} + var includeDeleted bool = false + this.IncludeDeleted = &includeDeleted + var isDeleted bool = false + this.IsDeleted = &isDeleted + return &this +} + +// GetIncludeDeleted returns the IncludeDeleted field value if set, zero value otherwise. +func (o *LLMObsExperimentationFilter) GetIncludeDeleted() bool { + if o == nil || o.IncludeDeleted == nil { + var ret bool + return ret + } + return *o.IncludeDeleted +} + +// GetIncludeDeletedOk returns a tuple with the IncludeDeleted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationFilter) GetIncludeDeletedOk() (*bool, bool) { + if o == nil || o.IncludeDeleted == nil { + return nil, false + } + return o.IncludeDeleted, true +} + +// HasIncludeDeleted returns a boolean if a field has been set. +func (o *LLMObsExperimentationFilter) HasIncludeDeleted() bool { + return o != nil && o.IncludeDeleted != nil +} + +// SetIncludeDeleted gets a reference to the given bool and assigns it to the IncludeDeleted field. +func (o *LLMObsExperimentationFilter) SetIncludeDeleted(v bool) { + o.IncludeDeleted = &v +} + +// GetIsDeleted returns the IsDeleted field value if set, zero value otherwise. +func (o *LLMObsExperimentationFilter) GetIsDeleted() bool { + if o == nil || o.IsDeleted == nil { + var ret bool + return ret + } + return *o.IsDeleted +} + +// GetIsDeletedOk returns a tuple with the IsDeleted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationFilter) GetIsDeletedOk() (*bool, bool) { + if o == nil || o.IsDeleted == nil { + return nil, false + } + return o.IsDeleted, true +} + +// HasIsDeleted returns a boolean if a field has been set. +func (o *LLMObsExperimentationFilter) HasIsDeleted() bool { + return o != nil && o.IsDeleted != nil +} + +// SetIsDeleted gets a reference to the given bool and assigns it to the IsDeleted field. +func (o *LLMObsExperimentationFilter) SetIsDeleted(v bool) { + o.IsDeleted = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *LLMObsExperimentationFilter) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationFilter) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *LLMObsExperimentationFilter) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *LLMObsExperimentationFilter) SetQuery(v string) { + o.Query = &v +} + +// GetScope returns the Scope field value. +func (o *LLMObsExperimentationFilter) GetScope() []string { + if o == nil { + var ret []string + return ret + } + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationFilter) GetScopeOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value. +func (o *LLMObsExperimentationFilter) SetScope(v []string) { + o.Scope = v +} + +// GetVersion returns the Version field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationFilter) GetVersion() int64 { + if o == nil || o.Version.Get() == nil { + var ret int64 + return ret + } + return *o.Version.Get() +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationFilter) GetVersionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Version.Get(), o.Version.IsSet() +} + +// HasVersion returns a boolean if a field has been set. +func (o *LLMObsExperimentationFilter) HasVersion() bool { + return o != nil && o.Version.IsSet() +} + +// SetVersion gets a reference to the given datadog.NullableInt64 and assigns it to the Version field. +func (o *LLMObsExperimentationFilter) SetVersion(v int64) { + o.Version.Set(&v) +} + +// SetVersionNil sets the value for Version to be an explicit nil. +func (o *LLMObsExperimentationFilter) SetVersionNil() { + o.Version.Set(nil) +} + +// UnsetVersion ensures that no value is present for Version, not even an explicit nil. +func (o *LLMObsExperimentationFilter) UnsetVersion() { + o.Version.Unset() +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.IncludeDeleted != nil { + toSerialize["include_deleted"] = o.IncludeDeleted + } + if o.IsDeleted != nil { + toSerialize["is_deleted"] = o.IsDeleted + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + toSerialize["scope"] = o.Scope + if o.Version.IsSet() { + toSerialize["version"] = o.Version.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationFilter) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + IncludeDeleted *bool `json:"include_deleted,omitempty"` + IsDeleted *bool `json:"is_deleted,omitempty"` + Query *string `json:"query,omitempty"` + Scope *[]string `json:"scope"` + Version datadog.NullableInt64 `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Scope == nil { + return fmt.Errorf("required field scope missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"include_deleted", "is_deleted", "query", "scope", "version"}) + } else { + return err + } + o.IncludeDeleted = all.IncludeDeleted + o.IsDeleted = all.IsDeleted + o.Query = all.Query + o.Scope = *all.Scope + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_include.go b/api/datadogV2/model_llm_obs_experimentation_include.go new file mode 100644 index 00000000000..f79d04c7c25 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_include.go @@ -0,0 +1,106 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationInclude Additional data to include in the response. +type LLMObsExperimentationInclude struct { + // When `true`, enrich results with author user data (name and email). + UserData *bool `json:"user_data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationInclude instantiates a new LLMObsExperimentationInclude object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationInclude() *LLMObsExperimentationInclude { + this := LLMObsExperimentationInclude{} + var userData bool = false + this.UserData = &userData + return &this +} + +// NewLLMObsExperimentationIncludeWithDefaults instantiates a new LLMObsExperimentationInclude object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationIncludeWithDefaults() *LLMObsExperimentationInclude { + this := LLMObsExperimentationInclude{} + var userData bool = false + this.UserData = &userData + return &this +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *LLMObsExperimentationInclude) GetUserData() bool { + if o == nil || o.UserData == nil { + var ret bool + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationInclude) GetUserDataOk() (*bool, bool) { + if o == nil || o.UserData == nil { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *LLMObsExperimentationInclude) HasUserData() bool { + return o != nil && o.UserData != nil +} + +// SetUserData gets a reference to the given bool and assigns it to the UserData field. +func (o *LLMObsExperimentationInclude) SetUserData(v bool) { + o.UserData = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationInclude) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.UserData != nil { + toSerialize["user_data"] = o.UserData + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationInclude) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + UserData *bool `json:"user_data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"user_data"}) + } else { + return err + } + o.UserData = all.UserData + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_number_page.go b/api/datadogV2/model_llm_obs_experimentation_number_page.go new file mode 100644 index 00000000000..174ea9a4b7b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_number_page.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationNumberPage Offset-based pagination parameters for simple search. +type LLMObsExperimentationNumberPage struct { + // Maximum number of results per page. + Limit *int32 `json:"limit,omitempty"` + // Page number to retrieve (1-indexed). + Number *int32 `json:"number,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationNumberPage instantiates a new LLMObsExperimentationNumberPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationNumberPage() *LLMObsExperimentationNumberPage { + this := LLMObsExperimentationNumberPage{} + return &this +} + +// NewLLMObsExperimentationNumberPageWithDefaults instantiates a new LLMObsExperimentationNumberPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationNumberPageWithDefaults() *LLMObsExperimentationNumberPage { + this := LLMObsExperimentationNumberPage{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LLMObsExperimentationNumberPage) GetLimit() int32 { + if o == nil || o.Limit == nil { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationNumberPage) GetLimitOk() (*int32, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsExperimentationNumberPage) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *LLMObsExperimentationNumberPage) SetLimit(v int32) { + o.Limit = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *LLMObsExperimentationNumberPage) GetNumber() int32 { + if o == nil || o.Number == nil { + var ret int32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationNumberPage) GetNumberOk() (*int32, bool) { + if o == nil || o.Number == nil { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *LLMObsExperimentationNumberPage) HasNumber() bool { + return o != nil && o.Number != nil +} + +// SetNumber gets a reference to the given int32 and assigns it to the Number field. +func (o *LLMObsExperimentationNumberPage) SetNumber(v int32) { + o.Number = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationNumberPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationNumberPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Limit *int32 `json:"limit,omitempty"` + Number *int32 `json:"number,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"limit", "number"}) + } else { + return err + } + o.Limit = all.Limit + o.Number = all.Number + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_data_attributes_request.go b/api/datadogV2/model_llm_obs_experimentation_search_data_attributes_request.go new file mode 100644 index 00000000000..e2468276fff --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_data_attributes_request.go @@ -0,0 +1,224 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchDataAttributesRequest Attributes for an experimentation search request. +type LLMObsExperimentationSearchDataAttributesRequest struct { + // Options to control content preview truncation. + ContentPreview *LLMObsExperimentationContentPreview `json:"content_preview,omitempty"` + // Filter criteria for an experimentation search request. + Filter LLMObsExperimentationFilter `json:"filter"` + // Additional data to include in the response. + Include *LLMObsExperimentationInclude `json:"include,omitempty"` + // Cursor-based pagination parameters. + Page *LLMObsExperimentationCursorPage `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchDataAttributesRequest instantiates a new LLMObsExperimentationSearchDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchDataAttributesRequest(filter LLMObsExperimentationFilter) *LLMObsExperimentationSearchDataAttributesRequest { + this := LLMObsExperimentationSearchDataAttributesRequest{} + this.Filter = filter + return &this +} + +// NewLLMObsExperimentationSearchDataAttributesRequestWithDefaults instantiates a new LLMObsExperimentationSearchDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchDataAttributesRequestWithDefaults() *LLMObsExperimentationSearchDataAttributesRequest { + this := LLMObsExperimentationSearchDataAttributesRequest{} + return &this +} + +// GetContentPreview returns the ContentPreview field value if set, zero value otherwise. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetContentPreview() LLMObsExperimentationContentPreview { + if o == nil || o.ContentPreview == nil { + var ret LLMObsExperimentationContentPreview + return ret + } + return *o.ContentPreview +} + +// GetContentPreviewOk returns a tuple with the ContentPreview field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetContentPreviewOk() (*LLMObsExperimentationContentPreview, bool) { + if o == nil || o.ContentPreview == nil { + return nil, false + } + return o.ContentPreview, true +} + +// HasContentPreview returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) HasContentPreview() bool { + return o != nil && o.ContentPreview != nil +} + +// SetContentPreview gets a reference to the given LLMObsExperimentationContentPreview and assigns it to the ContentPreview field. +func (o *LLMObsExperimentationSearchDataAttributesRequest) SetContentPreview(v LLMObsExperimentationContentPreview) { + o.ContentPreview = &v +} + +// GetFilter returns the Filter field value. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetFilter() LLMObsExperimentationFilter { + if o == nil { + var ret LLMObsExperimentationFilter + return ret + } + return o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetFilterOk() (*LLMObsExperimentationFilter, bool) { + if o == nil { + return nil, false + } + return &o.Filter, true +} + +// SetFilter sets field value. +func (o *LLMObsExperimentationSearchDataAttributesRequest) SetFilter(v LLMObsExperimentationFilter) { + o.Filter = v +} + +// GetInclude returns the Include field value if set, zero value otherwise. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetInclude() LLMObsExperimentationInclude { + if o == nil || o.Include == nil { + var ret LLMObsExperimentationInclude + return ret + } + return *o.Include +} + +// GetIncludeOk returns a tuple with the Include field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetIncludeOk() (*LLMObsExperimentationInclude, bool) { + if o == nil || o.Include == nil { + return nil, false + } + return o.Include, true +} + +// HasInclude returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) HasInclude() bool { + return o != nil && o.Include != nil +} + +// SetInclude gets a reference to the given LLMObsExperimentationInclude and assigns it to the Include field. +func (o *LLMObsExperimentationSearchDataAttributesRequest) SetInclude(v LLMObsExperimentationInclude) { + o.Include = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetPage() LLMObsExperimentationCursorPage { + if o == nil || o.Page == nil { + var ret LLMObsExperimentationCursorPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) GetPageOk() (*LLMObsExperimentationCursorPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchDataAttributesRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given LLMObsExperimentationCursorPage and assigns it to the Page field. +func (o *LLMObsExperimentationSearchDataAttributesRequest) SetPage(v LLMObsExperimentationCursorPage) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ContentPreview != nil { + toSerialize["content_preview"] = o.ContentPreview + } + toSerialize["filter"] = o.Filter + if o.Include != nil { + toSerialize["include"] = o.Include + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentPreview *LLMObsExperimentationContentPreview `json:"content_preview,omitempty"` + Filter *LLMObsExperimentationFilter `json:"filter"` + Include *LLMObsExperimentationInclude `json:"include,omitempty"` + Page *LLMObsExperimentationCursorPage `json:"page,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Filter == nil { + return fmt.Errorf("required field filter missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_preview", "filter", "include", "page"}) + } else { + return err + } + + hasInvalidField := false + if all.ContentPreview != nil && all.ContentPreview.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ContentPreview = all.ContentPreview + if all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Filter = *all.Filter + if all.Include != nil && all.Include.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Include = all.Include + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_data_request.go b/api/datadogV2/model_llm_obs_experimentation_search_data_request.go new file mode 100644 index 00000000000..b16b8f3ad1e --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_data_request.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchDataRequest Data object for an experimentation search request. +type LLMObsExperimentationSearchDataRequest struct { + // Attributes for an experimentation search request. + Attributes LLMObsExperimentationSearchDataAttributesRequest `json:"attributes"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchDataRequest instantiates a new LLMObsExperimentationSearchDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchDataRequest(attributes LLMObsExperimentationSearchDataAttributesRequest, typeVar LLMObsExperimentationType) *LLMObsExperimentationSearchDataRequest { + this := LLMObsExperimentationSearchDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationSearchDataRequestWithDefaults instantiates a new LLMObsExperimentationSearchDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchDataRequestWithDefaults() *LLMObsExperimentationSearchDataRequest { + this := LLMObsExperimentationSearchDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationSearchDataRequest) GetAttributes() LLMObsExperimentationSearchDataAttributesRequest { + if o == nil { + var ret LLMObsExperimentationSearchDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataRequest) GetAttributesOk() (*LLMObsExperimentationSearchDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationSearchDataRequest) SetAttributes(v LLMObsExperimentationSearchDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationSearchDataRequest) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataRequest) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationSearchDataRequest) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationSearchDataAttributesRequest `json:"attributes"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_data_response.go b/api/datadogV2/model_llm_obs_experimentation_search_data_response.go new file mode 100644 index 00000000000..fd5029bc546 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_data_response.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchDataResponse JSON:API data object for an experimentation search response. +type LLMObsExperimentationSearchDataResponse struct { + // The matching experimentation entities grouped by type. + Attributes LLMObsExperimentationSearchResults `json:"attributes"` + // Server-generated identifier for this search result. + Id string `json:"id"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchDataResponse instantiates a new LLMObsExperimentationSearchDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchDataResponse(attributes LLMObsExperimentationSearchResults, id string, typeVar LLMObsExperimentationType) *LLMObsExperimentationSearchDataResponse { + this := LLMObsExperimentationSearchDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationSearchDataResponseWithDefaults instantiates a new LLMObsExperimentationSearchDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchDataResponseWithDefaults() *LLMObsExperimentationSearchDataResponse { + this := LLMObsExperimentationSearchDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationSearchDataResponse) GetAttributes() LLMObsExperimentationSearchResults { + if o == nil { + var ret LLMObsExperimentationSearchResults + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataResponse) GetAttributesOk() (*LLMObsExperimentationSearchResults, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationSearchDataResponse) SetAttributes(v LLMObsExperimentationSearchResults) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsExperimentationSearchDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsExperimentationSearchDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationSearchDataResponse) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchDataResponse) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationSearchDataResponse) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationSearchResults `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_request.go b/api/datadogV2/model_llm_obs_experimentation_search_request.go new file mode 100644 index 00000000000..dd4efb3743b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchRequest Request to search across LLM Observability experimentation entities using cursor-based pagination. +type LLMObsExperimentationSearchRequest struct { + // Data object for an experimentation search request. + Data LLMObsExperimentationSearchDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchRequest instantiates a new LLMObsExperimentationSearchRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchRequest(data LLMObsExperimentationSearchDataRequest) *LLMObsExperimentationSearchRequest { + this := LLMObsExperimentationSearchRequest{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationSearchRequestWithDefaults instantiates a new LLMObsExperimentationSearchRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchRequestWithDefaults() *LLMObsExperimentationSearchRequest { + this := LLMObsExperimentationSearchRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationSearchRequest) GetData() LLMObsExperimentationSearchDataRequest { + if o == nil { + var ret LLMObsExperimentationSearchDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchRequest) GetDataOk() (*LLMObsExperimentationSearchDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationSearchRequest) SetData(v LLMObsExperimentationSearchDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationSearchDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_response.go b/api/datadogV2/model_llm_obs_experimentation_search_response.go new file mode 100644 index 00000000000..b64de0a60e7 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_response.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchResponse Response to a cursor-based experimentation search. Returns `200 OK` when all results fit in one page; `206 Partial Content` when a next-page cursor is available. +type LLMObsExperimentationSearchResponse struct { + // JSON:API data object for an experimentation search response. + Data LLMObsExperimentationSearchDataResponse `json:"data"` + // Pagination cursor metadata. + Meta *LLMObsCursorMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchResponse instantiates a new LLMObsExperimentationSearchResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchResponse(data LLMObsExperimentationSearchDataResponse) *LLMObsExperimentationSearchResponse { + this := LLMObsExperimentationSearchResponse{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationSearchResponseWithDefaults instantiates a new LLMObsExperimentationSearchResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchResponseWithDefaults() *LLMObsExperimentationSearchResponse { + this := LLMObsExperimentationSearchResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationSearchResponse) GetData() LLMObsExperimentationSearchDataResponse { + if o == nil { + var ret LLMObsExperimentationSearchDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchResponse) GetDataOk() (*LLMObsExperimentationSearchDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationSearchResponse) SetData(v LLMObsExperimentationSearchDataResponse) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *LLMObsExperimentationSearchResponse) GetMeta() LLMObsCursorMeta { + if o == nil || o.Meta == nil { + var ret LLMObsCursorMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSearchResponse) GetMetaOk() (*LLMObsCursorMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given LLMObsCursorMeta and assigns it to the Meta field. +func (o *LLMObsExperimentationSearchResponse) SetMeta(v LLMObsCursorMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationSearchDataResponse `json:"data"` + Meta *LLMObsCursorMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_search_results.go b/api/datadogV2/model_llm_obs_experimentation_search_results.go new file mode 100644 index 00000000000..2f5521cd037 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_search_results.go @@ -0,0 +1,247 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSearchResults The matching experimentation entities grouped by type. +type LLMObsExperimentationSearchResults struct { + // Matching dataset records. Present when `dataset_records` is included in `filter.scope`. + DatasetRecords []LLMObsDatasetRecordDataResponse `json:"dataset_records,omitempty"` + // Matching datasets. Present when `datasets` is included in `filter.scope`. + Datasets []LLMObsDatasetDataResponse `json:"datasets,omitempty"` + // Matching experiment runs. Present when `experiment_runs` is included in `filter.scope`. + ExperimentRuns []LLMObsExperimentRunDataResponse `json:"experiment_runs,omitempty"` + // Matching experiments. Present when `experiments` is included in `filter.scope`. + Experiments []LLMObsExperimentDataAttributesResponse `json:"experiments,omitempty"` + // Matching projects. Present when `projects` is included in `filter.scope`. + Projects []LLMObsProjectDataResponse `json:"projects,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSearchResults instantiates a new LLMObsExperimentationSearchResults object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSearchResults() *LLMObsExperimentationSearchResults { + this := LLMObsExperimentationSearchResults{} + return &this +} + +// NewLLMObsExperimentationSearchResultsWithDefaults instantiates a new LLMObsExperimentationSearchResults object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSearchResultsWithDefaults() *LLMObsExperimentationSearchResults { + this := LLMObsExperimentationSearchResults{} + return &this +} + +// GetDatasetRecords returns the DatasetRecords field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationSearchResults) GetDatasetRecords() []LLMObsDatasetRecordDataResponse { + if o == nil { + var ret []LLMObsDatasetRecordDataResponse + return ret + } + return o.DatasetRecords +} + +// GetDatasetRecordsOk returns a tuple with the DatasetRecords field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationSearchResults) GetDatasetRecordsOk() (*[]LLMObsDatasetRecordDataResponse, bool) { + if o == nil || o.DatasetRecords == nil { + return nil, false + } + return &o.DatasetRecords, true +} + +// HasDatasetRecords returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResults) HasDatasetRecords() bool { + return o != nil && o.DatasetRecords != nil +} + +// SetDatasetRecords gets a reference to the given []LLMObsDatasetRecordDataResponse and assigns it to the DatasetRecords field. +func (o *LLMObsExperimentationSearchResults) SetDatasetRecords(v []LLMObsDatasetRecordDataResponse) { + o.DatasetRecords = v +} + +// GetDatasets returns the Datasets field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationSearchResults) GetDatasets() []LLMObsDatasetDataResponse { + if o == nil { + var ret []LLMObsDatasetDataResponse + return ret + } + return o.Datasets +} + +// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationSearchResults) GetDatasetsOk() (*[]LLMObsDatasetDataResponse, bool) { + if o == nil || o.Datasets == nil { + return nil, false + } + return &o.Datasets, true +} + +// HasDatasets returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResults) HasDatasets() bool { + return o != nil && o.Datasets != nil +} + +// SetDatasets gets a reference to the given []LLMObsDatasetDataResponse and assigns it to the Datasets field. +func (o *LLMObsExperimentationSearchResults) SetDatasets(v []LLMObsDatasetDataResponse) { + o.Datasets = v +} + +// GetExperimentRuns returns the ExperimentRuns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationSearchResults) GetExperimentRuns() []LLMObsExperimentRunDataResponse { + if o == nil { + var ret []LLMObsExperimentRunDataResponse + return ret + } + return o.ExperimentRuns +} + +// GetExperimentRunsOk returns a tuple with the ExperimentRuns field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationSearchResults) GetExperimentRunsOk() (*[]LLMObsExperimentRunDataResponse, bool) { + if o == nil || o.ExperimentRuns == nil { + return nil, false + } + return &o.ExperimentRuns, true +} + +// HasExperimentRuns returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResults) HasExperimentRuns() bool { + return o != nil && o.ExperimentRuns != nil +} + +// SetExperimentRuns gets a reference to the given []LLMObsExperimentRunDataResponse and assigns it to the ExperimentRuns field. +func (o *LLMObsExperimentationSearchResults) SetExperimentRuns(v []LLMObsExperimentRunDataResponse) { + o.ExperimentRuns = v +} + +// GetExperiments returns the Experiments field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationSearchResults) GetExperiments() []LLMObsExperimentDataAttributesResponse { + if o == nil { + var ret []LLMObsExperimentDataAttributesResponse + return ret + } + return o.Experiments +} + +// GetExperimentsOk returns a tuple with the Experiments field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationSearchResults) GetExperimentsOk() (*[]LLMObsExperimentDataAttributesResponse, bool) { + if o == nil || o.Experiments == nil { + return nil, false + } + return &o.Experiments, true +} + +// HasExperiments returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResults) HasExperiments() bool { + return o != nil && o.Experiments != nil +} + +// SetExperiments gets a reference to the given []LLMObsExperimentDataAttributesResponse and assigns it to the Experiments field. +func (o *LLMObsExperimentationSearchResults) SetExperiments(v []LLMObsExperimentDataAttributesResponse) { + o.Experiments = v +} + +// GetProjects returns the Projects field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsExperimentationSearchResults) GetProjects() []LLMObsProjectDataResponse { + if o == nil { + var ret []LLMObsProjectDataResponse + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsExperimentationSearchResults) GetProjectsOk() (*[]LLMObsProjectDataResponse, bool) { + if o == nil || o.Projects == nil { + return nil, false + } + return &o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *LLMObsExperimentationSearchResults) HasProjects() bool { + return o != nil && o.Projects != nil +} + +// SetProjects gets a reference to the given []LLMObsProjectDataResponse and assigns it to the Projects field. +func (o *LLMObsExperimentationSearchResults) SetProjects(v []LLMObsProjectDataResponse) { + o.Projects = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSearchResults) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DatasetRecords != nil { + toSerialize["dataset_records"] = o.DatasetRecords + } + if o.Datasets != nil { + toSerialize["datasets"] = o.Datasets + } + if o.ExperimentRuns != nil { + toSerialize["experiment_runs"] = o.ExperimentRuns + } + if o.Experiments != nil { + toSerialize["experiments"] = o.Experiments + } + if o.Projects != nil { + toSerialize["projects"] = o.Projects + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSearchResults) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DatasetRecords []LLMObsDatasetRecordDataResponse `json:"dataset_records,omitempty"` + Datasets []LLMObsDatasetDataResponse `json:"datasets,omitempty"` + ExperimentRuns []LLMObsExperimentRunDataResponse `json:"experiment_runs,omitempty"` + Experiments []LLMObsExperimentDataAttributesResponse `json:"experiments,omitempty"` + Projects []LLMObsProjectDataResponse `json:"projects,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"dataset_records", "datasets", "experiment_runs", "experiments", "projects"}) + } else { + return err + } + o.DatasetRecords = all.DatasetRecords + o.Datasets = all.Datasets + o.ExperimentRuns = all.ExperimentRuns + o.Experiments = all.Experiments + o.Projects = all.Projects + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_data_attributes_request.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_attributes_request.go new file mode 100644 index 00000000000..b24a9fdc246 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_attributes_request.go @@ -0,0 +1,259 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchDataAttributesRequest Attributes for an experimentation simple search request. +type LLMObsExperimentationSimpleSearchDataAttributesRequest struct { + // Options to control content preview truncation. + ContentPreview *LLMObsExperimentationContentPreview `json:"content_preview,omitempty"` + // Filter criteria for an experimentation search request. + Filter LLMObsExperimentationFilter `json:"filter"` + // Additional data to include in the response. + Include *LLMObsExperimentationInclude `json:"include,omitempty"` + // Offset-based pagination parameters for simple search. + Page *LLMObsExperimentationNumberPage `json:"page,omitempty"` + // Sort order for results. + Sort []LLMObsExperimentationSortField `json:"sort,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchDataAttributesRequest instantiates a new LLMObsExperimentationSimpleSearchDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchDataAttributesRequest(filter LLMObsExperimentationFilter) *LLMObsExperimentationSimpleSearchDataAttributesRequest { + this := LLMObsExperimentationSimpleSearchDataAttributesRequest{} + this.Filter = filter + return &this +} + +// NewLLMObsExperimentationSimpleSearchDataAttributesRequestWithDefaults instantiates a new LLMObsExperimentationSimpleSearchDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchDataAttributesRequestWithDefaults() *LLMObsExperimentationSimpleSearchDataAttributesRequest { + this := LLMObsExperimentationSimpleSearchDataAttributesRequest{} + return &this +} + +// GetContentPreview returns the ContentPreview field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetContentPreview() LLMObsExperimentationContentPreview { + if o == nil || o.ContentPreview == nil { + var ret LLMObsExperimentationContentPreview + return ret + } + return *o.ContentPreview +} + +// GetContentPreviewOk returns a tuple with the ContentPreview field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetContentPreviewOk() (*LLMObsExperimentationContentPreview, bool) { + if o == nil || o.ContentPreview == nil { + return nil, false + } + return o.ContentPreview, true +} + +// HasContentPreview returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) HasContentPreview() bool { + return o != nil && o.ContentPreview != nil +} + +// SetContentPreview gets a reference to the given LLMObsExperimentationContentPreview and assigns it to the ContentPreview field. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) SetContentPreview(v LLMObsExperimentationContentPreview) { + o.ContentPreview = &v +} + +// GetFilter returns the Filter field value. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetFilter() LLMObsExperimentationFilter { + if o == nil { + var ret LLMObsExperimentationFilter + return ret + } + return o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetFilterOk() (*LLMObsExperimentationFilter, bool) { + if o == nil { + return nil, false + } + return &o.Filter, true +} + +// SetFilter sets field value. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) SetFilter(v LLMObsExperimentationFilter) { + o.Filter = v +} + +// GetInclude returns the Include field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetInclude() LLMObsExperimentationInclude { + if o == nil || o.Include == nil { + var ret LLMObsExperimentationInclude + return ret + } + return *o.Include +} + +// GetIncludeOk returns a tuple with the Include field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetIncludeOk() (*LLMObsExperimentationInclude, bool) { + if o == nil || o.Include == nil { + return nil, false + } + return o.Include, true +} + +// HasInclude returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) HasInclude() bool { + return o != nil && o.Include != nil +} + +// SetInclude gets a reference to the given LLMObsExperimentationInclude and assigns it to the Include field. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) SetInclude(v LLMObsExperimentationInclude) { + o.Include = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetPage() LLMObsExperimentationNumberPage { + if o == nil || o.Page == nil { + var ret LLMObsExperimentationNumberPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetPageOk() (*LLMObsExperimentationNumberPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given LLMObsExperimentationNumberPage and assigns it to the Page field. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) SetPage(v LLMObsExperimentationNumberPage) { + o.Page = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetSort() []LLMObsExperimentationSortField { + if o == nil || o.Sort == nil { + var ret []LLMObsExperimentationSortField + return ret + } + return o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) GetSortOk() (*[]LLMObsExperimentationSortField, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return &o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given []LLMObsExperimentationSortField and assigns it to the Sort field. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) SetSort(v []LLMObsExperimentationSortField) { + o.Sort = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ContentPreview != nil { + toSerialize["content_preview"] = o.ContentPreview + } + toSerialize["filter"] = o.Filter + if o.Include != nil { + toSerialize["include"] = o.Include + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentPreview *LLMObsExperimentationContentPreview `json:"content_preview,omitempty"` + Filter *LLMObsExperimentationFilter `json:"filter"` + Include *LLMObsExperimentationInclude `json:"include,omitempty"` + Page *LLMObsExperimentationNumberPage `json:"page,omitempty"` + Sort []LLMObsExperimentationSortField `json:"sort,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Filter == nil { + return fmt.Errorf("required field filter missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_preview", "filter", "include", "page", "sort"}) + } else { + return err + } + + hasInvalidField := false + if all.ContentPreview != nil && all.ContentPreview.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ContentPreview = all.ContentPreview + if all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Filter = *all.Filter + if all.Include != nil && all.Include.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Include = all.Include + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + o.Sort = all.Sort + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_data_request.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_request.go new file mode 100644 index 00000000000..4cf851aca23 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_request.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchDataRequest Data object for an experimentation simple search request. +type LLMObsExperimentationSimpleSearchDataRequest struct { + // Attributes for an experimentation simple search request. + Attributes LLMObsExperimentationSimpleSearchDataAttributesRequest `json:"attributes"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchDataRequest instantiates a new LLMObsExperimentationSimpleSearchDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchDataRequest(attributes LLMObsExperimentationSimpleSearchDataAttributesRequest, typeVar LLMObsExperimentationType) *LLMObsExperimentationSimpleSearchDataRequest { + this := LLMObsExperimentationSimpleSearchDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationSimpleSearchDataRequestWithDefaults instantiates a new LLMObsExperimentationSimpleSearchDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchDataRequestWithDefaults() *LLMObsExperimentationSimpleSearchDataRequest { + this := LLMObsExperimentationSimpleSearchDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationSimpleSearchDataRequest) GetAttributes() LLMObsExperimentationSimpleSearchDataAttributesRequest { + if o == nil { + var ret LLMObsExperimentationSimpleSearchDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataRequest) GetAttributesOk() (*LLMObsExperimentationSimpleSearchDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationSimpleSearchDataRequest) SetAttributes(v LLMObsExperimentationSimpleSearchDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationSimpleSearchDataRequest) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataRequest) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationSimpleSearchDataRequest) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationSimpleSearchDataAttributesRequest `json:"attributes"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_data_response.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_response.go new file mode 100644 index 00000000000..957809e7b7b --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_data_response.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchDataResponse JSON:API data object for a simple search response. +type LLMObsExperimentationSimpleSearchDataResponse struct { + // The matching experimentation entities grouped by type. + Attributes LLMObsExperimentationSearchResults `json:"attributes"` + // Server-generated identifier for this search result. + Id string `json:"id"` + // Resource type for experimentation search and analytics operations. + Type LLMObsExperimentationType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchDataResponse instantiates a new LLMObsExperimentationSimpleSearchDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchDataResponse(attributes LLMObsExperimentationSearchResults, id string, typeVar LLMObsExperimentationType) *LLMObsExperimentationSimpleSearchDataResponse { + this := LLMObsExperimentationSimpleSearchDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsExperimentationSimpleSearchDataResponseWithDefaults instantiates a new LLMObsExperimentationSimpleSearchDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchDataResponseWithDefaults() *LLMObsExperimentationSimpleSearchDataResponse { + this := LLMObsExperimentationSimpleSearchDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetAttributes() LLMObsExperimentationSearchResults { + if o == nil { + var ret LLMObsExperimentationSearchResults + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetAttributesOk() (*LLMObsExperimentationSearchResults, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) SetAttributes(v LLMObsExperimentationSearchResults) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetType() LLMObsExperimentationType { + if o == nil { + var ret LLMObsExperimentationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchDataResponse) GetTypeOk() (*LLMObsExperimentationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsExperimentationSimpleSearchDataResponse) SetType(v LLMObsExperimentationType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsExperimentationSearchResults `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsExperimentationType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_meta.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_meta.go new file mode 100644 index 00000000000..8c9de2a6fdb --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_meta.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchMeta Pagination metadata for a simple search response. +type LLMObsExperimentationSimpleSearchMeta struct { + // Page metadata. + Page *LLMObsExperimentationSimpleSearchMetaPage `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchMeta instantiates a new LLMObsExperimentationSimpleSearchMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchMeta() *LLMObsExperimentationSimpleSearchMeta { + this := LLMObsExperimentationSimpleSearchMeta{} + return &this +} + +// NewLLMObsExperimentationSimpleSearchMetaWithDefaults instantiates a new LLMObsExperimentationSimpleSearchMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchMetaWithDefaults() *LLMObsExperimentationSimpleSearchMeta { + this := LLMObsExperimentationSimpleSearchMeta{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchMeta) GetPage() LLMObsExperimentationSimpleSearchMetaPage { + if o == nil || o.Page == nil { + var ret LLMObsExperimentationSimpleSearchMetaPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchMeta) GetPageOk() (*LLMObsExperimentationSimpleSearchMetaPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchMeta) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given LLMObsExperimentationSimpleSearchMetaPage and assigns it to the Page field. +func (o *LLMObsExperimentationSimpleSearchMeta) SetPage(v LLMObsExperimentationSimpleSearchMetaPage) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *LLMObsExperimentationSimpleSearchMetaPage `json:"page,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page"}) + } else { + return err + } + + hasInvalidField := false + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_meta_page.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_meta_page.go new file mode 100644 index 00000000000..990324196e2 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_meta_page.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchMetaPage Page metadata. +type LLMObsExperimentationSimpleSearchMetaPage struct { + // Current page number. + Current *int32 `json:"current,omitempty"` + // Page size used for this response. + Limit *int32 `json:"limit,omitempty"` + // Total number of matching results (capped at the maximum search limit). + TotalCount *int32 `json:"total_count,omitempty"` + // Total number of pages available. + TotalPages *int32 `json:"total_pages,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchMetaPage instantiates a new LLMObsExperimentationSimpleSearchMetaPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchMetaPage() *LLMObsExperimentationSimpleSearchMetaPage { + this := LLMObsExperimentationSimpleSearchMetaPage{} + return &this +} + +// NewLLMObsExperimentationSimpleSearchMetaPageWithDefaults instantiates a new LLMObsExperimentationSimpleSearchMetaPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchMetaPageWithDefaults() *LLMObsExperimentationSimpleSearchMetaPage { + this := LLMObsExperimentationSimpleSearchMetaPage{} + return &this +} + +// GetCurrent returns the Current field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetCurrent() int32 { + if o == nil || o.Current == nil { + var ret int32 + return ret + } + return *o.Current +} + +// GetCurrentOk returns a tuple with the Current field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetCurrentOk() (*int32, bool) { + if o == nil || o.Current == nil { + return nil, false + } + return o.Current, true +} + +// HasCurrent returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) HasCurrent() bool { + return o != nil && o.Current != nil +} + +// SetCurrent gets a reference to the given int32 and assigns it to the Current field. +func (o *LLMObsExperimentationSimpleSearchMetaPage) SetCurrent(v int32) { + o.Current = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetLimit() int32 { + if o == nil || o.Limit == nil { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetLimitOk() (*int32, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *LLMObsExperimentationSimpleSearchMetaPage) SetLimit(v int32) { + o.Limit = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetTotalCount() int32 { + if o == nil || o.TotalCount == nil { + var ret int32 + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetTotalCountOk() (*int32, bool) { + if o == nil || o.TotalCount == nil { + return nil, false + } + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) HasTotalCount() bool { + return o != nil && o.TotalCount != nil +} + +// SetTotalCount gets a reference to the given int32 and assigns it to the TotalCount field. +func (o *LLMObsExperimentationSimpleSearchMetaPage) SetTotalCount(v int32) { + o.TotalCount = &v +} + +// GetTotalPages returns the TotalPages field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetTotalPages() int32 { + if o == nil || o.TotalPages == nil { + var ret int32 + return ret + } + return *o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) GetTotalPagesOk() (*int32, bool) { + if o == nil || o.TotalPages == nil { + return nil, false + } + return o.TotalPages, true +} + +// HasTotalPages returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchMetaPage) HasTotalPages() bool { + return o != nil && o.TotalPages != nil +} + +// SetTotalPages gets a reference to the given int32 and assigns it to the TotalPages field. +func (o *LLMObsExperimentationSimpleSearchMetaPage) SetTotalPages(v int32) { + o.TotalPages = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchMetaPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Current != nil { + toSerialize["current"] = o.Current + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.TotalCount != nil { + toSerialize["total_count"] = o.TotalCount + } + if o.TotalPages != nil { + toSerialize["total_pages"] = o.TotalPages + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchMetaPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Current *int32 `json:"current,omitempty"` + Limit *int32 `json:"limit,omitempty"` + TotalCount *int32 `json:"total_count,omitempty"` + TotalPages *int32 `json:"total_pages,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"current", "limit", "total_count", "total_pages"}) + } else { + return err + } + o.Current = all.Current + o.Limit = all.Limit + o.TotalCount = all.TotalCount + o.TotalPages = all.TotalPages + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_request.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_request.go new file mode 100644 index 00000000000..8b3e36138d9 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchRequest Request to search across LLM Observability experimentation entities using offset-based pagination. +type LLMObsExperimentationSimpleSearchRequest struct { + // Data object for an experimentation simple search request. + Data LLMObsExperimentationSimpleSearchDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchRequest instantiates a new LLMObsExperimentationSimpleSearchRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchRequest(data LLMObsExperimentationSimpleSearchDataRequest) *LLMObsExperimentationSimpleSearchRequest { + this := LLMObsExperimentationSimpleSearchRequest{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationSimpleSearchRequestWithDefaults instantiates a new LLMObsExperimentationSimpleSearchRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchRequestWithDefaults() *LLMObsExperimentationSimpleSearchRequest { + this := LLMObsExperimentationSimpleSearchRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationSimpleSearchRequest) GetData() LLMObsExperimentationSimpleSearchDataRequest { + if o == nil { + var ret LLMObsExperimentationSimpleSearchDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchRequest) GetDataOk() (*LLMObsExperimentationSimpleSearchDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationSimpleSearchRequest) SetData(v LLMObsExperimentationSimpleSearchDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationSimpleSearchDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_simple_search_response.go b/api/datadogV2/model_llm_obs_experimentation_simple_search_response.go new file mode 100644 index 00000000000..76c9b06dbd3 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_simple_search_response.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSimpleSearchResponse Response to an offset-based experimentation simple search. +type LLMObsExperimentationSimpleSearchResponse struct { + // JSON:API data object for a simple search response. + Data LLMObsExperimentationSimpleSearchDataResponse `json:"data"` + // Pagination metadata for a simple search response. + Meta *LLMObsExperimentationSimpleSearchMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSimpleSearchResponse instantiates a new LLMObsExperimentationSimpleSearchResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSimpleSearchResponse(data LLMObsExperimentationSimpleSearchDataResponse) *LLMObsExperimentationSimpleSearchResponse { + this := LLMObsExperimentationSimpleSearchResponse{} + this.Data = data + return &this +} + +// NewLLMObsExperimentationSimpleSearchResponseWithDefaults instantiates a new LLMObsExperimentationSimpleSearchResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSimpleSearchResponseWithDefaults() *LLMObsExperimentationSimpleSearchResponse { + this := LLMObsExperimentationSimpleSearchResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsExperimentationSimpleSearchResponse) GetData() LLMObsExperimentationSimpleSearchDataResponse { + if o == nil { + var ret LLMObsExperimentationSimpleSearchDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchResponse) GetDataOk() (*LLMObsExperimentationSimpleSearchDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsExperimentationSimpleSearchResponse) SetData(v LLMObsExperimentationSimpleSearchDataResponse) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *LLMObsExperimentationSimpleSearchResponse) GetMeta() LLMObsExperimentationSimpleSearchMeta { + if o == nil || o.Meta == nil { + var ret LLMObsExperimentationSimpleSearchMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSimpleSearchResponse) GetMetaOk() (*LLMObsExperimentationSimpleSearchMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *LLMObsExperimentationSimpleSearchResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given LLMObsExperimentationSimpleSearchMeta and assigns it to the Meta field. +func (o *LLMObsExperimentationSimpleSearchResponse) SetMeta(v LLMObsExperimentationSimpleSearchMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSimpleSearchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSimpleSearchResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsExperimentationSimpleSearchDataResponse `json:"data"` + Meta *LLMObsExperimentationSimpleSearchMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_sort_field.go b/api/datadogV2/model_llm_obs_experimentation_sort_field.go new file mode 100644 index 00000000000..ad33f218384 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_sort_field.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSortField A field and direction to sort results by. +type LLMObsExperimentationSortField struct { + // Sort direction. + Direction *LLMObsExperimentationSortFieldDirection `json:"direction,omitempty"` + // The field name to sort on. + Field string `json:"field"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsExperimentationSortField instantiates a new LLMObsExperimentationSortField object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsExperimentationSortField(field string) *LLMObsExperimentationSortField { + this := LLMObsExperimentationSortField{} + this.Field = field + return &this +} + +// NewLLMObsExperimentationSortFieldWithDefaults instantiates a new LLMObsExperimentationSortField object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsExperimentationSortFieldWithDefaults() *LLMObsExperimentationSortField { + this := LLMObsExperimentationSortField{} + return &this +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *LLMObsExperimentationSortField) GetDirection() LLMObsExperimentationSortFieldDirection { + if o == nil || o.Direction == nil { + var ret LLMObsExperimentationSortFieldDirection + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSortField) GetDirectionOk() (*LLMObsExperimentationSortFieldDirection, bool) { + if o == nil || o.Direction == nil { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *LLMObsExperimentationSortField) HasDirection() bool { + return o != nil && o.Direction != nil +} + +// SetDirection gets a reference to the given LLMObsExperimentationSortFieldDirection and assigns it to the Direction field. +func (o *LLMObsExperimentationSortField) SetDirection(v LLMObsExperimentationSortFieldDirection) { + o.Direction = &v +} + +// GetField returns the Field field value. +func (o *LLMObsExperimentationSortField) GetField() string { + if o == nil { + var ret string + return ret + } + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *LLMObsExperimentationSortField) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value. +func (o *LLMObsExperimentationSortField) SetField(v string) { + o.Field = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsExperimentationSortField) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Direction != nil { + toSerialize["direction"] = o.Direction + } + toSerialize["field"] = o.Field + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsExperimentationSortField) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Direction *LLMObsExperimentationSortFieldDirection `json:"direction,omitempty"` + Field *string `json:"field"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Field == nil { + return fmt.Errorf("required field field missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"direction", "field"}) + } else { + return err + } + + hasInvalidField := false + if all.Direction != nil && !all.Direction.IsValid() { + hasInvalidField = true + } else { + o.Direction = all.Direction + } + o.Field = *all.Field + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_experimentation_sort_field_direction.go b/api/datadogV2/model_llm_obs_experimentation_sort_field_direction.go new file mode 100644 index 00000000000..c2c38faa2ec --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_sort_field_direction.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationSortFieldDirection Sort direction. +type LLMObsExperimentationSortFieldDirection string + +// List of LLMObsExperimentationSortFieldDirection. +const ( + LLMOBSEXPERIMENTATIONSORTFIELDDIRECTION_ASC LLMObsExperimentationSortFieldDirection = "asc" + LLMOBSEXPERIMENTATIONSORTFIELDDIRECTION_DESC LLMObsExperimentationSortFieldDirection = "desc" +) + +var allowedLLMObsExperimentationSortFieldDirectionEnumValues = []LLMObsExperimentationSortFieldDirection{ + LLMOBSEXPERIMENTATIONSORTFIELDDIRECTION_ASC, + LLMOBSEXPERIMENTATIONSORTFIELDDIRECTION_DESC, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsExperimentationSortFieldDirection) GetAllowedValues() []LLMObsExperimentationSortFieldDirection { + return allowedLLMObsExperimentationSortFieldDirectionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsExperimentationSortFieldDirection) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsExperimentationSortFieldDirection(value) + return nil +} + +// NewLLMObsExperimentationSortFieldDirectionFromValue returns a pointer to a valid LLMObsExperimentationSortFieldDirection +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsExperimentationSortFieldDirectionFromValue(v string) (*LLMObsExperimentationSortFieldDirection, error) { + ev := LLMObsExperimentationSortFieldDirection(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsExperimentationSortFieldDirection: valid values are %v", v, allowedLLMObsExperimentationSortFieldDirectionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsExperimentationSortFieldDirection) IsValid() bool { + for _, existing := range allowedLLMObsExperimentationSortFieldDirectionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsExperimentationSortFieldDirection value. +func (v LLMObsExperimentationSortFieldDirection) Ptr() *LLMObsExperimentationSortFieldDirection { + return &v +} diff --git a/api/datadogV2/model_llm_obs_experimentation_type.go b/api/datadogV2/model_llm_obs_experimentation_type.go new file mode 100644 index 00000000000..42b581494d4 --- /dev/null +++ b/api/datadogV2/model_llm_obs_experimentation_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsExperimentationType Resource type for experimentation search and analytics operations. +type LLMObsExperimentationType string + +// List of LLMObsExperimentationType. +const ( + LLMOBSEXPERIMENTATIONTYPE_EXPERIMENTATION LLMObsExperimentationType = "experimentation" +) + +var allowedLLMObsExperimentationTypeEnumValues = []LLMObsExperimentationType{ + LLMOBSEXPERIMENTATIONTYPE_EXPERIMENTATION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsExperimentationType) GetAllowedValues() []LLMObsExperimentationType { + return allowedLLMObsExperimentationTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsExperimentationType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsExperimentationType(value) + return nil +} + +// NewLLMObsExperimentationTypeFromValue returns a pointer to a valid LLMObsExperimentationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsExperimentationTypeFromValue(v string) (*LLMObsExperimentationType, error) { + ev := LLMObsExperimentationType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsExperimentationType: valid values are %v", v, allowedLLMObsExperimentationTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsExperimentationType) IsValid() bool { + for _, existing := range allowedLLMObsExperimentationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsExperimentationType value. +func (v LLMObsExperimentationType) Ptr() *LLMObsExperimentationType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_inference_code.go b/api/datadogV2/model_llm_obs_inference_code.go new file mode 100644 index 00000000000..e5b54fbf650 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_code.go @@ -0,0 +1,165 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceCode A generated code snippet for running an inference request programmatically. +type LLMObsInferenceCode struct { + // The generated code content. + Code string `json:"code"` + // Unique identifier for the code snippet. + Id string `json:"id"` + // The programming language or SDK type of the code snippet. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceCode instantiates a new LLMObsInferenceCode object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceCode(code string, id string, typeVar string) *LLMObsInferenceCode { + this := LLMObsInferenceCode{} + this.Code = code + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsInferenceCodeWithDefaults instantiates a new LLMObsInferenceCode object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceCodeWithDefaults() *LLMObsInferenceCode { + this := LLMObsInferenceCode{} + return &this +} + +// GetCode returns the Code field value. +func (o *LLMObsInferenceCode) GetCode() string { + if o == nil { + var ret string + return ret + } + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceCode) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value. +func (o *LLMObsInferenceCode) SetCode(v string) { + o.Code = v +} + +// GetId returns the Id field value. +func (o *LLMObsInferenceCode) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceCode) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsInferenceCode) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsInferenceCode) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceCode) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsInferenceCode) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceCode) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["code"] = o.Code + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceCode) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Code *string `json:"code"` + Id *string `json:"id"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Code == nil { + return fmt.Errorf("required field code missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"code", "id", "type"}) + } else { + return err + } + o.Code = *all.Code + o.Id = *all.Id + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_content.go b/api/datadogV2/model_llm_obs_inference_content.go new file mode 100644 index 00000000000..98c8730d53e --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_content.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceContent A structured content block within a message. +type LLMObsInferenceContent struct { + // The content block type. + Type string `json:"type"` + // The typed value of a message content block. + Value LLMObsInferenceContentValue `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceContent instantiates a new LLMObsInferenceContent object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceContent(typeVar string, value LLMObsInferenceContentValue) *LLMObsInferenceContent { + this := LLMObsInferenceContent{} + this.Type = typeVar + this.Value = value + return &this +} + +// NewLLMObsInferenceContentWithDefaults instantiates a new LLMObsInferenceContent object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceContentWithDefaults() *LLMObsInferenceContent { + this := LLMObsInferenceContent{} + return &this +} + +// GetType returns the Type field value. +func (o *LLMObsInferenceContent) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceContent) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsInferenceContent) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value. +func (o *LLMObsInferenceContent) GetValue() LLMObsInferenceContentValue { + if o == nil { + var ret LLMObsInferenceContentValue + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceContent) GetValueOk() (*LLMObsInferenceContentValue, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *LLMObsInferenceContent) SetValue(v LLMObsInferenceContentValue) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceContent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceContent) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Type *string `json:"type"` + Value *LLMObsInferenceContentValue `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"type", "value"}) + } else { + return err + } + + hasInvalidField := false + o.Type = *all.Type + if all.Value.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_content_value.go b/api/datadogV2/model_llm_obs_inference_content_value.go new file mode 100644 index 00000000000..e95581768a0 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_content_value.go @@ -0,0 +1,184 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceContentValue The typed value of a message content block. +type LLMObsInferenceContentValue struct { + // Plain text content. + Text *string `json:"text,omitempty"` + // A tool call made during LLM inference. + ToolCall *LLMObsInferenceToolCall `json:"tool_call,omitempty"` + // The result returned by a tool call during LLM inference. + ToolCallResult *LLMObsInferenceToolResult `json:"tool_call_result,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceContentValue instantiates a new LLMObsInferenceContentValue object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceContentValue() *LLMObsInferenceContentValue { + this := LLMObsInferenceContentValue{} + return &this +} + +// NewLLMObsInferenceContentValueWithDefaults instantiates a new LLMObsInferenceContentValue object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceContentValueWithDefaults() *LLMObsInferenceContentValue { + this := LLMObsInferenceContentValue{} + return &this +} + +// GetText returns the Text field value if set, zero value otherwise. +func (o *LLMObsInferenceContentValue) GetText() string { + if o == nil || o.Text == nil { + var ret string + return ret + } + return *o.Text +} + +// GetTextOk returns a tuple with the Text field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceContentValue) GetTextOk() (*string, bool) { + if o == nil || o.Text == nil { + return nil, false + } + return o.Text, true +} + +// HasText returns a boolean if a field has been set. +func (o *LLMObsInferenceContentValue) HasText() bool { + return o != nil && o.Text != nil +} + +// SetText gets a reference to the given string and assigns it to the Text field. +func (o *LLMObsInferenceContentValue) SetText(v string) { + o.Text = &v +} + +// GetToolCall returns the ToolCall field value if set, zero value otherwise. +func (o *LLMObsInferenceContentValue) GetToolCall() LLMObsInferenceToolCall { + if o == nil || o.ToolCall == nil { + var ret LLMObsInferenceToolCall + return ret + } + return *o.ToolCall +} + +// GetToolCallOk returns a tuple with the ToolCall field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceContentValue) GetToolCallOk() (*LLMObsInferenceToolCall, bool) { + if o == nil || o.ToolCall == nil { + return nil, false + } + return o.ToolCall, true +} + +// HasToolCall returns a boolean if a field has been set. +func (o *LLMObsInferenceContentValue) HasToolCall() bool { + return o != nil && o.ToolCall != nil +} + +// SetToolCall gets a reference to the given LLMObsInferenceToolCall and assigns it to the ToolCall field. +func (o *LLMObsInferenceContentValue) SetToolCall(v LLMObsInferenceToolCall) { + o.ToolCall = &v +} + +// GetToolCallResult returns the ToolCallResult field value if set, zero value otherwise. +func (o *LLMObsInferenceContentValue) GetToolCallResult() LLMObsInferenceToolResult { + if o == nil || o.ToolCallResult == nil { + var ret LLMObsInferenceToolResult + return ret + } + return *o.ToolCallResult +} + +// GetToolCallResultOk returns a tuple with the ToolCallResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceContentValue) GetToolCallResultOk() (*LLMObsInferenceToolResult, bool) { + if o == nil || o.ToolCallResult == nil { + return nil, false + } + return o.ToolCallResult, true +} + +// HasToolCallResult returns a boolean if a field has been set. +func (o *LLMObsInferenceContentValue) HasToolCallResult() bool { + return o != nil && o.ToolCallResult != nil +} + +// SetToolCallResult gets a reference to the given LLMObsInferenceToolResult and assigns it to the ToolCallResult field. +func (o *LLMObsInferenceContentValue) SetToolCallResult(v LLMObsInferenceToolResult) { + o.ToolCallResult = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceContentValue) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Text != nil { + toSerialize["text"] = o.Text + } + if o.ToolCall != nil { + toSerialize["tool_call"] = o.ToolCall + } + if o.ToolCallResult != nil { + toSerialize["tool_call_result"] = o.ToolCallResult + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceContentValue) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Text *string `json:"text,omitempty"` + ToolCall *LLMObsInferenceToolCall `json:"tool_call,omitempty"` + ToolCallResult *LLMObsInferenceToolResult `json:"tool_call_result,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"text", "tool_call", "tool_call_result"}) + } else { + return err + } + + hasInvalidField := false + o.Text = all.Text + if all.ToolCall != nil && all.ToolCall.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ToolCall = all.ToolCall + if all.ToolCallResult != nil && all.ToolCallResult.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ToolCallResult = all.ToolCallResult + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_error_response.go b/api/datadogV2/model_llm_obs_inference_error_response.go new file mode 100644 index 00000000000..a83804f9da0 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_error_response.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceErrorResponse Error details returned when an inference provider returns an error. +type LLMObsInferenceErrorResponse struct { + // A human-readable description of the error. + Message string `json:"message"` + // The provider-specific error type. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceErrorResponse instantiates a new LLMObsInferenceErrorResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceErrorResponse(message string, typeVar string) *LLMObsInferenceErrorResponse { + this := LLMObsInferenceErrorResponse{} + this.Message = message + this.Type = typeVar + return &this +} + +// NewLLMObsInferenceErrorResponseWithDefaults instantiates a new LLMObsInferenceErrorResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceErrorResponseWithDefaults() *LLMObsInferenceErrorResponse { + this := LLMObsInferenceErrorResponse{} + return &this +} + +// GetMessage returns the Message field value. +func (o *LLMObsInferenceErrorResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value. +func (o *LLMObsInferenceErrorResponse) SetMessage(v string) { + o.Message = v +} + +// GetType returns the Type field value. +func (o *LLMObsInferenceErrorResponse) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceErrorResponse) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsInferenceErrorResponse) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["message"] = o.Message + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceErrorResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Message *string `json:"message"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Message == nil { + return fmt.Errorf("required field message missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"message", "type"}) + } else { + return err + } + o.Message = *all.Message + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_function.go b/api/datadogV2/model_llm_obs_inference_function.go new file mode 100644 index 00000000000..c1ce6813f28 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_function.go @@ -0,0 +1,168 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceFunction A function definition for a tool available to the model. +type LLMObsInferenceFunction struct { + // A description of what the function does. + Description *string `json:"description,omitempty"` + // The name of the function. + Name string `json:"name"` + // JSON schema describing the function parameters. + Parameters map[string]interface{} `json:"parameters"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceFunction instantiates a new LLMObsInferenceFunction object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceFunction(name string, parameters map[string]interface{}) *LLMObsInferenceFunction { + this := LLMObsInferenceFunction{} + this.Name = name + this.Parameters = parameters + return &this +} + +// NewLLMObsInferenceFunctionWithDefaults instantiates a new LLMObsInferenceFunction object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceFunctionWithDefaults() *LLMObsInferenceFunction { + this := LLMObsInferenceFunction{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LLMObsInferenceFunction) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceFunction) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LLMObsInferenceFunction) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LLMObsInferenceFunction) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value. +func (o *LLMObsInferenceFunction) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceFunction) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *LLMObsInferenceFunction) SetName(v string) { + o.Name = v +} + +// GetParameters returns the Parameters field value. +func (o *LLMObsInferenceFunction) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceFunction) GetParametersOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Parameters, true +} + +// SetParameters sets field value. +func (o *LLMObsInferenceFunction) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceFunction) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + toSerialize["name"] = o.Name + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceFunction) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name"` + Parameters *map[string]interface{} `json:"parameters"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Parameters == nil { + return fmt.Errorf("required field parameters missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name", "parameters"}) + } else { + return err + } + o.Description = all.Description + o.Name = *all.Name + o.Parameters = *all.Parameters + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_message.go b/api/datadogV2/model_llm_obs_inference_message.go new file mode 100644 index 00000000000..f4c6f20014d --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_message.go @@ -0,0 +1,277 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceMessage A single message in an LLM inference conversation. +type LLMObsInferenceMessage struct { + // Plain text content of the message. + Content *string `json:"content,omitempty"` + // List of structured content blocks in a message. + Contents []LLMObsInferenceContent `json:"contents,omitempty"` + // Unique identifier for the message. + Id *string `json:"id,omitempty"` + // The role of the message author. + Role *string `json:"role,omitempty"` + // List of tool calls in a message. + ToolCalls []LLMObsInferenceToolCall `json:"tool_calls,omitempty"` + // List of tool results in a message. + ToolResults []LLMObsInferenceToolResult `json:"tool_results,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceMessage instantiates a new LLMObsInferenceMessage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceMessage() *LLMObsInferenceMessage { + this := LLMObsInferenceMessage{} + return &this +} + +// NewLLMObsInferenceMessageWithDefaults instantiates a new LLMObsInferenceMessage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceMessageWithDefaults() *LLMObsInferenceMessage { + this := LLMObsInferenceMessage{} + return &this +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetContent() string { + if o == nil || o.Content == nil { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetContentOk() (*string, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasContent() bool { + return o != nil && o.Content != nil +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *LLMObsInferenceMessage) SetContent(v string) { + o.Content = &v +} + +// GetContents returns the Contents field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetContents() []LLMObsInferenceContent { + if o == nil || o.Contents == nil { + var ret []LLMObsInferenceContent + return ret + } + return o.Contents +} + +// GetContentsOk returns a tuple with the Contents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetContentsOk() (*[]LLMObsInferenceContent, bool) { + if o == nil || o.Contents == nil { + return nil, false + } + return &o.Contents, true +} + +// HasContents returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasContents() bool { + return o != nil && o.Contents != nil +} + +// SetContents gets a reference to the given []LLMObsInferenceContent and assigns it to the Contents field. +func (o *LLMObsInferenceMessage) SetContents(v []LLMObsInferenceContent) { + o.Contents = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LLMObsInferenceMessage) SetId(v string) { + o.Id = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasRole() bool { + return o != nil && o.Role != nil +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *LLMObsInferenceMessage) SetRole(v string) { + o.Role = &v +} + +// GetToolCalls returns the ToolCalls field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetToolCalls() []LLMObsInferenceToolCall { + if o == nil || o.ToolCalls == nil { + var ret []LLMObsInferenceToolCall + return ret + } + return o.ToolCalls +} + +// GetToolCallsOk returns a tuple with the ToolCalls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetToolCallsOk() (*[]LLMObsInferenceToolCall, bool) { + if o == nil || o.ToolCalls == nil { + return nil, false + } + return &o.ToolCalls, true +} + +// HasToolCalls returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasToolCalls() bool { + return o != nil && o.ToolCalls != nil +} + +// SetToolCalls gets a reference to the given []LLMObsInferenceToolCall and assigns it to the ToolCalls field. +func (o *LLMObsInferenceMessage) SetToolCalls(v []LLMObsInferenceToolCall) { + o.ToolCalls = v +} + +// GetToolResults returns the ToolResults field value if set, zero value otherwise. +func (o *LLMObsInferenceMessage) GetToolResults() []LLMObsInferenceToolResult { + if o == nil || o.ToolResults == nil { + var ret []LLMObsInferenceToolResult + return ret + } + return o.ToolResults +} + +// GetToolResultsOk returns a tuple with the ToolResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceMessage) GetToolResultsOk() (*[]LLMObsInferenceToolResult, bool) { + if o == nil || o.ToolResults == nil { + return nil, false + } + return &o.ToolResults, true +} + +// HasToolResults returns a boolean if a field has been set. +func (o *LLMObsInferenceMessage) HasToolResults() bool { + return o != nil && o.ToolResults != nil +} + +// SetToolResults gets a reference to the given []LLMObsInferenceToolResult and assigns it to the ToolResults field. +func (o *LLMObsInferenceMessage) SetToolResults(v []LLMObsInferenceToolResult) { + o.ToolResults = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceMessage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + if o.Contents != nil { + toSerialize["contents"] = o.Contents + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.ToolCalls != nil { + toSerialize["tool_calls"] = o.ToolCalls + } + if o.ToolResults != nil { + toSerialize["tool_results"] = o.ToolResults + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceMessage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Content *string `json:"content,omitempty"` + Contents []LLMObsInferenceContent `json:"contents,omitempty"` + Id *string `json:"id,omitempty"` + Role *string `json:"role,omitempty"` + ToolCalls []LLMObsInferenceToolCall `json:"tool_calls,omitempty"` + ToolResults []LLMObsInferenceToolResult `json:"tool_results,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content", "contents", "id", "role", "tool_calls", "tool_results"}) + } else { + return err + } + o.Content = all.Content + o.Contents = all.Contents + o.Id = all.Id + o.Role = all.Role + o.ToolCalls = all.ToolCalls + o.ToolResults = all.ToolResults + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_run_result.go b/api/datadogV2/model_llm_obs_inference_run_result.go new file mode 100644 index 00000000000..dfcd4029198 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_run_result.go @@ -0,0 +1,403 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceRunResult The output of a completed LLM inference call. +type LLMObsInferenceRunResult struct { + // An optional assessment of the inference output quality. + Assessment datadog.NullableString `json:"assessment"` + // The text content of the model response. + Content string `json:"content"` + // The reason the model stopped generating tokens. + FinishReason string `json:"finish_reason"` + // List of generated code snippets for the inference configuration. + InferenceCodes []LLMObsInferenceCode `json:"inference_codes"` + // Number of input tokens consumed. + InputTokens int64 `json:"input_tokens"` + // The model's internal reasoning or thinking output, if available. + InternalReasoning *LLMObsInternalReasoning `json:"internal_reasoning,omitempty"` + // Request latency in milliseconds. + Latency int64 `json:"latency"` + // Number of output tokens generated. + OutputTokens int64 `json:"output_tokens"` + // List of tools available to the model. + Tools []LLMObsInferenceTool `json:"tools"` + // Total tokens used (input plus output). + TotalTokens int64 `json:"total_tokens"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceRunResult instantiates a new LLMObsInferenceRunResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceRunResult(assessment datadog.NullableString, content string, finishReason string, inferenceCodes []LLMObsInferenceCode, inputTokens int64, latency int64, outputTokens int64, tools []LLMObsInferenceTool, totalTokens int64) *LLMObsInferenceRunResult { + this := LLMObsInferenceRunResult{} + this.Assessment = assessment + this.Content = content + this.FinishReason = finishReason + this.InferenceCodes = inferenceCodes + this.InputTokens = inputTokens + this.Latency = latency + this.OutputTokens = outputTokens + this.Tools = tools + this.TotalTokens = totalTokens + return &this +} + +// NewLLMObsInferenceRunResultWithDefaults instantiates a new LLMObsInferenceRunResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceRunResultWithDefaults() *LLMObsInferenceRunResult { + this := LLMObsInferenceRunResult{} + return &this +} + +// GetAssessment returns the Assessment field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *LLMObsInferenceRunResult) GetAssessment() string { + if o == nil || o.Assessment.Get() == nil { + var ret string + return ret + } + return *o.Assessment.Get() +} + +// GetAssessmentOk returns a tuple with the Assessment field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsInferenceRunResult) GetAssessmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Assessment.Get(), o.Assessment.IsSet() +} + +// SetAssessment sets field value. +func (o *LLMObsInferenceRunResult) SetAssessment(v string) { + o.Assessment.Set(&v) +} + +// GetContent returns the Content field value. +func (o *LLMObsInferenceRunResult) GetContent() string { + if o == nil { + var ret string + return ret + } + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value. +func (o *LLMObsInferenceRunResult) SetContent(v string) { + o.Content = v +} + +// GetFinishReason returns the FinishReason field value. +func (o *LLMObsInferenceRunResult) GetFinishReason() string { + if o == nil { + var ret string + return ret + } + return o.FinishReason +} + +// GetFinishReasonOk returns a tuple with the FinishReason field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetFinishReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishReason, true +} + +// SetFinishReason sets field value. +func (o *LLMObsInferenceRunResult) SetFinishReason(v string) { + o.FinishReason = v +} + +// GetInferenceCodes returns the InferenceCodes field value. +func (o *LLMObsInferenceRunResult) GetInferenceCodes() []LLMObsInferenceCode { + if o == nil { + var ret []LLMObsInferenceCode + return ret + } + return o.InferenceCodes +} + +// GetInferenceCodesOk returns a tuple with the InferenceCodes field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetInferenceCodesOk() (*[]LLMObsInferenceCode, bool) { + if o == nil { + return nil, false + } + return &o.InferenceCodes, true +} + +// SetInferenceCodes sets field value. +func (o *LLMObsInferenceRunResult) SetInferenceCodes(v []LLMObsInferenceCode) { + o.InferenceCodes = v +} + +// GetInputTokens returns the InputTokens field value. +func (o *LLMObsInferenceRunResult) GetInputTokens() int64 { + if o == nil { + var ret int64 + return ret + } + return o.InputTokens +} + +// GetInputTokensOk returns a tuple with the InputTokens field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetInputTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.InputTokens, true +} + +// SetInputTokens sets field value. +func (o *LLMObsInferenceRunResult) SetInputTokens(v int64) { + o.InputTokens = v +} + +// GetInternalReasoning returns the InternalReasoning field value if set, zero value otherwise. +func (o *LLMObsInferenceRunResult) GetInternalReasoning() LLMObsInternalReasoning { + if o == nil || o.InternalReasoning == nil { + var ret LLMObsInternalReasoning + return ret + } + return *o.InternalReasoning +} + +// GetInternalReasoningOk returns a tuple with the InternalReasoning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetInternalReasoningOk() (*LLMObsInternalReasoning, bool) { + if o == nil || o.InternalReasoning == nil { + return nil, false + } + return o.InternalReasoning, true +} + +// HasInternalReasoning returns a boolean if a field has been set. +func (o *LLMObsInferenceRunResult) HasInternalReasoning() bool { + return o != nil && o.InternalReasoning != nil +} + +// SetInternalReasoning gets a reference to the given LLMObsInternalReasoning and assigns it to the InternalReasoning field. +func (o *LLMObsInferenceRunResult) SetInternalReasoning(v LLMObsInternalReasoning) { + o.InternalReasoning = &v +} + +// GetLatency returns the Latency field value. +func (o *LLMObsInferenceRunResult) GetLatency() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Latency +} + +// GetLatencyOk returns a tuple with the Latency field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetLatencyOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Latency, true +} + +// SetLatency sets field value. +func (o *LLMObsInferenceRunResult) SetLatency(v int64) { + o.Latency = v +} + +// GetOutputTokens returns the OutputTokens field value. +func (o *LLMObsInferenceRunResult) GetOutputTokens() int64 { + if o == nil { + var ret int64 + return ret + } + return o.OutputTokens +} + +// GetOutputTokensOk returns a tuple with the OutputTokens field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetOutputTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OutputTokens, true +} + +// SetOutputTokens sets field value. +func (o *LLMObsInferenceRunResult) SetOutputTokens(v int64) { + o.OutputTokens = v +} + +// GetTools returns the Tools field value. +func (o *LLMObsInferenceRunResult) GetTools() []LLMObsInferenceTool { + if o == nil { + var ret []LLMObsInferenceTool + return ret + } + return o.Tools +} + +// GetToolsOk returns a tuple with the Tools field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetToolsOk() (*[]LLMObsInferenceTool, bool) { + if o == nil { + return nil, false + } + return &o.Tools, true +} + +// SetTools sets field value. +func (o *LLMObsInferenceRunResult) SetTools(v []LLMObsInferenceTool) { + o.Tools = v +} + +// GetTotalTokens returns the TotalTokens field value. +func (o *LLMObsInferenceRunResult) GetTotalTokens() int64 { + if o == nil { + var ret int64 + return ret + } + return o.TotalTokens +} + +// GetTotalTokensOk returns a tuple with the TotalTokens field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceRunResult) GetTotalTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTokens, true +} + +// SetTotalTokens sets field value. +func (o *LLMObsInferenceRunResult) SetTotalTokens(v int64) { + o.TotalTokens = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceRunResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["assessment"] = o.Assessment.Get() + toSerialize["content"] = o.Content + toSerialize["finish_reason"] = o.FinishReason + toSerialize["inference_codes"] = o.InferenceCodes + toSerialize["input_tokens"] = o.InputTokens + if o.InternalReasoning != nil { + toSerialize["internal_reasoning"] = o.InternalReasoning + } + toSerialize["latency"] = o.Latency + toSerialize["output_tokens"] = o.OutputTokens + toSerialize["tools"] = o.Tools + toSerialize["total_tokens"] = o.TotalTokens + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceRunResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Assessment datadog.NullableString `json:"assessment"` + Content *string `json:"content"` + FinishReason *string `json:"finish_reason"` + InferenceCodes *[]LLMObsInferenceCode `json:"inference_codes"` + InputTokens *int64 `json:"input_tokens"` + InternalReasoning *LLMObsInternalReasoning `json:"internal_reasoning,omitempty"` + Latency *int64 `json:"latency"` + OutputTokens *int64 `json:"output_tokens"` + Tools *[]LLMObsInferenceTool `json:"tools"` + TotalTokens *int64 `json:"total_tokens"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if !all.Assessment.IsSet() { + return fmt.Errorf("required field assessment missing") + } + if all.Content == nil { + return fmt.Errorf("required field content missing") + } + if all.FinishReason == nil { + return fmt.Errorf("required field finish_reason missing") + } + if all.InferenceCodes == nil { + return fmt.Errorf("required field inference_codes missing") + } + if all.InputTokens == nil { + return fmt.Errorf("required field input_tokens missing") + } + if all.Latency == nil { + return fmt.Errorf("required field latency missing") + } + if all.OutputTokens == nil { + return fmt.Errorf("required field output_tokens missing") + } + if all.Tools == nil { + return fmt.Errorf("required field tools missing") + } + if all.TotalTokens == nil { + return fmt.Errorf("required field total_tokens missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"assessment", "content", "finish_reason", "inference_codes", "input_tokens", "internal_reasoning", "latency", "output_tokens", "tools", "total_tokens"}) + } else { + return err + } + + hasInvalidField := false + o.Assessment = all.Assessment + o.Content = *all.Content + o.FinishReason = *all.FinishReason + o.InferenceCodes = *all.InferenceCodes + o.InputTokens = *all.InputTokens + if all.InternalReasoning != nil && all.InternalReasoning.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.InternalReasoning = all.InternalReasoning + o.Latency = *all.Latency + o.OutputTokens = *all.OutputTokens + o.Tools = *all.Tools + o.TotalTokens = *all.TotalTokens + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_tool.go b/api/datadogV2/model_llm_obs_inference_tool.go new file mode 100644 index 00000000000..4512803d046 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_tool.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceTool A tool definition available to the model during inference. +type LLMObsInferenceTool struct { + // A function definition for a tool available to the model. + Function LLMObsInferenceFunction `json:"function"` + // The type of tool. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceTool instantiates a new LLMObsInferenceTool object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceTool(function LLMObsInferenceFunction, typeVar string) *LLMObsInferenceTool { + this := LLMObsInferenceTool{} + this.Function = function + this.Type = typeVar + return &this +} + +// NewLLMObsInferenceToolWithDefaults instantiates a new LLMObsInferenceTool object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceToolWithDefaults() *LLMObsInferenceTool { + this := LLMObsInferenceTool{} + return &this +} + +// GetFunction returns the Function field value. +func (o *LLMObsInferenceTool) GetFunction() LLMObsInferenceFunction { + if o == nil { + var ret LLMObsInferenceFunction + return ret + } + return o.Function +} + +// GetFunctionOk returns a tuple with the Function field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceTool) GetFunctionOk() (*LLMObsInferenceFunction, bool) { + if o == nil { + return nil, false + } + return &o.Function, true +} + +// SetFunction sets field value. +func (o *LLMObsInferenceTool) SetFunction(v LLMObsInferenceFunction) { + o.Function = v +} + +// GetType returns the Type field value. +func (o *LLMObsInferenceTool) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceTool) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsInferenceTool) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceTool) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["function"] = o.Function + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceTool) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Function *LLMObsInferenceFunction `json:"function"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Function == nil { + return fmt.Errorf("required field function missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"function", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Function.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Function = *all.Function + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_tool_call.go b/api/datadogV2/model_llm_obs_inference_tool_call.go new file mode 100644 index 00000000000..751a1ceb3d3 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_tool_call.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceToolCall A tool call made during LLM inference. +type LLMObsInferenceToolCall struct { + // The arguments passed to the tool. + Arguments map[string]interface{} `json:"arguments,omitempty"` + // The name of the tool being called. + Name *string `json:"name,omitempty"` + // Unique identifier for the tool call. + ToolId *string `json:"tool_id,omitempty"` + // The type of tool call. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceToolCall instantiates a new LLMObsInferenceToolCall object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceToolCall() *LLMObsInferenceToolCall { + this := LLMObsInferenceToolCall{} + return &this +} + +// NewLLMObsInferenceToolCallWithDefaults instantiates a new LLMObsInferenceToolCall object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceToolCallWithDefaults() *LLMObsInferenceToolCall { + this := LLMObsInferenceToolCall{} + return &this +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *LLMObsInferenceToolCall) GetArguments() map[string]interface{} { + if o == nil || o.Arguments == nil { + var ret map[string]interface{} + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolCall) GetArgumentsOk() (*map[string]interface{}, bool) { + if o == nil || o.Arguments == nil { + return nil, false + } + return &o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *LLMObsInferenceToolCall) HasArguments() bool { + return o != nil && o.Arguments != nil +} + +// SetArguments gets a reference to the given map[string]interface{} and assigns it to the Arguments field. +func (o *LLMObsInferenceToolCall) SetArguments(v map[string]interface{}) { + o.Arguments = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsInferenceToolCall) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolCall) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsInferenceToolCall) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsInferenceToolCall) SetName(v string) { + o.Name = &v +} + +// GetToolId returns the ToolId field value if set, zero value otherwise. +func (o *LLMObsInferenceToolCall) GetToolId() string { + if o == nil || o.ToolId == nil { + var ret string + return ret + } + return *o.ToolId +} + +// GetToolIdOk returns a tuple with the ToolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolCall) GetToolIdOk() (*string, bool) { + if o == nil || o.ToolId == nil { + return nil, false + } + return o.ToolId, true +} + +// HasToolId returns a boolean if a field has been set. +func (o *LLMObsInferenceToolCall) HasToolId() bool { + return o != nil && o.ToolId != nil +} + +// SetToolId gets a reference to the given string and assigns it to the ToolId field. +func (o *LLMObsInferenceToolCall) SetToolId(v string) { + o.ToolId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LLMObsInferenceToolCall) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolCall) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LLMObsInferenceToolCall) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LLMObsInferenceToolCall) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceToolCall) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Arguments != nil { + toSerialize["arguments"] = o.Arguments + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ToolId != nil { + toSerialize["tool_id"] = o.ToolId + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceToolCall) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Arguments map[string]interface{} `json:"arguments,omitempty"` + Name *string `json:"name,omitempty"` + ToolId *string `json:"tool_id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"arguments", "name", "tool_id", "type"}) + } else { + return err + } + o.Arguments = all.Arguments + o.Name = all.Name + o.ToolId = all.ToolId + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_inference_tool_result.go b/api/datadogV2/model_llm_obs_inference_tool_result.go new file mode 100644 index 00000000000..cadc12dcde2 --- /dev/null +++ b/api/datadogV2/model_llm_obs_inference_tool_result.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInferenceToolResult The result returned by a tool call during LLM inference. +type LLMObsInferenceToolResult struct { + // The name of the tool that produced this result. + Name *string `json:"name,omitempty"` + // The result content returned by the tool. + Result *string `json:"result,omitempty"` + // Identifier matching the corresponding tool call. + ToolId *string `json:"tool_id,omitempty"` + // The type of tool result. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInferenceToolResult instantiates a new LLMObsInferenceToolResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInferenceToolResult() *LLMObsInferenceToolResult { + this := LLMObsInferenceToolResult{} + return &this +} + +// NewLLMObsInferenceToolResultWithDefaults instantiates a new LLMObsInferenceToolResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInferenceToolResultWithDefaults() *LLMObsInferenceToolResult { + this := LLMObsInferenceToolResult{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsInferenceToolResult) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolResult) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsInferenceToolResult) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsInferenceToolResult) SetName(v string) { + o.Name = &v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *LLMObsInferenceToolResult) GetResult() string { + if o == nil || o.Result == nil { + var ret string + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolResult) GetResultOk() (*string, bool) { + if o == nil || o.Result == nil { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *LLMObsInferenceToolResult) HasResult() bool { + return o != nil && o.Result != nil +} + +// SetResult gets a reference to the given string and assigns it to the Result field. +func (o *LLMObsInferenceToolResult) SetResult(v string) { + o.Result = &v +} + +// GetToolId returns the ToolId field value if set, zero value otherwise. +func (o *LLMObsInferenceToolResult) GetToolId() string { + if o == nil || o.ToolId == nil { + var ret string + return ret + } + return *o.ToolId +} + +// GetToolIdOk returns a tuple with the ToolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolResult) GetToolIdOk() (*string, bool) { + if o == nil || o.ToolId == nil { + return nil, false + } + return o.ToolId, true +} + +// HasToolId returns a boolean if a field has been set. +func (o *LLMObsInferenceToolResult) HasToolId() bool { + return o != nil && o.ToolId != nil +} + +// SetToolId gets a reference to the given string and assigns it to the ToolId field. +func (o *LLMObsInferenceToolResult) SetToolId(v string) { + o.ToolId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LLMObsInferenceToolResult) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsInferenceToolResult) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LLMObsInferenceToolResult) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LLMObsInferenceToolResult) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInferenceToolResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Result != nil { + toSerialize["result"] = o.Result + } + if o.ToolId != nil { + toSerialize["tool_id"] = o.ToolId + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInferenceToolResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + Result *string `json:"result,omitempty"` + ToolId *string `json:"tool_id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "result", "tool_id", "type"}) + } else { + return err + } + o.Name = all.Name + o.Result = all.Result + o.ToolId = all.ToolId + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_integration_account.go b/api/datadogV2/model_llm_obs_integration_account.go new file mode 100644 index 00000000000..a55a8ff4767 --- /dev/null +++ b/api/datadogV2/model_llm_obs_integration_account.go @@ -0,0 +1,314 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsIntegrationAccount A configured account for an LLM provider integration. +type LLMObsIntegrationAccount struct { + // Provider-specific account identifier. + AccountId string `json:"account_id"` + // Human-readable name for the integration account. + AccountName string `json:"account_name"` + // Provider region associated with the account, if applicable. + AccountRegion *string `json:"account_region,omitempty"` + // Azure OpenAI-specific metadata for an integration account or inference request. + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + // Unique identifier for the integration account. + Id string `json:"id"` + // The name of the LLM provider integration. + Integration string `json:"integration"` + // Vertex AI-specific metadata for an integration account or inference request. + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsIntegrationAccount instantiates a new LLMObsIntegrationAccount object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsIntegrationAccount(accountId string, accountName string, id string, integration string) *LLMObsIntegrationAccount { + this := LLMObsIntegrationAccount{} + this.AccountId = accountId + this.AccountName = accountName + this.Id = id + this.Integration = integration + return &this +} + +// NewLLMObsIntegrationAccountWithDefaults instantiates a new LLMObsIntegrationAccount object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsIntegrationAccountWithDefaults() *LLMObsIntegrationAccount { + this := LLMObsIntegrationAccount{} + return &this +} + +// GetAccountId returns the AccountId field value. +func (o *LLMObsIntegrationAccount) GetAccountId() string { + if o == nil { + var ret string + return ret + } + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value. +func (o *LLMObsIntegrationAccount) SetAccountId(v string) { + o.AccountId = v +} + +// GetAccountName returns the AccountName field value. +func (o *LLMObsIntegrationAccount) GetAccountName() string { + if o == nil { + var ret string + return ret + } + return o.AccountName +} + +// GetAccountNameOk returns a tuple with the AccountName field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetAccountNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountName, true +} + +// SetAccountName sets field value. +func (o *LLMObsIntegrationAccount) SetAccountName(v string) { + o.AccountName = v +} + +// GetAccountRegion returns the AccountRegion field value if set, zero value otherwise. +func (o *LLMObsIntegrationAccount) GetAccountRegion() string { + if o == nil || o.AccountRegion == nil { + var ret string + return ret + } + return *o.AccountRegion +} + +// GetAccountRegionOk returns a tuple with the AccountRegion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetAccountRegionOk() (*string, bool) { + if o == nil || o.AccountRegion == nil { + return nil, false + } + return o.AccountRegion, true +} + +// HasAccountRegion returns a boolean if a field has been set. +func (o *LLMObsIntegrationAccount) HasAccountRegion() bool { + return o != nil && o.AccountRegion != nil +} + +// SetAccountRegion gets a reference to the given string and assigns it to the AccountRegion field. +func (o *LLMObsIntegrationAccount) SetAccountRegion(v string) { + o.AccountRegion = &v +} + +// GetAzureOpenaiMetadata returns the AzureOpenaiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationAccount) GetAzureOpenaiMetadata() LLMObsAzureOpenAIMetadata { + if o == nil || o.AzureOpenaiMetadata == nil { + var ret LLMObsAzureOpenAIMetadata + return ret + } + return *o.AzureOpenaiMetadata +} + +// GetAzureOpenaiMetadataOk returns a tuple with the AzureOpenaiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetAzureOpenaiMetadataOk() (*LLMObsAzureOpenAIMetadata, bool) { + if o == nil || o.AzureOpenaiMetadata == nil { + return nil, false + } + return o.AzureOpenaiMetadata, true +} + +// HasAzureOpenaiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationAccount) HasAzureOpenaiMetadata() bool { + return o != nil && o.AzureOpenaiMetadata != nil +} + +// SetAzureOpenaiMetadata gets a reference to the given LLMObsAzureOpenAIMetadata and assigns it to the AzureOpenaiMetadata field. +func (o *LLMObsIntegrationAccount) SetAzureOpenaiMetadata(v LLMObsAzureOpenAIMetadata) { + o.AzureOpenaiMetadata = &v +} + +// GetId returns the Id field value. +func (o *LLMObsIntegrationAccount) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsIntegrationAccount) SetId(v string) { + o.Id = v +} + +// GetIntegration returns the Integration field value. +func (o *LLMObsIntegrationAccount) GetIntegration() string { + if o == nil { + var ret string + return ret + } + return o.Integration +} + +// GetIntegrationOk returns a tuple with the Integration field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetIntegrationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Integration, true +} + +// SetIntegration sets field value. +func (o *LLMObsIntegrationAccount) SetIntegration(v string) { + o.Integration = v +} + +// GetVertexAiMetadata returns the VertexAiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationAccount) GetVertexAiMetadata() LLMObsVertexAIMetadata { + if o == nil || o.VertexAiMetadata == nil { + var ret LLMObsVertexAIMetadata + return ret + } + return *o.VertexAiMetadata +} + +// GetVertexAiMetadataOk returns a tuple with the VertexAiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationAccount) GetVertexAiMetadataOk() (*LLMObsVertexAIMetadata, bool) { + if o == nil || o.VertexAiMetadata == nil { + return nil, false + } + return o.VertexAiMetadata, true +} + +// HasVertexAiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationAccount) HasVertexAiMetadata() bool { + return o != nil && o.VertexAiMetadata != nil +} + +// SetVertexAiMetadata gets a reference to the given LLMObsVertexAIMetadata and assigns it to the VertexAiMetadata field. +func (o *LLMObsIntegrationAccount) SetVertexAiMetadata(v LLMObsVertexAIMetadata) { + o.VertexAiMetadata = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsIntegrationAccount) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["account_id"] = o.AccountId + toSerialize["account_name"] = o.AccountName + if o.AccountRegion != nil { + toSerialize["account_region"] = o.AccountRegion + } + if o.AzureOpenaiMetadata != nil { + toSerialize["azure_openai_metadata"] = o.AzureOpenaiMetadata + } + toSerialize["id"] = o.Id + toSerialize["integration"] = o.Integration + if o.VertexAiMetadata != nil { + toSerialize["vertex_ai_metadata"] = o.VertexAiMetadata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsIntegrationAccount) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AccountId *string `json:"account_id"` + AccountName *string `json:"account_name"` + AccountRegion *string `json:"account_region,omitempty"` + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + Id *string `json:"id"` + Integration *string `json:"integration"` + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AccountId == nil { + return fmt.Errorf("required field account_id missing") + } + if all.AccountName == nil { + return fmt.Errorf("required field account_name missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Integration == nil { + return fmt.Errorf("required field integration missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"account_id", "account_name", "account_region", "azure_openai_metadata", "id", "integration", "vertex_ai_metadata"}) + } else { + return err + } + + hasInvalidField := false + o.AccountId = *all.AccountId + o.AccountName = *all.AccountName + o.AccountRegion = all.AccountRegion + if all.AzureOpenaiMetadata != nil && all.AzureOpenaiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AzureOpenaiMetadata = all.AzureOpenaiMetadata + o.Id = *all.Id + o.Integration = *all.Integration + if all.VertexAiMetadata != nil && all.VertexAiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.VertexAiMetadata = all.VertexAiMetadata + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_integration_inference_request.go b/api/datadogV2/model_llm_obs_integration_inference_request.go new file mode 100644 index 00000000000..6322e4e5e12 --- /dev/null +++ b/api/datadogV2/model_llm_obs_integration_inference_request.go @@ -0,0 +1,732 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsIntegrationInferenceRequest Parameters for an LLM inference request. +type LLMObsIntegrationInferenceRequest struct { + // Anthropic-specific metadata for an inference request. + AnthropicMetadata *LLMObsAnthropicMetadata `json:"anthropic_metadata,omitempty"` + // Azure OpenAI-specific metadata for an integration account or inference request. + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + // Amazon Bedrock-specific metadata for an inference request. + BedrockMetadata *LLMObsBedrockMetadata `json:"bedrock_metadata,omitempty"` + // Penalty for token frequency to reduce repetition. + FrequencyPenalty datadog.NullableFloat64 `json:"frequency_penalty,omitempty"` + // JSON schema for structured output, if supported by the model. + JsonSchema datadog.NullableString `json:"json_schema,omitempty"` + // Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + MaxCompletionTokens datadog.NullableInt64 `json:"max_completion_tokens,omitempty"` + // Maximum number of tokens to generate. + MaxTokens datadog.NullableInt64 `json:"max_tokens,omitempty"` + // List of messages in an inference conversation. + Messages []LLMObsInferenceMessage `json:"messages"` + // The model identifier to use for inference. + ModelId string `json:"model_id"` + // OpenAI-specific metadata for an inference request. + OpenaiMetadata *LLMObsOpenAIMetadata `json:"openai_metadata,omitempty"` + // Penalty for token presence to encourage topic diversity. + PresencePenalty datadog.NullableFloat64 `json:"presence_penalty,omitempty"` + // Sampling temperature between 0 and 2. Higher values produce more random output. + Temperature datadog.NullableFloat64 `json:"temperature,omitempty"` + // List of tools available to the model. + Tools []LLMObsInferenceTool `json:"tools,omitempty"` + // Top-K sampling parameter. + TopK datadog.NullableInt64 `json:"top_k,omitempty"` + // Nucleus sampling probability mass. + TopP datadog.NullableFloat64 `json:"top_p,omitempty"` + // Vertex AI-specific metadata for an integration account or inference request. + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsIntegrationInferenceRequest instantiates a new LLMObsIntegrationInferenceRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsIntegrationInferenceRequest(messages []LLMObsInferenceMessage, modelId string) *LLMObsIntegrationInferenceRequest { + this := LLMObsIntegrationInferenceRequest{} + this.Messages = messages + this.ModelId = modelId + return &this +} + +// NewLLMObsIntegrationInferenceRequestWithDefaults instantiates a new LLMObsIntegrationInferenceRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsIntegrationInferenceRequestWithDefaults() *LLMObsIntegrationInferenceRequest { + this := LLMObsIntegrationInferenceRequest{} + return &this +} + +// GetAnthropicMetadata returns the AnthropicMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetAnthropicMetadata() LLMObsAnthropicMetadata { + if o == nil || o.AnthropicMetadata == nil { + var ret LLMObsAnthropicMetadata + return ret + } + return *o.AnthropicMetadata +} + +// GetAnthropicMetadataOk returns a tuple with the AnthropicMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetAnthropicMetadataOk() (*LLMObsAnthropicMetadata, bool) { + if o == nil || o.AnthropicMetadata == nil { + return nil, false + } + return o.AnthropicMetadata, true +} + +// HasAnthropicMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasAnthropicMetadata() bool { + return o != nil && o.AnthropicMetadata != nil +} + +// SetAnthropicMetadata gets a reference to the given LLMObsAnthropicMetadata and assigns it to the AnthropicMetadata field. +func (o *LLMObsIntegrationInferenceRequest) SetAnthropicMetadata(v LLMObsAnthropicMetadata) { + o.AnthropicMetadata = &v +} + +// GetAzureOpenaiMetadata returns the AzureOpenaiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetAzureOpenaiMetadata() LLMObsAzureOpenAIMetadata { + if o == nil || o.AzureOpenaiMetadata == nil { + var ret LLMObsAzureOpenAIMetadata + return ret + } + return *o.AzureOpenaiMetadata +} + +// GetAzureOpenaiMetadataOk returns a tuple with the AzureOpenaiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetAzureOpenaiMetadataOk() (*LLMObsAzureOpenAIMetadata, bool) { + if o == nil || o.AzureOpenaiMetadata == nil { + return nil, false + } + return o.AzureOpenaiMetadata, true +} + +// HasAzureOpenaiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasAzureOpenaiMetadata() bool { + return o != nil && o.AzureOpenaiMetadata != nil +} + +// SetAzureOpenaiMetadata gets a reference to the given LLMObsAzureOpenAIMetadata and assigns it to the AzureOpenaiMetadata field. +func (o *LLMObsIntegrationInferenceRequest) SetAzureOpenaiMetadata(v LLMObsAzureOpenAIMetadata) { + o.AzureOpenaiMetadata = &v +} + +// GetBedrockMetadata returns the BedrockMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetBedrockMetadata() LLMObsBedrockMetadata { + if o == nil || o.BedrockMetadata == nil { + var ret LLMObsBedrockMetadata + return ret + } + return *o.BedrockMetadata +} + +// GetBedrockMetadataOk returns a tuple with the BedrockMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetBedrockMetadataOk() (*LLMObsBedrockMetadata, bool) { + if o == nil || o.BedrockMetadata == nil { + return nil, false + } + return o.BedrockMetadata, true +} + +// HasBedrockMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasBedrockMetadata() bool { + return o != nil && o.BedrockMetadata != nil +} + +// SetBedrockMetadata gets a reference to the given LLMObsBedrockMetadata and assigns it to the BedrockMetadata field. +func (o *LLMObsIntegrationInferenceRequest) SetBedrockMetadata(v LLMObsBedrockMetadata) { + o.BedrockMetadata = &v +} + +// GetFrequencyPenalty returns the FrequencyPenalty field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetFrequencyPenalty() float64 { + if o == nil || o.FrequencyPenalty.Get() == nil { + var ret float64 + return ret + } + return *o.FrequencyPenalty.Get() +} + +// GetFrequencyPenaltyOk returns a tuple with the FrequencyPenalty field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetFrequencyPenaltyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.FrequencyPenalty.Get(), o.FrequencyPenalty.IsSet() +} + +// HasFrequencyPenalty returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasFrequencyPenalty() bool { + return o != nil && o.FrequencyPenalty.IsSet() +} + +// SetFrequencyPenalty gets a reference to the given datadog.NullableFloat64 and assigns it to the FrequencyPenalty field. +func (o *LLMObsIntegrationInferenceRequest) SetFrequencyPenalty(v float64) { + o.FrequencyPenalty.Set(&v) +} + +// SetFrequencyPenaltyNil sets the value for FrequencyPenalty to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetFrequencyPenaltyNil() { + o.FrequencyPenalty.Set(nil) +} + +// UnsetFrequencyPenalty ensures that no value is present for FrequencyPenalty, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetFrequencyPenalty() { + o.FrequencyPenalty.Unset() +} + +// GetJsonSchema returns the JsonSchema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetJsonSchema() string { + if o == nil || o.JsonSchema.Get() == nil { + var ret string + return ret + } + return *o.JsonSchema.Get() +} + +// GetJsonSchemaOk returns a tuple with the JsonSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetJsonSchemaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.JsonSchema.Get(), o.JsonSchema.IsSet() +} + +// HasJsonSchema returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasJsonSchema() bool { + return o != nil && o.JsonSchema.IsSet() +} + +// SetJsonSchema gets a reference to the given datadog.NullableString and assigns it to the JsonSchema field. +func (o *LLMObsIntegrationInferenceRequest) SetJsonSchema(v string) { + o.JsonSchema.Set(&v) +} + +// SetJsonSchemaNil sets the value for JsonSchema to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetJsonSchemaNil() { + o.JsonSchema.Set(nil) +} + +// UnsetJsonSchema ensures that no value is present for JsonSchema, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetJsonSchema() { + o.JsonSchema.Unset() +} + +// GetMaxCompletionTokens returns the MaxCompletionTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetMaxCompletionTokens() int64 { + if o == nil || o.MaxCompletionTokens.Get() == nil { + var ret int64 + return ret + } + return *o.MaxCompletionTokens.Get() +} + +// GetMaxCompletionTokensOk returns a tuple with the MaxCompletionTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetMaxCompletionTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MaxCompletionTokens.Get(), o.MaxCompletionTokens.IsSet() +} + +// HasMaxCompletionTokens returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasMaxCompletionTokens() bool { + return o != nil && o.MaxCompletionTokens.IsSet() +} + +// SetMaxCompletionTokens gets a reference to the given datadog.NullableInt64 and assigns it to the MaxCompletionTokens field. +func (o *LLMObsIntegrationInferenceRequest) SetMaxCompletionTokens(v int64) { + o.MaxCompletionTokens.Set(&v) +} + +// SetMaxCompletionTokensNil sets the value for MaxCompletionTokens to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetMaxCompletionTokensNil() { + o.MaxCompletionTokens.Set(nil) +} + +// UnsetMaxCompletionTokens ensures that no value is present for MaxCompletionTokens, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetMaxCompletionTokens() { + o.MaxCompletionTokens.Unset() +} + +// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetMaxTokens() int64 { + if o == nil || o.MaxTokens.Get() == nil { + var ret int64 + return ret + } + return *o.MaxTokens.Get() +} + +// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetMaxTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MaxTokens.Get(), o.MaxTokens.IsSet() +} + +// HasMaxTokens returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasMaxTokens() bool { + return o != nil && o.MaxTokens.IsSet() +} + +// SetMaxTokens gets a reference to the given datadog.NullableInt64 and assigns it to the MaxTokens field. +func (o *LLMObsIntegrationInferenceRequest) SetMaxTokens(v int64) { + o.MaxTokens.Set(&v) +} + +// SetMaxTokensNil sets the value for MaxTokens to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetMaxTokensNil() { + o.MaxTokens.Set(nil) +} + +// UnsetMaxTokens ensures that no value is present for MaxTokens, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetMaxTokens() { + o.MaxTokens.Unset() +} + +// GetMessages returns the Messages field value. +func (o *LLMObsIntegrationInferenceRequest) GetMessages() []LLMObsInferenceMessage { + if o == nil { + var ret []LLMObsInferenceMessage + return ret + } + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetMessagesOk() (*[]LLMObsInferenceMessage, bool) { + if o == nil { + return nil, false + } + return &o.Messages, true +} + +// SetMessages sets field value. +func (o *LLMObsIntegrationInferenceRequest) SetMessages(v []LLMObsInferenceMessage) { + o.Messages = v +} + +// GetModelId returns the ModelId field value. +func (o *LLMObsIntegrationInferenceRequest) GetModelId() string { + if o == nil { + var ret string + return ret + } + return o.ModelId +} + +// GetModelIdOk returns a tuple with the ModelId field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetModelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelId, true +} + +// SetModelId sets field value. +func (o *LLMObsIntegrationInferenceRequest) SetModelId(v string) { + o.ModelId = v +} + +// GetOpenaiMetadata returns the OpenaiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetOpenaiMetadata() LLMObsOpenAIMetadata { + if o == nil || o.OpenaiMetadata == nil { + var ret LLMObsOpenAIMetadata + return ret + } + return *o.OpenaiMetadata +} + +// GetOpenaiMetadataOk returns a tuple with the OpenaiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetOpenaiMetadataOk() (*LLMObsOpenAIMetadata, bool) { + if o == nil || o.OpenaiMetadata == nil { + return nil, false + } + return o.OpenaiMetadata, true +} + +// HasOpenaiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasOpenaiMetadata() bool { + return o != nil && o.OpenaiMetadata != nil +} + +// SetOpenaiMetadata gets a reference to the given LLMObsOpenAIMetadata and assigns it to the OpenaiMetadata field. +func (o *LLMObsIntegrationInferenceRequest) SetOpenaiMetadata(v LLMObsOpenAIMetadata) { + o.OpenaiMetadata = &v +} + +// GetPresencePenalty returns the PresencePenalty field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetPresencePenalty() float64 { + if o == nil || o.PresencePenalty.Get() == nil { + var ret float64 + return ret + } + return *o.PresencePenalty.Get() +} + +// GetPresencePenaltyOk returns a tuple with the PresencePenalty field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetPresencePenaltyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.PresencePenalty.Get(), o.PresencePenalty.IsSet() +} + +// HasPresencePenalty returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasPresencePenalty() bool { + return o != nil && o.PresencePenalty.IsSet() +} + +// SetPresencePenalty gets a reference to the given datadog.NullableFloat64 and assigns it to the PresencePenalty field. +func (o *LLMObsIntegrationInferenceRequest) SetPresencePenalty(v float64) { + o.PresencePenalty.Set(&v) +} + +// SetPresencePenaltyNil sets the value for PresencePenalty to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetPresencePenaltyNil() { + o.PresencePenalty.Set(nil) +} + +// UnsetPresencePenalty ensures that no value is present for PresencePenalty, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetPresencePenalty() { + o.PresencePenalty.Unset() +} + +// GetTemperature returns the Temperature field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetTemperature() float64 { + if o == nil || o.Temperature.Get() == nil { + var ret float64 + return ret + } + return *o.Temperature.Get() +} + +// GetTemperatureOk returns a tuple with the Temperature field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetTemperatureOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Temperature.Get(), o.Temperature.IsSet() +} + +// HasTemperature returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasTemperature() bool { + return o != nil && o.Temperature.IsSet() +} + +// SetTemperature gets a reference to the given datadog.NullableFloat64 and assigns it to the Temperature field. +func (o *LLMObsIntegrationInferenceRequest) SetTemperature(v float64) { + o.Temperature.Set(&v) +} + +// SetTemperatureNil sets the value for Temperature to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetTemperatureNil() { + o.Temperature.Set(nil) +} + +// UnsetTemperature ensures that no value is present for Temperature, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetTemperature() { + o.Temperature.Unset() +} + +// GetTools returns the Tools field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetTools() []LLMObsInferenceTool { + if o == nil || o.Tools == nil { + var ret []LLMObsInferenceTool + return ret + } + return o.Tools +} + +// GetToolsOk returns a tuple with the Tools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetToolsOk() (*[]LLMObsInferenceTool, bool) { + if o == nil || o.Tools == nil { + return nil, false + } + return &o.Tools, true +} + +// HasTools returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasTools() bool { + return o != nil && o.Tools != nil +} + +// SetTools gets a reference to the given []LLMObsInferenceTool and assigns it to the Tools field. +func (o *LLMObsIntegrationInferenceRequest) SetTools(v []LLMObsInferenceTool) { + o.Tools = v +} + +// GetTopK returns the TopK field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetTopK() int64 { + if o == nil || o.TopK.Get() == nil { + var ret int64 + return ret + } + return *o.TopK.Get() +} + +// GetTopKOk returns a tuple with the TopK field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetTopKOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TopK.Get(), o.TopK.IsSet() +} + +// HasTopK returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasTopK() bool { + return o != nil && o.TopK.IsSet() +} + +// SetTopK gets a reference to the given datadog.NullableInt64 and assigns it to the TopK field. +func (o *LLMObsIntegrationInferenceRequest) SetTopK(v int64) { + o.TopK.Set(&v) +} + +// SetTopKNil sets the value for TopK to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetTopKNil() { + o.TopK.Set(nil) +} + +// UnsetTopK ensures that no value is present for TopK, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetTopK() { + o.TopK.Unset() +} + +// GetTopP returns the TopP field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceRequest) GetTopP() float64 { + if o == nil || o.TopP.Get() == nil { + var ret float64 + return ret + } + return *o.TopP.Get() +} + +// GetTopPOk returns a tuple with the TopP field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceRequest) GetTopPOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.TopP.Get(), o.TopP.IsSet() +} + +// HasTopP returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasTopP() bool { + return o != nil && o.TopP.IsSet() +} + +// SetTopP gets a reference to the given datadog.NullableFloat64 and assigns it to the TopP field. +func (o *LLMObsIntegrationInferenceRequest) SetTopP(v float64) { + o.TopP.Set(&v) +} + +// SetTopPNil sets the value for TopP to be an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) SetTopPNil() { + o.TopP.Set(nil) +} + +// UnsetTopP ensures that no value is present for TopP, not even an explicit nil. +func (o *LLMObsIntegrationInferenceRequest) UnsetTopP() { + o.TopP.Unset() +} + +// GetVertexAiMetadata returns the VertexAiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceRequest) GetVertexAiMetadata() LLMObsVertexAIMetadata { + if o == nil || o.VertexAiMetadata == nil { + var ret LLMObsVertexAIMetadata + return ret + } + return *o.VertexAiMetadata +} + +// GetVertexAiMetadataOk returns a tuple with the VertexAiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceRequest) GetVertexAiMetadataOk() (*LLMObsVertexAIMetadata, bool) { + if o == nil || o.VertexAiMetadata == nil { + return nil, false + } + return o.VertexAiMetadata, true +} + +// HasVertexAiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceRequest) HasVertexAiMetadata() bool { + return o != nil && o.VertexAiMetadata != nil +} + +// SetVertexAiMetadata gets a reference to the given LLMObsVertexAIMetadata and assigns it to the VertexAiMetadata field. +func (o *LLMObsIntegrationInferenceRequest) SetVertexAiMetadata(v LLMObsVertexAIMetadata) { + o.VertexAiMetadata = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsIntegrationInferenceRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AnthropicMetadata != nil { + toSerialize["anthropic_metadata"] = o.AnthropicMetadata + } + if o.AzureOpenaiMetadata != nil { + toSerialize["azure_openai_metadata"] = o.AzureOpenaiMetadata + } + if o.BedrockMetadata != nil { + toSerialize["bedrock_metadata"] = o.BedrockMetadata + } + if o.FrequencyPenalty.IsSet() { + toSerialize["frequency_penalty"] = o.FrequencyPenalty.Get() + } + if o.JsonSchema.IsSet() { + toSerialize["json_schema"] = o.JsonSchema.Get() + } + if o.MaxCompletionTokens.IsSet() { + toSerialize["max_completion_tokens"] = o.MaxCompletionTokens.Get() + } + if o.MaxTokens.IsSet() { + toSerialize["max_tokens"] = o.MaxTokens.Get() + } + toSerialize["messages"] = o.Messages + toSerialize["model_id"] = o.ModelId + if o.OpenaiMetadata != nil { + toSerialize["openai_metadata"] = o.OpenaiMetadata + } + if o.PresencePenalty.IsSet() { + toSerialize["presence_penalty"] = o.PresencePenalty.Get() + } + if o.Temperature.IsSet() { + toSerialize["temperature"] = o.Temperature.Get() + } + if o.Tools != nil { + toSerialize["tools"] = o.Tools + } + if o.TopK.IsSet() { + toSerialize["top_k"] = o.TopK.Get() + } + if o.TopP.IsSet() { + toSerialize["top_p"] = o.TopP.Get() + } + if o.VertexAiMetadata != nil { + toSerialize["vertex_ai_metadata"] = o.VertexAiMetadata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsIntegrationInferenceRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AnthropicMetadata *LLMObsAnthropicMetadata `json:"anthropic_metadata,omitempty"` + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + BedrockMetadata *LLMObsBedrockMetadata `json:"bedrock_metadata,omitempty"` + FrequencyPenalty datadog.NullableFloat64 `json:"frequency_penalty,omitempty"` + JsonSchema datadog.NullableString `json:"json_schema,omitempty"` + MaxCompletionTokens datadog.NullableInt64 `json:"max_completion_tokens,omitempty"` + MaxTokens datadog.NullableInt64 `json:"max_tokens,omitempty"` + Messages *[]LLMObsInferenceMessage `json:"messages"` + ModelId *string `json:"model_id"` + OpenaiMetadata *LLMObsOpenAIMetadata `json:"openai_metadata,omitempty"` + PresencePenalty datadog.NullableFloat64 `json:"presence_penalty,omitempty"` + Temperature datadog.NullableFloat64 `json:"temperature,omitempty"` + Tools []LLMObsInferenceTool `json:"tools,omitempty"` + TopK datadog.NullableInt64 `json:"top_k,omitempty"` + TopP datadog.NullableFloat64 `json:"top_p,omitempty"` + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Messages == nil { + return fmt.Errorf("required field messages missing") + } + if all.ModelId == nil { + return fmt.Errorf("required field model_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"anthropic_metadata", "azure_openai_metadata", "bedrock_metadata", "frequency_penalty", "json_schema", "max_completion_tokens", "max_tokens", "messages", "model_id", "openai_metadata", "presence_penalty", "temperature", "tools", "top_k", "top_p", "vertex_ai_metadata"}) + } else { + return err + } + + hasInvalidField := false + if all.AnthropicMetadata != nil && all.AnthropicMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AnthropicMetadata = all.AnthropicMetadata + if all.AzureOpenaiMetadata != nil && all.AzureOpenaiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AzureOpenaiMetadata = all.AzureOpenaiMetadata + if all.BedrockMetadata != nil && all.BedrockMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BedrockMetadata = all.BedrockMetadata + o.FrequencyPenalty = all.FrequencyPenalty + o.JsonSchema = all.JsonSchema + o.MaxCompletionTokens = all.MaxCompletionTokens + o.MaxTokens = all.MaxTokens + o.Messages = *all.Messages + o.ModelId = *all.ModelId + if all.OpenaiMetadata != nil && all.OpenaiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.OpenaiMetadata = all.OpenaiMetadata + o.PresencePenalty = all.PresencePenalty + o.Temperature = all.Temperature + o.Tools = all.Tools + o.TopK = all.TopK + o.TopP = all.TopP + if all.VertexAiMetadata != nil && all.VertexAiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.VertexAiMetadata = all.VertexAiMetadata + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_integration_inference_response.go b/api/datadogV2/model_llm_obs_integration_inference_response.go new file mode 100644 index 00000000000..d51b46c52c7 --- /dev/null +++ b/api/datadogV2/model_llm_obs_integration_inference_response.go @@ -0,0 +1,805 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsIntegrationInferenceResponse The result of an LLM inference request, including input parameters and the model response. +type LLMObsIntegrationInferenceResponse struct { + // Anthropic-specific metadata for an inference request. + AnthropicMetadata *LLMObsAnthropicMetadata `json:"anthropic_metadata,omitempty"` + // Azure OpenAI-specific metadata for an integration account or inference request. + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + // Amazon Bedrock-specific metadata for an inference request. + BedrockMetadata *LLMObsBedrockMetadata `json:"bedrock_metadata,omitempty"` + // Error details returned when an inference provider returns an error. + ErrorResponse *LLMObsInferenceErrorResponse `json:"error_response,omitempty"` + // Frequency penalty that was applied. + FrequencyPenalty datadog.NullableFloat64 `json:"frequency_penalty,omitempty"` + // JSON schema that was applied for structured output. + JsonSchema datadog.NullableString `json:"json_schema,omitempty"` + // Maximum number of completion tokens that were configured. + MaxCompletionTokens datadog.NullableInt64 `json:"max_completion_tokens,omitempty"` + // Maximum number of tokens that were configured. + MaxTokens datadog.NullableInt64 `json:"max_tokens,omitempty"` + // List of messages in an inference conversation. + Messages []LLMObsInferenceMessage `json:"messages"` + // The model identifier used for inference. + ModelId string `json:"model_id"` + // OpenAI-specific metadata for an inference request. + OpenaiMetadata *LLMObsOpenAIMetadata `json:"openai_metadata,omitempty"` + // Presence penalty that was applied. + PresencePenalty datadog.NullableFloat64 `json:"presence_penalty,omitempty"` + // The output of a completed LLM inference call. + Response LLMObsInferenceRunResult `json:"response"` + // Sampling temperature that was used. + Temperature datadog.NullableFloat64 `json:"temperature,omitempty"` + // List of tools available to the model. + Tools []LLMObsInferenceTool `json:"tools,omitempty"` + // Top-K sampling parameter that was used. + TopK datadog.NullableInt64 `json:"top_k,omitempty"` + // Nucleus sampling parameter that was used. + TopP datadog.NullableFloat64 `json:"top_p,omitempty"` + // Vertex AI-specific metadata for an integration account or inference request. + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsIntegrationInferenceResponse instantiates a new LLMObsIntegrationInferenceResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsIntegrationInferenceResponse(messages []LLMObsInferenceMessage, modelId string, response LLMObsInferenceRunResult) *LLMObsIntegrationInferenceResponse { + this := LLMObsIntegrationInferenceResponse{} + this.Messages = messages + this.ModelId = modelId + this.Response = response + return &this +} + +// NewLLMObsIntegrationInferenceResponseWithDefaults instantiates a new LLMObsIntegrationInferenceResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsIntegrationInferenceResponseWithDefaults() *LLMObsIntegrationInferenceResponse { + this := LLMObsIntegrationInferenceResponse{} + return &this +} + +// GetAnthropicMetadata returns the AnthropicMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetAnthropicMetadata() LLMObsAnthropicMetadata { + if o == nil || o.AnthropicMetadata == nil { + var ret LLMObsAnthropicMetadata + return ret + } + return *o.AnthropicMetadata +} + +// GetAnthropicMetadataOk returns a tuple with the AnthropicMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetAnthropicMetadataOk() (*LLMObsAnthropicMetadata, bool) { + if o == nil || o.AnthropicMetadata == nil { + return nil, false + } + return o.AnthropicMetadata, true +} + +// HasAnthropicMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasAnthropicMetadata() bool { + return o != nil && o.AnthropicMetadata != nil +} + +// SetAnthropicMetadata gets a reference to the given LLMObsAnthropicMetadata and assigns it to the AnthropicMetadata field. +func (o *LLMObsIntegrationInferenceResponse) SetAnthropicMetadata(v LLMObsAnthropicMetadata) { + o.AnthropicMetadata = &v +} + +// GetAzureOpenaiMetadata returns the AzureOpenaiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetAzureOpenaiMetadata() LLMObsAzureOpenAIMetadata { + if o == nil || o.AzureOpenaiMetadata == nil { + var ret LLMObsAzureOpenAIMetadata + return ret + } + return *o.AzureOpenaiMetadata +} + +// GetAzureOpenaiMetadataOk returns a tuple with the AzureOpenaiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetAzureOpenaiMetadataOk() (*LLMObsAzureOpenAIMetadata, bool) { + if o == nil || o.AzureOpenaiMetadata == nil { + return nil, false + } + return o.AzureOpenaiMetadata, true +} + +// HasAzureOpenaiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasAzureOpenaiMetadata() bool { + return o != nil && o.AzureOpenaiMetadata != nil +} + +// SetAzureOpenaiMetadata gets a reference to the given LLMObsAzureOpenAIMetadata and assigns it to the AzureOpenaiMetadata field. +func (o *LLMObsIntegrationInferenceResponse) SetAzureOpenaiMetadata(v LLMObsAzureOpenAIMetadata) { + o.AzureOpenaiMetadata = &v +} + +// GetBedrockMetadata returns the BedrockMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetBedrockMetadata() LLMObsBedrockMetadata { + if o == nil || o.BedrockMetadata == nil { + var ret LLMObsBedrockMetadata + return ret + } + return *o.BedrockMetadata +} + +// GetBedrockMetadataOk returns a tuple with the BedrockMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetBedrockMetadataOk() (*LLMObsBedrockMetadata, bool) { + if o == nil || o.BedrockMetadata == nil { + return nil, false + } + return o.BedrockMetadata, true +} + +// HasBedrockMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasBedrockMetadata() bool { + return o != nil && o.BedrockMetadata != nil +} + +// SetBedrockMetadata gets a reference to the given LLMObsBedrockMetadata and assigns it to the BedrockMetadata field. +func (o *LLMObsIntegrationInferenceResponse) SetBedrockMetadata(v LLMObsBedrockMetadata) { + o.BedrockMetadata = &v +} + +// GetErrorResponse returns the ErrorResponse field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetErrorResponse() LLMObsInferenceErrorResponse { + if o == nil || o.ErrorResponse == nil { + var ret LLMObsInferenceErrorResponse + return ret + } + return *o.ErrorResponse +} + +// GetErrorResponseOk returns a tuple with the ErrorResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetErrorResponseOk() (*LLMObsInferenceErrorResponse, bool) { + if o == nil || o.ErrorResponse == nil { + return nil, false + } + return o.ErrorResponse, true +} + +// HasErrorResponse returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasErrorResponse() bool { + return o != nil && o.ErrorResponse != nil +} + +// SetErrorResponse gets a reference to the given LLMObsInferenceErrorResponse and assigns it to the ErrorResponse field. +func (o *LLMObsIntegrationInferenceResponse) SetErrorResponse(v LLMObsInferenceErrorResponse) { + o.ErrorResponse = &v +} + +// GetFrequencyPenalty returns the FrequencyPenalty field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetFrequencyPenalty() float64 { + if o == nil || o.FrequencyPenalty.Get() == nil { + var ret float64 + return ret + } + return *o.FrequencyPenalty.Get() +} + +// GetFrequencyPenaltyOk returns a tuple with the FrequencyPenalty field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetFrequencyPenaltyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.FrequencyPenalty.Get(), o.FrequencyPenalty.IsSet() +} + +// HasFrequencyPenalty returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasFrequencyPenalty() bool { + return o != nil && o.FrequencyPenalty.IsSet() +} + +// SetFrequencyPenalty gets a reference to the given datadog.NullableFloat64 and assigns it to the FrequencyPenalty field. +func (o *LLMObsIntegrationInferenceResponse) SetFrequencyPenalty(v float64) { + o.FrequencyPenalty.Set(&v) +} + +// SetFrequencyPenaltyNil sets the value for FrequencyPenalty to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetFrequencyPenaltyNil() { + o.FrequencyPenalty.Set(nil) +} + +// UnsetFrequencyPenalty ensures that no value is present for FrequencyPenalty, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetFrequencyPenalty() { + o.FrequencyPenalty.Unset() +} + +// GetJsonSchema returns the JsonSchema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetJsonSchema() string { + if o == nil || o.JsonSchema.Get() == nil { + var ret string + return ret + } + return *o.JsonSchema.Get() +} + +// GetJsonSchemaOk returns a tuple with the JsonSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetJsonSchemaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.JsonSchema.Get(), o.JsonSchema.IsSet() +} + +// HasJsonSchema returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasJsonSchema() bool { + return o != nil && o.JsonSchema.IsSet() +} + +// SetJsonSchema gets a reference to the given datadog.NullableString and assigns it to the JsonSchema field. +func (o *LLMObsIntegrationInferenceResponse) SetJsonSchema(v string) { + o.JsonSchema.Set(&v) +} + +// SetJsonSchemaNil sets the value for JsonSchema to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetJsonSchemaNil() { + o.JsonSchema.Set(nil) +} + +// UnsetJsonSchema ensures that no value is present for JsonSchema, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetJsonSchema() { + o.JsonSchema.Unset() +} + +// GetMaxCompletionTokens returns the MaxCompletionTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetMaxCompletionTokens() int64 { + if o == nil || o.MaxCompletionTokens.Get() == nil { + var ret int64 + return ret + } + return *o.MaxCompletionTokens.Get() +} + +// GetMaxCompletionTokensOk returns a tuple with the MaxCompletionTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetMaxCompletionTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MaxCompletionTokens.Get(), o.MaxCompletionTokens.IsSet() +} + +// HasMaxCompletionTokens returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasMaxCompletionTokens() bool { + return o != nil && o.MaxCompletionTokens.IsSet() +} + +// SetMaxCompletionTokens gets a reference to the given datadog.NullableInt64 and assigns it to the MaxCompletionTokens field. +func (o *LLMObsIntegrationInferenceResponse) SetMaxCompletionTokens(v int64) { + o.MaxCompletionTokens.Set(&v) +} + +// SetMaxCompletionTokensNil sets the value for MaxCompletionTokens to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetMaxCompletionTokensNil() { + o.MaxCompletionTokens.Set(nil) +} + +// UnsetMaxCompletionTokens ensures that no value is present for MaxCompletionTokens, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetMaxCompletionTokens() { + o.MaxCompletionTokens.Unset() +} + +// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetMaxTokens() int64 { + if o == nil || o.MaxTokens.Get() == nil { + var ret int64 + return ret + } + return *o.MaxTokens.Get() +} + +// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetMaxTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MaxTokens.Get(), o.MaxTokens.IsSet() +} + +// HasMaxTokens returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasMaxTokens() bool { + return o != nil && o.MaxTokens.IsSet() +} + +// SetMaxTokens gets a reference to the given datadog.NullableInt64 and assigns it to the MaxTokens field. +func (o *LLMObsIntegrationInferenceResponse) SetMaxTokens(v int64) { + o.MaxTokens.Set(&v) +} + +// SetMaxTokensNil sets the value for MaxTokens to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetMaxTokensNil() { + o.MaxTokens.Set(nil) +} + +// UnsetMaxTokens ensures that no value is present for MaxTokens, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetMaxTokens() { + o.MaxTokens.Unset() +} + +// GetMessages returns the Messages field value. +func (o *LLMObsIntegrationInferenceResponse) GetMessages() []LLMObsInferenceMessage { + if o == nil { + var ret []LLMObsInferenceMessage + return ret + } + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetMessagesOk() (*[]LLMObsInferenceMessage, bool) { + if o == nil { + return nil, false + } + return &o.Messages, true +} + +// SetMessages sets field value. +func (o *LLMObsIntegrationInferenceResponse) SetMessages(v []LLMObsInferenceMessage) { + o.Messages = v +} + +// GetModelId returns the ModelId field value. +func (o *LLMObsIntegrationInferenceResponse) GetModelId() string { + if o == nil { + var ret string + return ret + } + return o.ModelId +} + +// GetModelIdOk returns a tuple with the ModelId field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetModelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelId, true +} + +// SetModelId sets field value. +func (o *LLMObsIntegrationInferenceResponse) SetModelId(v string) { + o.ModelId = v +} + +// GetOpenaiMetadata returns the OpenaiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetOpenaiMetadata() LLMObsOpenAIMetadata { + if o == nil || o.OpenaiMetadata == nil { + var ret LLMObsOpenAIMetadata + return ret + } + return *o.OpenaiMetadata +} + +// GetOpenaiMetadataOk returns a tuple with the OpenaiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetOpenaiMetadataOk() (*LLMObsOpenAIMetadata, bool) { + if o == nil || o.OpenaiMetadata == nil { + return nil, false + } + return o.OpenaiMetadata, true +} + +// HasOpenaiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasOpenaiMetadata() bool { + return o != nil && o.OpenaiMetadata != nil +} + +// SetOpenaiMetadata gets a reference to the given LLMObsOpenAIMetadata and assigns it to the OpenaiMetadata field. +func (o *LLMObsIntegrationInferenceResponse) SetOpenaiMetadata(v LLMObsOpenAIMetadata) { + o.OpenaiMetadata = &v +} + +// GetPresencePenalty returns the PresencePenalty field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetPresencePenalty() float64 { + if o == nil || o.PresencePenalty.Get() == nil { + var ret float64 + return ret + } + return *o.PresencePenalty.Get() +} + +// GetPresencePenaltyOk returns a tuple with the PresencePenalty field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetPresencePenaltyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.PresencePenalty.Get(), o.PresencePenalty.IsSet() +} + +// HasPresencePenalty returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasPresencePenalty() bool { + return o != nil && o.PresencePenalty.IsSet() +} + +// SetPresencePenalty gets a reference to the given datadog.NullableFloat64 and assigns it to the PresencePenalty field. +func (o *LLMObsIntegrationInferenceResponse) SetPresencePenalty(v float64) { + o.PresencePenalty.Set(&v) +} + +// SetPresencePenaltyNil sets the value for PresencePenalty to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetPresencePenaltyNil() { + o.PresencePenalty.Set(nil) +} + +// UnsetPresencePenalty ensures that no value is present for PresencePenalty, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetPresencePenalty() { + o.PresencePenalty.Unset() +} + +// GetResponse returns the Response field value. +func (o *LLMObsIntegrationInferenceResponse) GetResponse() LLMObsInferenceRunResult { + if o == nil { + var ret LLMObsInferenceRunResult + return ret + } + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetResponseOk() (*LLMObsInferenceRunResult, bool) { + if o == nil { + return nil, false + } + return &o.Response, true +} + +// SetResponse sets field value. +func (o *LLMObsIntegrationInferenceResponse) SetResponse(v LLMObsInferenceRunResult) { + o.Response = v +} + +// GetTemperature returns the Temperature field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetTemperature() float64 { + if o == nil || o.Temperature.Get() == nil { + var ret float64 + return ret + } + return *o.Temperature.Get() +} + +// GetTemperatureOk returns a tuple with the Temperature field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetTemperatureOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Temperature.Get(), o.Temperature.IsSet() +} + +// HasTemperature returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasTemperature() bool { + return o != nil && o.Temperature.IsSet() +} + +// SetTemperature gets a reference to the given datadog.NullableFloat64 and assigns it to the Temperature field. +func (o *LLMObsIntegrationInferenceResponse) SetTemperature(v float64) { + o.Temperature.Set(&v) +} + +// SetTemperatureNil sets the value for Temperature to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetTemperatureNil() { + o.Temperature.Set(nil) +} + +// UnsetTemperature ensures that no value is present for Temperature, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetTemperature() { + o.Temperature.Unset() +} + +// GetTools returns the Tools field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetTools() []LLMObsInferenceTool { + if o == nil || o.Tools == nil { + var ret []LLMObsInferenceTool + return ret + } + return o.Tools +} + +// GetToolsOk returns a tuple with the Tools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetToolsOk() (*[]LLMObsInferenceTool, bool) { + if o == nil || o.Tools == nil { + return nil, false + } + return &o.Tools, true +} + +// HasTools returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasTools() bool { + return o != nil && o.Tools != nil +} + +// SetTools gets a reference to the given []LLMObsInferenceTool and assigns it to the Tools field. +func (o *LLMObsIntegrationInferenceResponse) SetTools(v []LLMObsInferenceTool) { + o.Tools = v +} + +// GetTopK returns the TopK field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetTopK() int64 { + if o == nil || o.TopK.Get() == nil { + var ret int64 + return ret + } + return *o.TopK.Get() +} + +// GetTopKOk returns a tuple with the TopK field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetTopKOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TopK.Get(), o.TopK.IsSet() +} + +// HasTopK returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasTopK() bool { + return o != nil && o.TopK.IsSet() +} + +// SetTopK gets a reference to the given datadog.NullableInt64 and assigns it to the TopK field. +func (o *LLMObsIntegrationInferenceResponse) SetTopK(v int64) { + o.TopK.Set(&v) +} + +// SetTopKNil sets the value for TopK to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetTopKNil() { + o.TopK.Set(nil) +} + +// UnsetTopK ensures that no value is present for TopK, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetTopK() { + o.TopK.Unset() +} + +// GetTopP returns the TopP field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsIntegrationInferenceResponse) GetTopP() float64 { + if o == nil || o.TopP.Get() == nil { + var ret float64 + return ret + } + return *o.TopP.Get() +} + +// GetTopPOk returns a tuple with the TopP field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsIntegrationInferenceResponse) GetTopPOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.TopP.Get(), o.TopP.IsSet() +} + +// HasTopP returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasTopP() bool { + return o != nil && o.TopP.IsSet() +} + +// SetTopP gets a reference to the given datadog.NullableFloat64 and assigns it to the TopP field. +func (o *LLMObsIntegrationInferenceResponse) SetTopP(v float64) { + o.TopP.Set(&v) +} + +// SetTopPNil sets the value for TopP to be an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) SetTopPNil() { + o.TopP.Set(nil) +} + +// UnsetTopP ensures that no value is present for TopP, not even an explicit nil. +func (o *LLMObsIntegrationInferenceResponse) UnsetTopP() { + o.TopP.Unset() +} + +// GetVertexAiMetadata returns the VertexAiMetadata field value if set, zero value otherwise. +func (o *LLMObsIntegrationInferenceResponse) GetVertexAiMetadata() LLMObsVertexAIMetadata { + if o == nil || o.VertexAiMetadata == nil { + var ret LLMObsVertexAIMetadata + return ret + } + return *o.VertexAiMetadata +} + +// GetVertexAiMetadataOk returns a tuple with the VertexAiMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationInferenceResponse) GetVertexAiMetadataOk() (*LLMObsVertexAIMetadata, bool) { + if o == nil || o.VertexAiMetadata == nil { + return nil, false + } + return o.VertexAiMetadata, true +} + +// HasVertexAiMetadata returns a boolean if a field has been set. +func (o *LLMObsIntegrationInferenceResponse) HasVertexAiMetadata() bool { + return o != nil && o.VertexAiMetadata != nil +} + +// SetVertexAiMetadata gets a reference to the given LLMObsVertexAIMetadata and assigns it to the VertexAiMetadata field. +func (o *LLMObsIntegrationInferenceResponse) SetVertexAiMetadata(v LLMObsVertexAIMetadata) { + o.VertexAiMetadata = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsIntegrationInferenceResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AnthropicMetadata != nil { + toSerialize["anthropic_metadata"] = o.AnthropicMetadata + } + if o.AzureOpenaiMetadata != nil { + toSerialize["azure_openai_metadata"] = o.AzureOpenaiMetadata + } + if o.BedrockMetadata != nil { + toSerialize["bedrock_metadata"] = o.BedrockMetadata + } + if o.ErrorResponse != nil { + toSerialize["error_response"] = o.ErrorResponse + } + if o.FrequencyPenalty.IsSet() { + toSerialize["frequency_penalty"] = o.FrequencyPenalty.Get() + } + if o.JsonSchema.IsSet() { + toSerialize["json_schema"] = o.JsonSchema.Get() + } + if o.MaxCompletionTokens.IsSet() { + toSerialize["max_completion_tokens"] = o.MaxCompletionTokens.Get() + } + if o.MaxTokens.IsSet() { + toSerialize["max_tokens"] = o.MaxTokens.Get() + } + toSerialize["messages"] = o.Messages + toSerialize["model_id"] = o.ModelId + if o.OpenaiMetadata != nil { + toSerialize["openai_metadata"] = o.OpenaiMetadata + } + if o.PresencePenalty.IsSet() { + toSerialize["presence_penalty"] = o.PresencePenalty.Get() + } + toSerialize["response"] = o.Response + if o.Temperature.IsSet() { + toSerialize["temperature"] = o.Temperature.Get() + } + if o.Tools != nil { + toSerialize["tools"] = o.Tools + } + if o.TopK.IsSet() { + toSerialize["top_k"] = o.TopK.Get() + } + if o.TopP.IsSet() { + toSerialize["top_p"] = o.TopP.Get() + } + if o.VertexAiMetadata != nil { + toSerialize["vertex_ai_metadata"] = o.VertexAiMetadata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsIntegrationInferenceResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AnthropicMetadata *LLMObsAnthropicMetadata `json:"anthropic_metadata,omitempty"` + AzureOpenaiMetadata *LLMObsAzureOpenAIMetadata `json:"azure_openai_metadata,omitempty"` + BedrockMetadata *LLMObsBedrockMetadata `json:"bedrock_metadata,omitempty"` + ErrorResponse *LLMObsInferenceErrorResponse `json:"error_response,omitempty"` + FrequencyPenalty datadog.NullableFloat64 `json:"frequency_penalty,omitempty"` + JsonSchema datadog.NullableString `json:"json_schema,omitempty"` + MaxCompletionTokens datadog.NullableInt64 `json:"max_completion_tokens,omitempty"` + MaxTokens datadog.NullableInt64 `json:"max_tokens,omitempty"` + Messages *[]LLMObsInferenceMessage `json:"messages"` + ModelId *string `json:"model_id"` + OpenaiMetadata *LLMObsOpenAIMetadata `json:"openai_metadata,omitempty"` + PresencePenalty datadog.NullableFloat64 `json:"presence_penalty,omitempty"` + Response *LLMObsInferenceRunResult `json:"response"` + Temperature datadog.NullableFloat64 `json:"temperature,omitempty"` + Tools []LLMObsInferenceTool `json:"tools,omitempty"` + TopK datadog.NullableInt64 `json:"top_k,omitempty"` + TopP datadog.NullableFloat64 `json:"top_p,omitempty"` + VertexAiMetadata *LLMObsVertexAIMetadata `json:"vertex_ai_metadata,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Messages == nil { + return fmt.Errorf("required field messages missing") + } + if all.ModelId == nil { + return fmt.Errorf("required field model_id missing") + } + if all.Response == nil { + return fmt.Errorf("required field response missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"anthropic_metadata", "azure_openai_metadata", "bedrock_metadata", "error_response", "frequency_penalty", "json_schema", "max_completion_tokens", "max_tokens", "messages", "model_id", "openai_metadata", "presence_penalty", "response", "temperature", "tools", "top_k", "top_p", "vertex_ai_metadata"}) + } else { + return err + } + + hasInvalidField := false + if all.AnthropicMetadata != nil && all.AnthropicMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AnthropicMetadata = all.AnthropicMetadata + if all.AzureOpenaiMetadata != nil && all.AzureOpenaiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AzureOpenaiMetadata = all.AzureOpenaiMetadata + if all.BedrockMetadata != nil && all.BedrockMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BedrockMetadata = all.BedrockMetadata + if all.ErrorResponse != nil && all.ErrorResponse.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ErrorResponse = all.ErrorResponse + o.FrequencyPenalty = all.FrequencyPenalty + o.JsonSchema = all.JsonSchema + o.MaxCompletionTokens = all.MaxCompletionTokens + o.MaxTokens = all.MaxTokens + o.Messages = *all.Messages + o.ModelId = *all.ModelId + if all.OpenaiMetadata != nil && all.OpenaiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.OpenaiMetadata = all.OpenaiMetadata + o.PresencePenalty = all.PresencePenalty + if all.Response.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Response = *all.Response + o.Temperature = all.Temperature + o.Tools = all.Tools + o.TopK = all.TopK + o.TopP = all.TopP + if all.VertexAiMetadata != nil && all.VertexAiMetadata.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.VertexAiMetadata = all.VertexAiMetadata + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_integration_model.go b/api/datadogV2/model_llm_obs_integration_model.go new file mode 100644 index 00000000000..b0c72fe8564 --- /dev/null +++ b/api/datadogV2/model_llm_obs_integration_model.go @@ -0,0 +1,392 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsIntegrationModel A model available for a given LLM provider integration and account. +type LLMObsIntegrationModel struct { + // Whether the account has access to this model. + HasAccess bool `json:"has_access"` + // Unique identifier for the model entry. + Id string `json:"id"` + // The name of the LLM provider integration. + Integration string `json:"integration"` + // Human-readable name of the LLM provider integration. + IntegrationDisplayName string `json:"integration_display_name"` + // Whether the model supports structured output via JSON schema. + JsonSchema bool `json:"json_schema"` + // Human-readable model name. + ModelDisplayName string `json:"model_display_name"` + // Provider-specific model identifier used in inference calls. + ModelId string `json:"model_id"` + // The underlying model provider. + Provider string `json:"provider"` + // Human-readable name of the underlying model provider. + ProviderDisplayName string `json:"provider_display_name"` + // Map of region-specific model ID prefix overrides. + RegionPrefixOverrides map[string]string `json:"region_prefix_overrides,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsIntegrationModel instantiates a new LLMObsIntegrationModel object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsIntegrationModel(hasAccess bool, id string, integration string, integrationDisplayName string, jsonSchema bool, modelDisplayName string, modelId string, provider string, providerDisplayName string) *LLMObsIntegrationModel { + this := LLMObsIntegrationModel{} + this.HasAccess = hasAccess + this.Id = id + this.Integration = integration + this.IntegrationDisplayName = integrationDisplayName + this.JsonSchema = jsonSchema + this.ModelDisplayName = modelDisplayName + this.ModelId = modelId + this.Provider = provider + this.ProviderDisplayName = providerDisplayName + return &this +} + +// NewLLMObsIntegrationModelWithDefaults instantiates a new LLMObsIntegrationModel object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsIntegrationModelWithDefaults() *LLMObsIntegrationModel { + this := LLMObsIntegrationModel{} + return &this +} + +// GetHasAccess returns the HasAccess field value. +func (o *LLMObsIntegrationModel) GetHasAccess() bool { + if o == nil { + var ret bool + return ret + } + return o.HasAccess +} + +// GetHasAccessOk returns a tuple with the HasAccess field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetHasAccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasAccess, true +} + +// SetHasAccess sets field value. +func (o *LLMObsIntegrationModel) SetHasAccess(v bool) { + o.HasAccess = v +} + +// GetId returns the Id field value. +func (o *LLMObsIntegrationModel) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsIntegrationModel) SetId(v string) { + o.Id = v +} + +// GetIntegration returns the Integration field value. +func (o *LLMObsIntegrationModel) GetIntegration() string { + if o == nil { + var ret string + return ret + } + return o.Integration +} + +// GetIntegrationOk returns a tuple with the Integration field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetIntegrationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Integration, true +} + +// SetIntegration sets field value. +func (o *LLMObsIntegrationModel) SetIntegration(v string) { + o.Integration = v +} + +// GetIntegrationDisplayName returns the IntegrationDisplayName field value. +func (o *LLMObsIntegrationModel) GetIntegrationDisplayName() string { + if o == nil { + var ret string + return ret + } + return o.IntegrationDisplayName +} + +// GetIntegrationDisplayNameOk returns a tuple with the IntegrationDisplayName field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetIntegrationDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IntegrationDisplayName, true +} + +// SetIntegrationDisplayName sets field value. +func (o *LLMObsIntegrationModel) SetIntegrationDisplayName(v string) { + o.IntegrationDisplayName = v +} + +// GetJsonSchema returns the JsonSchema field value. +func (o *LLMObsIntegrationModel) GetJsonSchema() bool { + if o == nil { + var ret bool + return ret + } + return o.JsonSchema +} + +// GetJsonSchemaOk returns a tuple with the JsonSchema field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetJsonSchemaOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.JsonSchema, true +} + +// SetJsonSchema sets field value. +func (o *LLMObsIntegrationModel) SetJsonSchema(v bool) { + o.JsonSchema = v +} + +// GetModelDisplayName returns the ModelDisplayName field value. +func (o *LLMObsIntegrationModel) GetModelDisplayName() string { + if o == nil { + var ret string + return ret + } + return o.ModelDisplayName +} + +// GetModelDisplayNameOk returns a tuple with the ModelDisplayName field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetModelDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelDisplayName, true +} + +// SetModelDisplayName sets field value. +func (o *LLMObsIntegrationModel) SetModelDisplayName(v string) { + o.ModelDisplayName = v +} + +// GetModelId returns the ModelId field value. +func (o *LLMObsIntegrationModel) GetModelId() string { + if o == nil { + var ret string + return ret + } + return o.ModelId +} + +// GetModelIdOk returns a tuple with the ModelId field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetModelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelId, true +} + +// SetModelId sets field value. +func (o *LLMObsIntegrationModel) SetModelId(v string) { + o.ModelId = v +} + +// GetProvider returns the Provider field value. +func (o *LLMObsIntegrationModel) GetProvider() string { + if o == nil { + var ret string + return ret + } + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetProviderOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value. +func (o *LLMObsIntegrationModel) SetProvider(v string) { + o.Provider = v +} + +// GetProviderDisplayName returns the ProviderDisplayName field value. +func (o *LLMObsIntegrationModel) GetProviderDisplayName() string { + if o == nil { + var ret string + return ret + } + return o.ProviderDisplayName +} + +// GetProviderDisplayNameOk returns a tuple with the ProviderDisplayName field value +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetProviderDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProviderDisplayName, true +} + +// SetProviderDisplayName sets field value. +func (o *LLMObsIntegrationModel) SetProviderDisplayName(v string) { + o.ProviderDisplayName = v +} + +// GetRegionPrefixOverrides returns the RegionPrefixOverrides field value if set, zero value otherwise. +func (o *LLMObsIntegrationModel) GetRegionPrefixOverrides() map[string]string { + if o == nil || o.RegionPrefixOverrides == nil { + var ret map[string]string + return ret + } + return o.RegionPrefixOverrides +} + +// GetRegionPrefixOverridesOk returns a tuple with the RegionPrefixOverrides field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsIntegrationModel) GetRegionPrefixOverridesOk() (*map[string]string, bool) { + if o == nil || o.RegionPrefixOverrides == nil { + return nil, false + } + return &o.RegionPrefixOverrides, true +} + +// HasRegionPrefixOverrides returns a boolean if a field has been set. +func (o *LLMObsIntegrationModel) HasRegionPrefixOverrides() bool { + return o != nil && o.RegionPrefixOverrides != nil +} + +// SetRegionPrefixOverrides gets a reference to the given map[string]string and assigns it to the RegionPrefixOverrides field. +func (o *LLMObsIntegrationModel) SetRegionPrefixOverrides(v map[string]string) { + o.RegionPrefixOverrides = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsIntegrationModel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["has_access"] = o.HasAccess + toSerialize["id"] = o.Id + toSerialize["integration"] = o.Integration + toSerialize["integration_display_name"] = o.IntegrationDisplayName + toSerialize["json_schema"] = o.JsonSchema + toSerialize["model_display_name"] = o.ModelDisplayName + toSerialize["model_id"] = o.ModelId + toSerialize["provider"] = o.Provider + toSerialize["provider_display_name"] = o.ProviderDisplayName + if o.RegionPrefixOverrides != nil { + toSerialize["region_prefix_overrides"] = o.RegionPrefixOverrides + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsIntegrationModel) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + HasAccess *bool `json:"has_access"` + Id *string `json:"id"` + Integration *string `json:"integration"` + IntegrationDisplayName *string `json:"integration_display_name"` + JsonSchema *bool `json:"json_schema"` + ModelDisplayName *string `json:"model_display_name"` + ModelId *string `json:"model_id"` + Provider *string `json:"provider"` + ProviderDisplayName *string `json:"provider_display_name"` + RegionPrefixOverrides map[string]string `json:"region_prefix_overrides,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.HasAccess == nil { + return fmt.Errorf("required field has_access missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Integration == nil { + return fmt.Errorf("required field integration missing") + } + if all.IntegrationDisplayName == nil { + return fmt.Errorf("required field integration_display_name missing") + } + if all.JsonSchema == nil { + return fmt.Errorf("required field json_schema missing") + } + if all.ModelDisplayName == nil { + return fmt.Errorf("required field model_display_name missing") + } + if all.ModelId == nil { + return fmt.Errorf("required field model_id missing") + } + if all.Provider == nil { + return fmt.Errorf("required field provider missing") + } + if all.ProviderDisplayName == nil { + return fmt.Errorf("required field provider_display_name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"has_access", "id", "integration", "integration_display_name", "json_schema", "model_display_name", "model_id", "provider", "provider_display_name", "region_prefix_overrides"}) + } else { + return err + } + o.HasAccess = *all.HasAccess + o.Id = *all.Id + o.Integration = *all.Integration + o.IntegrationDisplayName = *all.IntegrationDisplayName + o.JsonSchema = *all.JsonSchema + o.ModelDisplayName = *all.ModelDisplayName + o.ModelId = *all.ModelId + o.Provider = *all.Provider + o.ProviderDisplayName = *all.ProviderDisplayName + o.RegionPrefixOverrides = all.RegionPrefixOverrides + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_integration_name.go b/api/datadogV2/model_llm_obs_integration_name.go new file mode 100644 index 00000000000..3eede12263d --- /dev/null +++ b/api/datadogV2/model_llm_obs_integration_name.go @@ -0,0 +1,74 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsIntegrationName The name of a supported LLM provider integration. +type LLMObsIntegrationName string + +// List of LLMObsIntegrationName. +const ( + LLMOBSINTEGRATIONNAME_OPENAI LLMObsIntegrationName = "openai" + LLMOBSINTEGRATIONNAME_AMAZON_BEDROCK LLMObsIntegrationName = "amazon_bedrock" + LLMOBSINTEGRATIONNAME_ANTHROPIC LLMObsIntegrationName = "anthropic" + LLMOBSINTEGRATIONNAME_AZURE_OPENAI LLMObsIntegrationName = "azure_openai" + LLMOBSINTEGRATIONNAME_VERTEX_AI LLMObsIntegrationName = "vertex_ai" + LLMOBSINTEGRATIONNAME_LLMPROXY LLMObsIntegrationName = "llmproxy" +) + +var allowedLLMObsIntegrationNameEnumValues = []LLMObsIntegrationName{ + LLMOBSINTEGRATIONNAME_OPENAI, + LLMOBSINTEGRATIONNAME_AMAZON_BEDROCK, + LLMOBSINTEGRATIONNAME_ANTHROPIC, + LLMOBSINTEGRATIONNAME_AZURE_OPENAI, + LLMOBSINTEGRATIONNAME_VERTEX_AI, + LLMOBSINTEGRATIONNAME_LLMPROXY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsIntegrationName) GetAllowedValues() []LLMObsIntegrationName { + return allowedLLMObsIntegrationNameEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsIntegrationName) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsIntegrationName(value) + return nil +} + +// NewLLMObsIntegrationNameFromValue returns a pointer to a valid LLMObsIntegrationName +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsIntegrationNameFromValue(v string) (*LLMObsIntegrationName, error) { + ev := LLMObsIntegrationName(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsIntegrationName: valid values are %v", v, allowedLLMObsIntegrationNameEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsIntegrationName) IsValid() bool { + for _, existing := range allowedLLMObsIntegrationNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsIntegrationName value. +func (v LLMObsIntegrationName) Ptr() *LLMObsIntegrationName { + return &v +} diff --git a/api/datadogV2/model_llm_obs_interaction_type.go b/api/datadogV2/model_llm_obs_interaction_type.go deleted file mode 100644 index f547a346727..00000000000 --- a/api/datadogV2/model_llm_obs_interaction_type.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// LLMObsInteractionType Type of interaction in an annotation queue. -type LLMObsInteractionType string - -// List of LLMObsInteractionType. -const ( - LLMOBSINTERACTIONTYPE_TRACE LLMObsInteractionType = "trace" - LLMOBSINTERACTIONTYPE_EXPERIMENT_TRACE LLMObsInteractionType = "experiment_trace" - LLMOBSINTERACTIONTYPE_SESSION LLMObsInteractionType = "session" -) - -var allowedLLMObsInteractionTypeEnumValues = []LLMObsInteractionType{ - LLMOBSINTERACTIONTYPE_TRACE, - LLMOBSINTERACTIONTYPE_EXPERIMENT_TRACE, - LLMOBSINTERACTIONTYPE_SESSION, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *LLMObsInteractionType) GetAllowedValues() []LLMObsInteractionType { - return allowedLLMObsInteractionTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *LLMObsInteractionType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = LLMObsInteractionType(value) - return nil -} - -// NewLLMObsInteractionTypeFromValue returns a pointer to a valid LLMObsInteractionType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewLLMObsInteractionTypeFromValue(v string) (*LLMObsInteractionType, error) { - ev := LLMObsInteractionType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for LLMObsInteractionType: valid values are %v", v, allowedLLMObsInteractionTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v LLMObsInteractionType) IsValid() bool { - for _, existing := range allowedLLMObsInteractionTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to LLMObsInteractionType value. -func (v LLMObsInteractionType) Ptr() *LLMObsInteractionType { - return &v -} diff --git a/api/datadogV2/model_llm_obs_internal_reasoning.go b/api/datadogV2/model_llm_obs_internal_reasoning.go new file mode 100644 index 00000000000..b07d5075669 --- /dev/null +++ b/api/datadogV2/model_llm_obs_internal_reasoning.go @@ -0,0 +1,147 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInternalReasoning The model's internal reasoning or thinking output, if available. +type LLMObsInternalReasoning struct { + // Number of tokens used for internal reasoning. + ReasoningTokens datadog.NullableInt64 `json:"reasoning_tokens,omitempty"` + // The reasoning text produced by the model. + Text string `json:"text"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsInternalReasoning instantiates a new LLMObsInternalReasoning object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsInternalReasoning(text string) *LLMObsInternalReasoning { + this := LLMObsInternalReasoning{} + this.Text = text + return &this +} + +// NewLLMObsInternalReasoningWithDefaults instantiates a new LLMObsInternalReasoning object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsInternalReasoningWithDefaults() *LLMObsInternalReasoning { + this := LLMObsInternalReasoning{} + return &this +} + +// GetReasoningTokens returns the ReasoningTokens field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsInternalReasoning) GetReasoningTokens() int64 { + if o == nil || o.ReasoningTokens.Get() == nil { + var ret int64 + return ret + } + return *o.ReasoningTokens.Get() +} + +// GetReasoningTokensOk returns a tuple with the ReasoningTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsInternalReasoning) GetReasoningTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ReasoningTokens.Get(), o.ReasoningTokens.IsSet() +} + +// HasReasoningTokens returns a boolean if a field has been set. +func (o *LLMObsInternalReasoning) HasReasoningTokens() bool { + return o != nil && o.ReasoningTokens.IsSet() +} + +// SetReasoningTokens gets a reference to the given datadog.NullableInt64 and assigns it to the ReasoningTokens field. +func (o *LLMObsInternalReasoning) SetReasoningTokens(v int64) { + o.ReasoningTokens.Set(&v) +} + +// SetReasoningTokensNil sets the value for ReasoningTokens to be an explicit nil. +func (o *LLMObsInternalReasoning) SetReasoningTokensNil() { + o.ReasoningTokens.Set(nil) +} + +// UnsetReasoningTokens ensures that no value is present for ReasoningTokens, not even an explicit nil. +func (o *LLMObsInternalReasoning) UnsetReasoningTokens() { + o.ReasoningTokens.Unset() +} + +// GetText returns the Text field value. +func (o *LLMObsInternalReasoning) GetText() string { + if o == nil { + var ret string + return ret + } + return o.Text +} + +// GetTextOk returns a tuple with the Text field value +// and a boolean to check if the value has been set. +func (o *LLMObsInternalReasoning) GetTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Text, true +} + +// SetText sets field value. +func (o *LLMObsInternalReasoning) SetText(v string) { + o.Text = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsInternalReasoning) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ReasoningTokens.IsSet() { + toSerialize["reasoning_tokens"] = o.ReasoningTokens.Get() + } + toSerialize["text"] = o.Text + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsInternalReasoning) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ReasoningTokens datadog.NullableInt64 `json:"reasoning_tokens,omitempty"` + Text *string `json:"text"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Text == nil { + return fmt.Errorf("required field text missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"reasoning_tokens", "text"}) + } else { + return err + } + o.ReasoningTokens = all.ReasoningTokens + o.Text = *all.Text + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_open_ai_metadata.go b/api/datadogV2/model_llm_obs_open_ai_metadata.go new file mode 100644 index 00000000000..37128d97f63 --- /dev/null +++ b/api/datadogV2/model_llm_obs_open_ai_metadata.go @@ -0,0 +1,173 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsOpenAIMetadata OpenAI-specific metadata for an inference request. +type LLMObsOpenAIMetadata struct { + // The reasoning effort level for OpenAI models that support it. + ReasoningEffort NullableLLMObsOpenAIReasoningEffort `json:"reasoning_effort,omitempty"` + // The verbosity of the reasoning summary. + ReasoningSummary NullableLLMObsOpenAIReasoningSummary `json:"reasoning_summary,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsOpenAIMetadata instantiates a new LLMObsOpenAIMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsOpenAIMetadata() *LLMObsOpenAIMetadata { + this := LLMObsOpenAIMetadata{} + return &this +} + +// NewLLMObsOpenAIMetadataWithDefaults instantiates a new LLMObsOpenAIMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsOpenAIMetadataWithDefaults() *LLMObsOpenAIMetadata { + this := LLMObsOpenAIMetadata{} + return &this +} + +// GetReasoningEffort returns the ReasoningEffort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsOpenAIMetadata) GetReasoningEffort() LLMObsOpenAIReasoningEffort { + if o == nil || o.ReasoningEffort.Get() == nil { + var ret LLMObsOpenAIReasoningEffort + return ret + } + return *o.ReasoningEffort.Get() +} + +// GetReasoningEffortOk returns a tuple with the ReasoningEffort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsOpenAIMetadata) GetReasoningEffortOk() (*LLMObsOpenAIReasoningEffort, bool) { + if o == nil { + return nil, false + } + return o.ReasoningEffort.Get(), o.ReasoningEffort.IsSet() +} + +// HasReasoningEffort returns a boolean if a field has been set. +func (o *LLMObsOpenAIMetadata) HasReasoningEffort() bool { + return o != nil && o.ReasoningEffort.IsSet() +} + +// SetReasoningEffort gets a reference to the given NullableLLMObsOpenAIReasoningEffort and assigns it to the ReasoningEffort field. +func (o *LLMObsOpenAIMetadata) SetReasoningEffort(v LLMObsOpenAIReasoningEffort) { + o.ReasoningEffort.Set(&v) +} + +// SetReasoningEffortNil sets the value for ReasoningEffort to be an explicit nil. +func (o *LLMObsOpenAIMetadata) SetReasoningEffortNil() { + o.ReasoningEffort.Set(nil) +} + +// UnsetReasoningEffort ensures that no value is present for ReasoningEffort, not even an explicit nil. +func (o *LLMObsOpenAIMetadata) UnsetReasoningEffort() { + o.ReasoningEffort.Unset() +} + +// GetReasoningSummary returns the ReasoningSummary field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LLMObsOpenAIMetadata) GetReasoningSummary() LLMObsOpenAIReasoningSummary { + if o == nil || o.ReasoningSummary.Get() == nil { + var ret LLMObsOpenAIReasoningSummary + return ret + } + return *o.ReasoningSummary.Get() +} + +// GetReasoningSummaryOk returns a tuple with the ReasoningSummary field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *LLMObsOpenAIMetadata) GetReasoningSummaryOk() (*LLMObsOpenAIReasoningSummary, bool) { + if o == nil { + return nil, false + } + return o.ReasoningSummary.Get(), o.ReasoningSummary.IsSet() +} + +// HasReasoningSummary returns a boolean if a field has been set. +func (o *LLMObsOpenAIMetadata) HasReasoningSummary() bool { + return o != nil && o.ReasoningSummary.IsSet() +} + +// SetReasoningSummary gets a reference to the given NullableLLMObsOpenAIReasoningSummary and assigns it to the ReasoningSummary field. +func (o *LLMObsOpenAIMetadata) SetReasoningSummary(v LLMObsOpenAIReasoningSummary) { + o.ReasoningSummary.Set(&v) +} + +// SetReasoningSummaryNil sets the value for ReasoningSummary to be an explicit nil. +func (o *LLMObsOpenAIMetadata) SetReasoningSummaryNil() { + o.ReasoningSummary.Set(nil) +} + +// UnsetReasoningSummary ensures that no value is present for ReasoningSummary, not even an explicit nil. +func (o *LLMObsOpenAIMetadata) UnsetReasoningSummary() { + o.ReasoningSummary.Unset() +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsOpenAIMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ReasoningEffort.IsSet() { + toSerialize["reasoning_effort"] = o.ReasoningEffort.Get() + } + if o.ReasoningSummary.IsSet() { + toSerialize["reasoning_summary"] = o.ReasoningSummary.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsOpenAIMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ReasoningEffort NullableLLMObsOpenAIReasoningEffort `json:"reasoning_effort,omitempty"` + ReasoningSummary NullableLLMObsOpenAIReasoningSummary `json:"reasoning_summary,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"reasoning_effort", "reasoning_summary"}) + } else { + return err + } + + hasInvalidField := false + if all.ReasoningEffort.Get() != nil && !all.ReasoningEffort.Get().IsValid() { + hasInvalidField = true + } else { + o.ReasoningEffort = all.ReasoningEffort + } + if all.ReasoningSummary.Get() != nil && !all.ReasoningSummary.Get().IsValid() { + hasInvalidField = true + } else { + o.ReasoningSummary = all.ReasoningSummary + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_open_ai_reasoning_effort.go b/api/datadogV2/model_llm_obs_open_ai_reasoning_effort.go new file mode 100644 index 00000000000..846e3a0b860 --- /dev/null +++ b/api/datadogV2/model_llm_obs_open_ai_reasoning_effort.go @@ -0,0 +1,116 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsOpenAIReasoningEffort The reasoning effort level for OpenAI models that support it. +type LLMObsOpenAIReasoningEffort string + +// List of LLMObsOpenAIReasoningEffort. +const ( + LLMOBSOPENAIREASONINGEFFORT_NONE LLMObsOpenAIReasoningEffort = "none" + LLMOBSOPENAIREASONINGEFFORT_LOW LLMObsOpenAIReasoningEffort = "low" + LLMOBSOPENAIREASONINGEFFORT_MEDIUM LLMObsOpenAIReasoningEffort = "medium" + LLMOBSOPENAIREASONINGEFFORT_HIGH LLMObsOpenAIReasoningEffort = "high" + LLMOBSOPENAIREASONINGEFFORT_XHIGH LLMObsOpenAIReasoningEffort = "xhigh" +) + +var allowedLLMObsOpenAIReasoningEffortEnumValues = []LLMObsOpenAIReasoningEffort{ + LLMOBSOPENAIREASONINGEFFORT_NONE, + LLMOBSOPENAIREASONINGEFFORT_LOW, + LLMOBSOPENAIREASONINGEFFORT_MEDIUM, + LLMOBSOPENAIREASONINGEFFORT_HIGH, + LLMOBSOPENAIREASONINGEFFORT_XHIGH, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsOpenAIReasoningEffort) GetAllowedValues() []LLMObsOpenAIReasoningEffort { + return allowedLLMObsOpenAIReasoningEffortEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsOpenAIReasoningEffort) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsOpenAIReasoningEffort(value) + return nil +} + +// NewLLMObsOpenAIReasoningEffortFromValue returns a pointer to a valid LLMObsOpenAIReasoningEffort +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsOpenAIReasoningEffortFromValue(v string) (*LLMObsOpenAIReasoningEffort, error) { + ev := LLMObsOpenAIReasoningEffort(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsOpenAIReasoningEffort: valid values are %v", v, allowedLLMObsOpenAIReasoningEffortEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsOpenAIReasoningEffort) IsValid() bool { + for _, existing := range allowedLLMObsOpenAIReasoningEffortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsOpenAIReasoningEffort value. +func (v LLMObsOpenAIReasoningEffort) Ptr() *LLMObsOpenAIReasoningEffort { + return &v +} + +// NullableLLMObsOpenAIReasoningEffort handles when a null is used for LLMObsOpenAIReasoningEffort. +type NullableLLMObsOpenAIReasoningEffort struct { + value *LLMObsOpenAIReasoningEffort + isSet bool +} + +// Get returns the associated value. +func (v NullableLLMObsOpenAIReasoningEffort) Get() *LLMObsOpenAIReasoningEffort { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableLLMObsOpenAIReasoningEffort) Set(val *LLMObsOpenAIReasoningEffort) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableLLMObsOpenAIReasoningEffort) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableLLMObsOpenAIReasoningEffort) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLLMObsOpenAIReasoningEffort initializes the struct as if Set has been called. +func NewNullableLLMObsOpenAIReasoningEffort(val *LLMObsOpenAIReasoningEffort) *NullableLLMObsOpenAIReasoningEffort { + return &NullableLLMObsOpenAIReasoningEffort{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableLLMObsOpenAIReasoningEffort) MarshalJSON() ([]byte, error) { + return datadog.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableLLMObsOpenAIReasoningEffort) UnmarshalJSON(src []byte) error { + v.isSet = true + return datadog.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_llm_obs_open_ai_reasoning_summary.go b/api/datadogV2/model_llm_obs_open_ai_reasoning_summary.go new file mode 100644 index 00000000000..8d43e6fdc58 --- /dev/null +++ b/api/datadogV2/model_llm_obs_open_ai_reasoning_summary.go @@ -0,0 +1,112 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsOpenAIReasoningSummary The verbosity of the reasoning summary. +type LLMObsOpenAIReasoningSummary string + +// List of LLMObsOpenAIReasoningSummary. +const ( + LLMOBSOPENAIREASONINGSUMMARY_AUTO LLMObsOpenAIReasoningSummary = "auto" + LLMOBSOPENAIREASONINGSUMMARY_CONCISE LLMObsOpenAIReasoningSummary = "concise" + LLMOBSOPENAIREASONINGSUMMARY_DETAILED LLMObsOpenAIReasoningSummary = "detailed" +) + +var allowedLLMObsOpenAIReasoningSummaryEnumValues = []LLMObsOpenAIReasoningSummary{ + LLMOBSOPENAIREASONINGSUMMARY_AUTO, + LLMOBSOPENAIREASONINGSUMMARY_CONCISE, + LLMOBSOPENAIREASONINGSUMMARY_DETAILED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsOpenAIReasoningSummary) GetAllowedValues() []LLMObsOpenAIReasoningSummary { + return allowedLLMObsOpenAIReasoningSummaryEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsOpenAIReasoningSummary) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsOpenAIReasoningSummary(value) + return nil +} + +// NewLLMObsOpenAIReasoningSummaryFromValue returns a pointer to a valid LLMObsOpenAIReasoningSummary +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsOpenAIReasoningSummaryFromValue(v string) (*LLMObsOpenAIReasoningSummary, error) { + ev := LLMObsOpenAIReasoningSummary(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsOpenAIReasoningSummary: valid values are %v", v, allowedLLMObsOpenAIReasoningSummaryEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsOpenAIReasoningSummary) IsValid() bool { + for _, existing := range allowedLLMObsOpenAIReasoningSummaryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsOpenAIReasoningSummary value. +func (v LLMObsOpenAIReasoningSummary) Ptr() *LLMObsOpenAIReasoningSummary { + return &v +} + +// NullableLLMObsOpenAIReasoningSummary handles when a null is used for LLMObsOpenAIReasoningSummary. +type NullableLLMObsOpenAIReasoningSummary struct { + value *LLMObsOpenAIReasoningSummary + isSet bool +} + +// Get returns the associated value. +func (v NullableLLMObsOpenAIReasoningSummary) Get() *LLMObsOpenAIReasoningSummary { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableLLMObsOpenAIReasoningSummary) Set(val *LLMObsOpenAIReasoningSummary) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableLLMObsOpenAIReasoningSummary) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableLLMObsOpenAIReasoningSummary) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLLMObsOpenAIReasoningSummary initializes the struct as if Set has been called. +func NewNullableLLMObsOpenAIReasoningSummary(val *LLMObsOpenAIReasoningSummary) *NullableLLMObsOpenAIReasoningSummary { + return &NullableLLMObsOpenAIReasoningSummary{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableLLMObsOpenAIReasoningSummary) MarshalJSON() ([]byte, error) { + return datadog.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableLLMObsOpenAIReasoningSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return datadog.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_llm_obs_search_spans_request.go b/api/datadogV2/model_llm_obs_search_spans_request.go new file mode 100644 index 00000000000..f0bfcb334c5 --- /dev/null +++ b/api/datadogV2/model_llm_obs_search_spans_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSearchSpansRequest Request body for searching LLM Observability spans. +type LLMObsSearchSpansRequest struct { + // Data object for an LLM Observability spans search request. + Data LLMObsSearchSpansRequestData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSearchSpansRequest instantiates a new LLMObsSearchSpansRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSearchSpansRequest(data LLMObsSearchSpansRequestData) *LLMObsSearchSpansRequest { + this := LLMObsSearchSpansRequest{} + this.Data = data + return &this +} + +// NewLLMObsSearchSpansRequestWithDefaults instantiates a new LLMObsSearchSpansRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSearchSpansRequestWithDefaults() *LLMObsSearchSpansRequest { + this := LLMObsSearchSpansRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsSearchSpansRequest) GetData() LLMObsSearchSpansRequestData { + if o == nil { + var ret LLMObsSearchSpansRequestData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequest) GetDataOk() (*LLMObsSearchSpansRequestData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsSearchSpansRequest) SetData(v LLMObsSearchSpansRequestData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSearchSpansRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSearchSpansRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsSearchSpansRequestData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_search_spans_request_attributes.go b/api/datadogV2/model_llm_obs_search_spans_request_attributes.go new file mode 100644 index 00000000000..eb6466c1787 --- /dev/null +++ b/api/datadogV2/model_llm_obs_search_spans_request_attributes.go @@ -0,0 +1,222 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSearchSpansRequestAttributes Attributes of an LLM Observability spans search request. +type LLMObsSearchSpansRequestAttributes struct { + // Filter criteria for an LLM Observability span search. + Filter *LLMObsSpanFilter `json:"filter,omitempty"` + // Additional options for a span search request. + Options *LLMObsSpanSearchOptions `json:"options,omitempty"` + // Pagination settings for a span search request. + Page *LLMObsSpanPageQuery `json:"page,omitempty"` + // Sort order for the results. Use `-` prefix for descending order. + Sort *string `json:"sort,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSearchSpansRequestAttributes instantiates a new LLMObsSearchSpansRequestAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSearchSpansRequestAttributes() *LLMObsSearchSpansRequestAttributes { + this := LLMObsSearchSpansRequestAttributes{} + return &this +} + +// NewLLMObsSearchSpansRequestAttributesWithDefaults instantiates a new LLMObsSearchSpansRequestAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSearchSpansRequestAttributesWithDefaults() *LLMObsSearchSpansRequestAttributes { + this := LLMObsSearchSpansRequestAttributes{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *LLMObsSearchSpansRequestAttributes) GetFilter() LLMObsSpanFilter { + if o == nil || o.Filter == nil { + var ret LLMObsSpanFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestAttributes) GetFilterOk() (*LLMObsSpanFilter, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *LLMObsSearchSpansRequestAttributes) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given LLMObsSpanFilter and assigns it to the Filter field. +func (o *LLMObsSearchSpansRequestAttributes) SetFilter(v LLMObsSpanFilter) { + o.Filter = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *LLMObsSearchSpansRequestAttributes) GetOptions() LLMObsSpanSearchOptions { + if o == nil || o.Options == nil { + var ret LLMObsSpanSearchOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestAttributes) GetOptionsOk() (*LLMObsSpanSearchOptions, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *LLMObsSearchSpansRequestAttributes) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given LLMObsSpanSearchOptions and assigns it to the Options field. +func (o *LLMObsSearchSpansRequestAttributes) SetOptions(v LLMObsSpanSearchOptions) { + o.Options = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *LLMObsSearchSpansRequestAttributes) GetPage() LLMObsSpanPageQuery { + if o == nil || o.Page == nil { + var ret LLMObsSpanPageQuery + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestAttributes) GetPageOk() (*LLMObsSpanPageQuery, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *LLMObsSearchSpansRequestAttributes) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given LLMObsSpanPageQuery and assigns it to the Page field. +func (o *LLMObsSearchSpansRequestAttributes) SetPage(v LLMObsSpanPageQuery) { + o.Page = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *LLMObsSearchSpansRequestAttributes) GetSort() string { + if o == nil || o.Sort == nil { + var ret string + return ret + } + return *o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestAttributes) GetSortOk() (*string, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *LLMObsSearchSpansRequestAttributes) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given string and assigns it to the Sort field. +func (o *LLMObsSearchSpansRequestAttributes) SetSort(v string) { + o.Sort = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSearchSpansRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSearchSpansRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Filter *LLMObsSpanFilter `json:"filter,omitempty"` + Options *LLMObsSpanSearchOptions `json:"options,omitempty"` + Page *LLMObsSpanPageQuery `json:"page,omitempty"` + Sort *string `json:"sort,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"filter", "options", "page", "sort"}) + } else { + return err + } + + hasInvalidField := false + if all.Filter != nil && all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Filter = all.Filter + if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Options = all.Options + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + o.Sort = all.Sort + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_search_spans_request_data.go b/api/datadogV2/model_llm_obs_search_spans_request_data.go new file mode 100644 index 00000000000..9a3b7eec653 --- /dev/null +++ b/api/datadogV2/model_llm_obs_search_spans_request_data.go @@ -0,0 +1,146 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSearchSpansRequestData Data object for an LLM Observability spans search request. +type LLMObsSearchSpansRequestData struct { + // Attributes of an LLM Observability spans search request. + Attributes LLMObsSearchSpansRequestAttributes `json:"attributes"` + // Resource type for an LLM Observability spans search request. + Type LLMObsSearchSpansRequestType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSearchSpansRequestData instantiates a new LLMObsSearchSpansRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSearchSpansRequestData(attributes LLMObsSearchSpansRequestAttributes, typeVar LLMObsSearchSpansRequestType) *LLMObsSearchSpansRequestData { + this := LLMObsSearchSpansRequestData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsSearchSpansRequestDataWithDefaults instantiates a new LLMObsSearchSpansRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSearchSpansRequestDataWithDefaults() *LLMObsSearchSpansRequestData { + this := LLMObsSearchSpansRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsSearchSpansRequestData) GetAttributes() LLMObsSearchSpansRequestAttributes { + if o == nil { + var ret LLMObsSearchSpansRequestAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestData) GetAttributesOk() (*LLMObsSearchSpansRequestAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsSearchSpansRequestData) SetAttributes(v LLMObsSearchSpansRequestAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsSearchSpansRequestData) GetType() LLMObsSearchSpansRequestType { + if o == nil { + var ret LLMObsSearchSpansRequestType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsSearchSpansRequestData) GetTypeOk() (*LLMObsSearchSpansRequestType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsSearchSpansRequestData) SetType(v LLMObsSearchSpansRequestType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSearchSpansRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSearchSpansRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsSearchSpansRequestAttributes `json:"attributes"` + Type *LLMObsSearchSpansRequestType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_search_spans_request_type.go b/api/datadogV2/model_llm_obs_search_spans_request_type.go new file mode 100644 index 00000000000..055e70c63ec --- /dev/null +++ b/api/datadogV2/model_llm_obs_search_spans_request_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSearchSpansRequestType Resource type for an LLM Observability spans search request. +type LLMObsSearchSpansRequestType string + +// List of LLMObsSearchSpansRequestType. +const ( + LLMOBSSEARCHSPANSREQUESTTYPE_SPANS LLMObsSearchSpansRequestType = "spans" +) + +var allowedLLMObsSearchSpansRequestTypeEnumValues = []LLMObsSearchSpansRequestType{ + LLMOBSSEARCHSPANSREQUESTTYPE_SPANS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsSearchSpansRequestType) GetAllowedValues() []LLMObsSearchSpansRequestType { + return allowedLLMObsSearchSpansRequestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsSearchSpansRequestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsSearchSpansRequestType(value) + return nil +} + +// NewLLMObsSearchSpansRequestTypeFromValue returns a pointer to a valid LLMObsSearchSpansRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsSearchSpansRequestTypeFromValue(v string) (*LLMObsSearchSpansRequestType, error) { + ev := LLMObsSearchSpansRequestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsSearchSpansRequestType: valid values are %v", v, allowedLLMObsSearchSpansRequestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsSearchSpansRequestType) IsValid() bool { + for _, existing := range allowedLLMObsSearchSpansRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsSearchSpansRequestType value. +func (v LLMObsSearchSpansRequestType) Ptr() *LLMObsSearchSpansRequestType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_span_attributes.go b/api/datadogV2/model_llm_obs_span_attributes.go new file mode 100644 index 00000000000..655d851a622 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_attributes.go @@ -0,0 +1,722 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanAttributes Attributes of an LLM Observability span. +type LLMObsSpanAttributes struct { + // Duration of the span in nanoseconds. + Duration float64 `json:"duration"` + // Evaluation metrics keyed by evaluator name. + Evaluation map[string]LLMObsSpanEvaluationMetric `json:"evaluation,omitempty"` + // Input or output content of an LLM Observability span. + Input *LLMObsSpanIO `json:"input,omitempty"` + // Detected intent of the span. + Intent *string `json:"intent,omitempty"` + // Arbitrary metadata associated with the span. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Numeric metrics associated with the span (e.g., token counts). + Metrics map[string]float64 `json:"metrics,omitempty"` + // Name of the ML application this span belongs to. + MlApp string `json:"ml_app"` + // Name of the model used in this span. + ModelName *string `json:"model_name,omitempty"` + // Provider of the model used in this span. + ModelProvider *string `json:"model_provider,omitempty"` + // Name of the span. + Name string `json:"name"` + // Input or output content of an LLM Observability span. + Output *LLMObsSpanIO `json:"output,omitempty"` + // Identifier of the parent span, if any. + ParentId *string `json:"parent_id,omitempty"` + // Unique identifier of the span. + SpanId string `json:"span_id"` + // Kind of span (e.g., llm, agent, tool, task, workflow). + SpanKind string `json:"span_kind"` + // Start time of the span in nanoseconds since Unix epoch. + StartNs int64 `json:"start_ns"` + // Status of the span (e.g., ok, error). + Status string `json:"status"` + // Tags associated with the span. + Tags []string `json:"tags,omitempty"` + // Tool definitions available to the span. + ToolDefinitions []LLMObsSpanToolDefinition `json:"tool_definitions,omitempty"` + // Trace identifier this span belongs to. + TraceId string `json:"trace_id"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanAttributes instantiates a new LLMObsSpanAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanAttributes(duration float64, mlApp string, name string, spanId string, spanKind string, startNs int64, status string, traceId string) *LLMObsSpanAttributes { + this := LLMObsSpanAttributes{} + this.Duration = duration + this.MlApp = mlApp + this.Name = name + this.SpanId = spanId + this.SpanKind = spanKind + this.StartNs = startNs + this.Status = status + this.TraceId = traceId + return &this +} + +// NewLLMObsSpanAttributesWithDefaults instantiates a new LLMObsSpanAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanAttributesWithDefaults() *LLMObsSpanAttributes { + this := LLMObsSpanAttributes{} + return &this +} + +// GetDuration returns the Duration field value. +func (o *LLMObsSpanAttributes) GetDuration() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetDurationOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Duration, true +} + +// SetDuration sets field value. +func (o *LLMObsSpanAttributes) SetDuration(v float64) { + o.Duration = v +} + +// GetEvaluation returns the Evaluation field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetEvaluation() map[string]LLMObsSpanEvaluationMetric { + if o == nil || o.Evaluation == nil { + var ret map[string]LLMObsSpanEvaluationMetric + return ret + } + return o.Evaluation +} + +// GetEvaluationOk returns a tuple with the Evaluation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetEvaluationOk() (*map[string]LLMObsSpanEvaluationMetric, bool) { + if o == nil || o.Evaluation == nil { + return nil, false + } + return &o.Evaluation, true +} + +// HasEvaluation returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasEvaluation() bool { + return o != nil && o.Evaluation != nil +} + +// SetEvaluation gets a reference to the given map[string]LLMObsSpanEvaluationMetric and assigns it to the Evaluation field. +func (o *LLMObsSpanAttributes) SetEvaluation(v map[string]LLMObsSpanEvaluationMetric) { + o.Evaluation = v +} + +// GetInput returns the Input field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetInput() LLMObsSpanIO { + if o == nil || o.Input == nil { + var ret LLMObsSpanIO + return ret + } + return *o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetInputOk() (*LLMObsSpanIO, bool) { + if o == nil || o.Input == nil { + return nil, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasInput() bool { + return o != nil && o.Input != nil +} + +// SetInput gets a reference to the given LLMObsSpanIO and assigns it to the Input field. +func (o *LLMObsSpanAttributes) SetInput(v LLMObsSpanIO) { + o.Input = &v +} + +// GetIntent returns the Intent field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetIntent() string { + if o == nil || o.Intent == nil { + var ret string + return ret + } + return *o.Intent +} + +// GetIntentOk returns a tuple with the Intent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetIntentOk() (*string, bool) { + if o == nil || o.Intent == nil { + return nil, false + } + return o.Intent, true +} + +// HasIntent returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasIntent() bool { + return o != nil && o.Intent != nil +} + +// SetIntent gets a reference to the given string and assigns it to the Intent field. +func (o *LLMObsSpanAttributes) SetIntent(v string) { + o.Intent = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return &o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasMetadata() bool { + return o != nil && o.Metadata != nil +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *LLMObsSpanAttributes) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetMetrics() map[string]float64 { + if o == nil || o.Metrics == nil { + var ret map[string]float64 + return ret + } + return o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetMetricsOk() (*map[string]float64, bool) { + if o == nil || o.Metrics == nil { + return nil, false + } + return &o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasMetrics() bool { + return o != nil && o.Metrics != nil +} + +// SetMetrics gets a reference to the given map[string]float64 and assigns it to the Metrics field. +func (o *LLMObsSpanAttributes) SetMetrics(v map[string]float64) { + o.Metrics = v +} + +// GetMlApp returns the MlApp field value. +func (o *LLMObsSpanAttributes) GetMlApp() string { + if o == nil { + var ret string + return ret + } + return o.MlApp +} + +// GetMlAppOk returns a tuple with the MlApp field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetMlAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MlApp, true +} + +// SetMlApp sets field value. +func (o *LLMObsSpanAttributes) SetMlApp(v string) { + o.MlApp = v +} + +// GetModelName returns the ModelName field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetModelName() string { + if o == nil || o.ModelName == nil { + var ret string + return ret + } + return *o.ModelName +} + +// GetModelNameOk returns a tuple with the ModelName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetModelNameOk() (*string, bool) { + if o == nil || o.ModelName == nil { + return nil, false + } + return o.ModelName, true +} + +// HasModelName returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasModelName() bool { + return o != nil && o.ModelName != nil +} + +// SetModelName gets a reference to the given string and assigns it to the ModelName field. +func (o *LLMObsSpanAttributes) SetModelName(v string) { + o.ModelName = &v +} + +// GetModelProvider returns the ModelProvider field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetModelProvider() string { + if o == nil || o.ModelProvider == nil { + var ret string + return ret + } + return *o.ModelProvider +} + +// GetModelProviderOk returns a tuple with the ModelProvider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetModelProviderOk() (*string, bool) { + if o == nil || o.ModelProvider == nil { + return nil, false + } + return o.ModelProvider, true +} + +// HasModelProvider returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasModelProvider() bool { + return o != nil && o.ModelProvider != nil +} + +// SetModelProvider gets a reference to the given string and assigns it to the ModelProvider field. +func (o *LLMObsSpanAttributes) SetModelProvider(v string) { + o.ModelProvider = &v +} + +// GetName returns the Name field value. +func (o *LLMObsSpanAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *LLMObsSpanAttributes) SetName(v string) { + o.Name = v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetOutput() LLMObsSpanIO { + if o == nil || o.Output == nil { + var ret LLMObsSpanIO + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetOutputOk() (*LLMObsSpanIO, bool) { + if o == nil || o.Output == nil { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasOutput() bool { + return o != nil && o.Output != nil +} + +// SetOutput gets a reference to the given LLMObsSpanIO and assigns it to the Output field. +func (o *LLMObsSpanAttributes) SetOutput(v LLMObsSpanIO) { + o.Output = &v +} + +// GetParentId returns the ParentId field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetParentId() string { + if o == nil || o.ParentId == nil { + var ret string + return ret + } + return *o.ParentId +} + +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetParentIdOk() (*string, bool) { + if o == nil || o.ParentId == nil { + return nil, false + } + return o.ParentId, true +} + +// HasParentId returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasParentId() bool { + return o != nil && o.ParentId != nil +} + +// SetParentId gets a reference to the given string and assigns it to the ParentId field. +func (o *LLMObsSpanAttributes) SetParentId(v string) { + o.ParentId = &v +} + +// GetSpanId returns the SpanId field value. +func (o *LLMObsSpanAttributes) GetSpanId() string { + if o == nil { + var ret string + return ret + } + return o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetSpanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SpanId, true +} + +// SetSpanId sets field value. +func (o *LLMObsSpanAttributes) SetSpanId(v string) { + o.SpanId = v +} + +// GetSpanKind returns the SpanKind field value. +func (o *LLMObsSpanAttributes) GetSpanKind() string { + if o == nil { + var ret string + return ret + } + return o.SpanKind +} + +// GetSpanKindOk returns a tuple with the SpanKind field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetSpanKindOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SpanKind, true +} + +// SetSpanKind sets field value. +func (o *LLMObsSpanAttributes) SetSpanKind(v string) { + o.SpanKind = v +} + +// GetStartNs returns the StartNs field value. +func (o *LLMObsSpanAttributes) GetStartNs() int64 { + if o == nil { + var ret int64 + return ret + } + return o.StartNs +} + +// GetStartNsOk returns a tuple with the StartNs field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetStartNsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.StartNs, true +} + +// SetStartNs sets field value. +func (o *LLMObsSpanAttributes) SetStartNs(v int64) { + o.StartNs = v +} + +// GetStatus returns the Status field value. +func (o *LLMObsSpanAttributes) GetStatus() string { + if o == nil { + var ret string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *LLMObsSpanAttributes) SetStatus(v string) { + o.Status = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *LLMObsSpanAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetToolDefinitions returns the ToolDefinitions field value if set, zero value otherwise. +func (o *LLMObsSpanAttributes) GetToolDefinitions() []LLMObsSpanToolDefinition { + if o == nil || o.ToolDefinitions == nil { + var ret []LLMObsSpanToolDefinition + return ret + } + return o.ToolDefinitions +} + +// GetToolDefinitionsOk returns a tuple with the ToolDefinitions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetToolDefinitionsOk() (*[]LLMObsSpanToolDefinition, bool) { + if o == nil || o.ToolDefinitions == nil { + return nil, false + } + return &o.ToolDefinitions, true +} + +// HasToolDefinitions returns a boolean if a field has been set. +func (o *LLMObsSpanAttributes) HasToolDefinitions() bool { + return o != nil && o.ToolDefinitions != nil +} + +// SetToolDefinitions gets a reference to the given []LLMObsSpanToolDefinition and assigns it to the ToolDefinitions field. +func (o *LLMObsSpanAttributes) SetToolDefinitions(v []LLMObsSpanToolDefinition) { + o.ToolDefinitions = v +} + +// GetTraceId returns the TraceId field value. +func (o *LLMObsSpanAttributes) GetTraceId() string { + if o == nil { + var ret string + return ret + } + return o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanAttributes) GetTraceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TraceId, true +} + +// SetTraceId sets field value. +func (o *LLMObsSpanAttributes) SetTraceId(v string) { + o.TraceId = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["duration"] = o.Duration + if o.Evaluation != nil { + toSerialize["evaluation"] = o.Evaluation + } + if o.Input != nil { + toSerialize["input"] = o.Input + } + if o.Intent != nil { + toSerialize["intent"] = o.Intent + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Metrics != nil { + toSerialize["metrics"] = o.Metrics + } + toSerialize["ml_app"] = o.MlApp + if o.ModelName != nil { + toSerialize["model_name"] = o.ModelName + } + if o.ModelProvider != nil { + toSerialize["model_provider"] = o.ModelProvider + } + toSerialize["name"] = o.Name + if o.Output != nil { + toSerialize["output"] = o.Output + } + if o.ParentId != nil { + toSerialize["parent_id"] = o.ParentId + } + toSerialize["span_id"] = o.SpanId + toSerialize["span_kind"] = o.SpanKind + toSerialize["start_ns"] = o.StartNs + toSerialize["status"] = o.Status + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.ToolDefinitions != nil { + toSerialize["tool_definitions"] = o.ToolDefinitions + } + toSerialize["trace_id"] = o.TraceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Duration *float64 `json:"duration"` + Evaluation map[string]LLMObsSpanEvaluationMetric `json:"evaluation,omitempty"` + Input *LLMObsSpanIO `json:"input,omitempty"` + Intent *string `json:"intent,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Metrics map[string]float64 `json:"metrics,omitempty"` + MlApp *string `json:"ml_app"` + ModelName *string `json:"model_name,omitempty"` + ModelProvider *string `json:"model_provider,omitempty"` + Name *string `json:"name"` + Output *LLMObsSpanIO `json:"output,omitempty"` + ParentId *string `json:"parent_id,omitempty"` + SpanId *string `json:"span_id"` + SpanKind *string `json:"span_kind"` + StartNs *int64 `json:"start_ns"` + Status *string `json:"status"` + Tags []string `json:"tags,omitempty"` + ToolDefinitions []LLMObsSpanToolDefinition `json:"tool_definitions,omitempty"` + TraceId *string `json:"trace_id"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Duration == nil { + return fmt.Errorf("required field duration missing") + } + if all.MlApp == nil { + return fmt.Errorf("required field ml_app missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.SpanId == nil { + return fmt.Errorf("required field span_id missing") + } + if all.SpanKind == nil { + return fmt.Errorf("required field span_kind missing") + } + if all.StartNs == nil { + return fmt.Errorf("required field start_ns missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + if all.TraceId == nil { + return fmt.Errorf("required field trace_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"duration", "evaluation", "input", "intent", "metadata", "metrics", "ml_app", "model_name", "model_provider", "name", "output", "parent_id", "span_id", "span_kind", "start_ns", "status", "tags", "tool_definitions", "trace_id"}) + } else { + return err + } + + hasInvalidField := false + o.Duration = *all.Duration + o.Evaluation = all.Evaluation + if all.Input != nil && all.Input.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Input = all.Input + o.Intent = all.Intent + o.Metadata = all.Metadata + o.Metrics = all.Metrics + o.MlApp = *all.MlApp + o.ModelName = all.ModelName + o.ModelProvider = all.ModelProvider + o.Name = *all.Name + if all.Output != nil && all.Output.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Output = all.Output + o.ParentId = all.ParentId + o.SpanId = *all.SpanId + o.SpanKind = *all.SpanKind + o.StartNs = *all.StartNs + o.Status = *all.Status + o.Tags = all.Tags + o.ToolDefinitions = all.ToolDefinitions + o.TraceId = *all.TraceId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_data.go b/api/datadogV2/model_llm_obs_span_data.go new file mode 100644 index 00000000000..c3df696eb16 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanData A single LLM Observability span. +type LLMObsSpanData struct { + // Attributes of an LLM Observability span. + Attributes LLMObsSpanAttributes `json:"attributes"` + // Unique identifier of the span. + Id string `json:"id"` + // Resource type for an LLM Observability span. + Type LLMObsSpanType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanData instantiates a new LLMObsSpanData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanData(attributes LLMObsSpanAttributes, id string, typeVar LLMObsSpanType) *LLMObsSpanData { + this := LLMObsSpanData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsSpanDataWithDefaults instantiates a new LLMObsSpanData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanDataWithDefaults() *LLMObsSpanData { + this := LLMObsSpanData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsSpanData) GetAttributes() LLMObsSpanAttributes { + if o == nil { + var ret LLMObsSpanAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanData) GetAttributesOk() (*LLMObsSpanAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsSpanData) SetAttributes(v LLMObsSpanAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsSpanData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsSpanData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsSpanData) GetType() LLMObsSpanType { + if o == nil { + var ret LLMObsSpanType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpanData) GetTypeOk() (*LLMObsSpanType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsSpanData) SetType(v LLMObsSpanType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsSpanAttributes `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsSpanType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_evaluation_metric.go b/api/datadogV2/model_llm_obs_span_evaluation_metric.go new file mode 100644 index 00000000000..4a413d46109 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_evaluation_metric.go @@ -0,0 +1,277 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanEvaluationMetric An evaluation metric associated with an LLM Observability span. +type LLMObsSpanEvaluationMetric struct { + // Assessment result (e.g., pass or fail). + Assessment *string `json:"assessment,omitempty"` + // Type of the evaluation metric (e.g., score, categorical, boolean). + EvalMetricType *string `json:"eval_metric_type,omitempty"` + // Human-readable reasoning for the evaluation result. + Reasoning *string `json:"reasoning,omitempty"` + // Status of the evaluation execution. + Status *string `json:"status,omitempty"` + // Tags associated with the evaluation metric. + Tags []string `json:"tags,omitempty"` + // Value of the evaluation result. + Value interface{} `json:"value,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanEvaluationMetric instantiates a new LLMObsSpanEvaluationMetric object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanEvaluationMetric() *LLMObsSpanEvaluationMetric { + this := LLMObsSpanEvaluationMetric{} + return &this +} + +// NewLLMObsSpanEvaluationMetricWithDefaults instantiates a new LLMObsSpanEvaluationMetric object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanEvaluationMetricWithDefaults() *LLMObsSpanEvaluationMetric { + this := LLMObsSpanEvaluationMetric{} + return &this +} + +// GetAssessment returns the Assessment field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetAssessment() string { + if o == nil || o.Assessment == nil { + var ret string + return ret + } + return *o.Assessment +} + +// GetAssessmentOk returns a tuple with the Assessment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetAssessmentOk() (*string, bool) { + if o == nil || o.Assessment == nil { + return nil, false + } + return o.Assessment, true +} + +// HasAssessment returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasAssessment() bool { + return o != nil && o.Assessment != nil +} + +// SetAssessment gets a reference to the given string and assigns it to the Assessment field. +func (o *LLMObsSpanEvaluationMetric) SetAssessment(v string) { + o.Assessment = &v +} + +// GetEvalMetricType returns the EvalMetricType field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetEvalMetricType() string { + if o == nil || o.EvalMetricType == nil { + var ret string + return ret + } + return *o.EvalMetricType +} + +// GetEvalMetricTypeOk returns a tuple with the EvalMetricType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetEvalMetricTypeOk() (*string, bool) { + if o == nil || o.EvalMetricType == nil { + return nil, false + } + return o.EvalMetricType, true +} + +// HasEvalMetricType returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasEvalMetricType() bool { + return o != nil && o.EvalMetricType != nil +} + +// SetEvalMetricType gets a reference to the given string and assigns it to the EvalMetricType field. +func (o *LLMObsSpanEvaluationMetric) SetEvalMetricType(v string) { + o.EvalMetricType = &v +} + +// GetReasoning returns the Reasoning field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetReasoning() string { + if o == nil || o.Reasoning == nil { + var ret string + return ret + } + return *o.Reasoning +} + +// GetReasoningOk returns a tuple with the Reasoning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetReasoningOk() (*string, bool) { + if o == nil || o.Reasoning == nil { + return nil, false + } + return o.Reasoning, true +} + +// HasReasoning returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasReasoning() bool { + return o != nil && o.Reasoning != nil +} + +// SetReasoning gets a reference to the given string and assigns it to the Reasoning field. +func (o *LLMObsSpanEvaluationMetric) SetReasoning(v string) { + o.Reasoning = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *LLMObsSpanEvaluationMetric) SetStatus(v string) { + o.Status = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *LLMObsSpanEvaluationMetric) SetTags(v []string) { + o.Tags = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *LLMObsSpanEvaluationMetric) GetValue() interface{} { + if o == nil || o.Value == nil { + var ret interface{} + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanEvaluationMetric) GetValueOk() (*interface{}, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return &o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *LLMObsSpanEvaluationMetric) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given interface{} and assigns it to the Value field. +func (o *LLMObsSpanEvaluationMetric) SetValue(v interface{}) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanEvaluationMetric) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Assessment != nil { + toSerialize["assessment"] = o.Assessment + } + if o.EvalMetricType != nil { + toSerialize["eval_metric_type"] = o.EvalMetricType + } + if o.Reasoning != nil { + toSerialize["reasoning"] = o.Reasoning + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanEvaluationMetric) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Assessment *string `json:"assessment,omitempty"` + EvalMetricType *string `json:"eval_metric_type,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Status *string `json:"status,omitempty"` + Tags []string `json:"tags,omitempty"` + Value interface{} `json:"value,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"assessment", "eval_metric_type", "reasoning", "status", "tags", "value"}) + } else { + return err + } + o.Assessment = all.Assessment + o.EvalMetricType = all.EvalMetricType + o.Reasoning = all.Reasoning + o.Status = all.Status + o.Tags = all.Tags + o.Value = all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_filter.go b/api/datadogV2/model_llm_obs_span_filter.go new file mode 100644 index 00000000000..42213b47bb9 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_filter.go @@ -0,0 +1,382 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanFilter Filter criteria for an LLM Observability span search. +type LLMObsSpanFilter struct { + // Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + From *string `json:"from,omitempty"` + // Filter by ML application name. + MlApp *string `json:"ml_app,omitempty"` + // Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`span_id`, `trace_id`, etc.) are ignored. + Query *string `json:"query,omitempty"` + // Filter by exact span ID. + SpanId *string `json:"span_id,omitempty"` + // Filter by span kind (e.g., llm, agent, tool, task, workflow). + SpanKind *string `json:"span_kind,omitempty"` + // Filter by span name. + SpanName *string `json:"span_name,omitempty"` + // Filter by tag key-value pairs. + Tags map[string]string `json:"tags,omitempty"` + // End of the time range. Accepts ISO 8601 or relative format (e.g., `now`). Defaults to `now`. + To *string `json:"to,omitempty"` + // Filter by exact trace ID. + TraceId *string `json:"trace_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanFilter instantiates a new LLMObsSpanFilter object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanFilter() *LLMObsSpanFilter { + this := LLMObsSpanFilter{} + return &this +} + +// NewLLMObsSpanFilterWithDefaults instantiates a new LLMObsSpanFilter object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanFilterWithDefaults() *LLMObsSpanFilter { + this := LLMObsSpanFilter{} + return &this +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetFrom() string { + if o == nil || o.From == nil { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetFromOk() (*string, bool) { + if o == nil || o.From == nil { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasFrom() bool { + return o != nil && o.From != nil +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *LLMObsSpanFilter) SetFrom(v string) { + o.From = &v +} + +// GetMlApp returns the MlApp field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetMlApp() string { + if o == nil || o.MlApp == nil { + var ret string + return ret + } + return *o.MlApp +} + +// GetMlAppOk returns a tuple with the MlApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetMlAppOk() (*string, bool) { + if o == nil || o.MlApp == nil { + return nil, false + } + return o.MlApp, true +} + +// HasMlApp returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasMlApp() bool { + return o != nil && o.MlApp != nil +} + +// SetMlApp gets a reference to the given string and assigns it to the MlApp field. +func (o *LLMObsSpanFilter) SetMlApp(v string) { + o.MlApp = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *LLMObsSpanFilter) SetQuery(v string) { + o.Query = &v +} + +// GetSpanId returns the SpanId field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetSpanId() string { + if o == nil || o.SpanId == nil { + var ret string + return ret + } + return *o.SpanId +} + +// GetSpanIdOk returns a tuple with the SpanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetSpanIdOk() (*string, bool) { + if o == nil || o.SpanId == nil { + return nil, false + } + return o.SpanId, true +} + +// HasSpanId returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasSpanId() bool { + return o != nil && o.SpanId != nil +} + +// SetSpanId gets a reference to the given string and assigns it to the SpanId field. +func (o *LLMObsSpanFilter) SetSpanId(v string) { + o.SpanId = &v +} + +// GetSpanKind returns the SpanKind field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetSpanKind() string { + if o == nil || o.SpanKind == nil { + var ret string + return ret + } + return *o.SpanKind +} + +// GetSpanKindOk returns a tuple with the SpanKind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetSpanKindOk() (*string, bool) { + if o == nil || o.SpanKind == nil { + return nil, false + } + return o.SpanKind, true +} + +// HasSpanKind returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasSpanKind() bool { + return o != nil && o.SpanKind != nil +} + +// SetSpanKind gets a reference to the given string and assigns it to the SpanKind field. +func (o *LLMObsSpanFilter) SetSpanKind(v string) { + o.SpanKind = &v +} + +// GetSpanName returns the SpanName field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetSpanName() string { + if o == nil || o.SpanName == nil { + var ret string + return ret + } + return *o.SpanName +} + +// GetSpanNameOk returns a tuple with the SpanName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetSpanNameOk() (*string, bool) { + if o == nil || o.SpanName == nil { + return nil, false + } + return o.SpanName, true +} + +// HasSpanName returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasSpanName() bool { + return o != nil && o.SpanName != nil +} + +// SetSpanName gets a reference to the given string and assigns it to the SpanName field. +func (o *LLMObsSpanFilter) SetSpanName(v string) { + o.SpanName = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetTags() map[string]string { + if o == nil || o.Tags == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetTagsOk() (*map[string]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *LLMObsSpanFilter) SetTags(v map[string]string) { + o.Tags = v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetTo() string { + if o == nil || o.To == nil { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetToOk() (*string, bool) { + if o == nil || o.To == nil { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasTo() bool { + return o != nil && o.To != nil +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *LLMObsSpanFilter) SetTo(v string) { + o.To = &v +} + +// GetTraceId returns the TraceId field value if set, zero value otherwise. +func (o *LLMObsSpanFilter) GetTraceId() string { + if o == nil || o.TraceId == nil { + var ret string + return ret + } + return *o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanFilter) GetTraceIdOk() (*string, bool) { + if o == nil || o.TraceId == nil { + return nil, false + } + return o.TraceId, true +} + +// HasTraceId returns a boolean if a field has been set. +func (o *LLMObsSpanFilter) HasTraceId() bool { + return o != nil && o.TraceId != nil +} + +// SetTraceId gets a reference to the given string and assigns it to the TraceId field. +func (o *LLMObsSpanFilter) SetTraceId(v string) { + o.TraceId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.From != nil { + toSerialize["from"] = o.From + } + if o.MlApp != nil { + toSerialize["ml_app"] = o.MlApp + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.SpanId != nil { + toSerialize["span_id"] = o.SpanId + } + if o.SpanKind != nil { + toSerialize["span_kind"] = o.SpanKind + } + if o.SpanName != nil { + toSerialize["span_name"] = o.SpanName + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.To != nil { + toSerialize["to"] = o.To + } + if o.TraceId != nil { + toSerialize["trace_id"] = o.TraceId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanFilter) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + From *string `json:"from,omitempty"` + MlApp *string `json:"ml_app,omitempty"` + Query *string `json:"query,omitempty"` + SpanId *string `json:"span_id,omitempty"` + SpanKind *string `json:"span_kind,omitempty"` + SpanName *string `json:"span_name,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + To *string `json:"to,omitempty"` + TraceId *string `json:"trace_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"from", "ml_app", "query", "span_id", "span_kind", "span_name", "tags", "to", "trace_id"}) + } else { + return err + } + o.From = all.From + o.MlApp = all.MlApp + o.Query = all.Query + o.SpanId = all.SpanId + o.SpanKind = all.SpanKind + o.SpanName = all.SpanName + o.Tags = all.Tags + o.To = all.To + o.TraceId = all.TraceId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_io.go b/api/datadogV2/model_llm_obs_span_io.go new file mode 100644 index 00000000000..f57aa38a1f7 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_io.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanIO Input or output content of an LLM Observability span. +type LLMObsSpanIO struct { + // List of messages in the input or output. + Messages []LLMObsSpanMessage `json:"messages,omitempty"` + // Plain-text value of the input or output. + Value *string `json:"value,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanIO instantiates a new LLMObsSpanIO object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanIO() *LLMObsSpanIO { + this := LLMObsSpanIO{} + return &this +} + +// NewLLMObsSpanIOWithDefaults instantiates a new LLMObsSpanIO object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanIOWithDefaults() *LLMObsSpanIO { + this := LLMObsSpanIO{} + return &this +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *LLMObsSpanIO) GetMessages() []LLMObsSpanMessage { + if o == nil || o.Messages == nil { + var ret []LLMObsSpanMessage + return ret + } + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanIO) GetMessagesOk() (*[]LLMObsSpanMessage, bool) { + if o == nil || o.Messages == nil { + return nil, false + } + return &o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *LLMObsSpanIO) HasMessages() bool { + return o != nil && o.Messages != nil +} + +// SetMessages gets a reference to the given []LLMObsSpanMessage and assigns it to the Messages field. +func (o *LLMObsSpanIO) SetMessages(v []LLMObsSpanMessage) { + o.Messages = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *LLMObsSpanIO) GetValue() string { + if o == nil || o.Value == nil { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanIO) GetValueOk() (*string, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *LLMObsSpanIO) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *LLMObsSpanIO) SetValue(v string) { + o.Value = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanIO) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Messages != nil { + toSerialize["messages"] = o.Messages + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanIO) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Messages []LLMObsSpanMessage `json:"messages,omitempty"` + Value *string `json:"value,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"messages", "value"}) + } else { + return err + } + o.Messages = all.Messages + o.Value = all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_message.go b/api/datadogV2/model_llm_obs_span_message.go new file mode 100644 index 00000000000..bc35c469eae --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_message.go @@ -0,0 +1,242 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanMessage A single message in a span input or output. +type LLMObsSpanMessage struct { + // Text content of the message. + Content *string `json:"content,omitempty"` + // Unique identifier of the message. + Id *string `json:"id,omitempty"` + // Role of the message sender (e.g., user, assistant, system). + Role *string `json:"role,omitempty"` + // Tool calls made in this message. + ToolCalls []LLMObsSpanToolCall `json:"tool_calls,omitempty"` + // Tool results returned in this message. + ToolResults []LLMObsSpanToolResult `json:"tool_results,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanMessage instantiates a new LLMObsSpanMessage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanMessage() *LLMObsSpanMessage { + this := LLMObsSpanMessage{} + return &this +} + +// NewLLMObsSpanMessageWithDefaults instantiates a new LLMObsSpanMessage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanMessageWithDefaults() *LLMObsSpanMessage { + this := LLMObsSpanMessage{} + return &this +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *LLMObsSpanMessage) GetContent() string { + if o == nil || o.Content == nil { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanMessage) GetContentOk() (*string, bool) { + if o == nil || o.Content == nil { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *LLMObsSpanMessage) HasContent() bool { + return o != nil && o.Content != nil +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *LLMObsSpanMessage) SetContent(v string) { + o.Content = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *LLMObsSpanMessage) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanMessage) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *LLMObsSpanMessage) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *LLMObsSpanMessage) SetId(v string) { + o.Id = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *LLMObsSpanMessage) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanMessage) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *LLMObsSpanMessage) HasRole() bool { + return o != nil && o.Role != nil +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *LLMObsSpanMessage) SetRole(v string) { + o.Role = &v +} + +// GetToolCalls returns the ToolCalls field value if set, zero value otherwise. +func (o *LLMObsSpanMessage) GetToolCalls() []LLMObsSpanToolCall { + if o == nil || o.ToolCalls == nil { + var ret []LLMObsSpanToolCall + return ret + } + return o.ToolCalls +} + +// GetToolCallsOk returns a tuple with the ToolCalls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanMessage) GetToolCallsOk() (*[]LLMObsSpanToolCall, bool) { + if o == nil || o.ToolCalls == nil { + return nil, false + } + return &o.ToolCalls, true +} + +// HasToolCalls returns a boolean if a field has been set. +func (o *LLMObsSpanMessage) HasToolCalls() bool { + return o != nil && o.ToolCalls != nil +} + +// SetToolCalls gets a reference to the given []LLMObsSpanToolCall and assigns it to the ToolCalls field. +func (o *LLMObsSpanMessage) SetToolCalls(v []LLMObsSpanToolCall) { + o.ToolCalls = v +} + +// GetToolResults returns the ToolResults field value if set, zero value otherwise. +func (o *LLMObsSpanMessage) GetToolResults() []LLMObsSpanToolResult { + if o == nil || o.ToolResults == nil { + var ret []LLMObsSpanToolResult + return ret + } + return o.ToolResults +} + +// GetToolResultsOk returns a tuple with the ToolResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanMessage) GetToolResultsOk() (*[]LLMObsSpanToolResult, bool) { + if o == nil || o.ToolResults == nil { + return nil, false + } + return &o.ToolResults, true +} + +// HasToolResults returns a boolean if a field has been set. +func (o *LLMObsSpanMessage) HasToolResults() bool { + return o != nil && o.ToolResults != nil +} + +// SetToolResults gets a reference to the given []LLMObsSpanToolResult and assigns it to the ToolResults field. +func (o *LLMObsSpanMessage) SetToolResults(v []LLMObsSpanToolResult) { + o.ToolResults = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanMessage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Content != nil { + toSerialize["content"] = o.Content + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.ToolCalls != nil { + toSerialize["tool_calls"] = o.ToolCalls + } + if o.ToolResults != nil { + toSerialize["tool_results"] = o.ToolResults + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanMessage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Content *string `json:"content,omitempty"` + Id *string `json:"id,omitempty"` + Role *string `json:"role,omitempty"` + ToolCalls []LLMObsSpanToolCall `json:"tool_calls,omitempty"` + ToolResults []LLMObsSpanToolResult `json:"tool_results,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content", "id", "role", "tool_calls", "tool_results"}) + } else { + return err + } + o.Content = all.Content + o.Id = all.Id + o.Role = all.Role + o.ToolCalls = all.ToolCalls + o.ToolResults = all.ToolResults + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_page_query.go b/api/datadogV2/model_llm_obs_span_page_query.go new file mode 100644 index 00000000000..34df0f402e9 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_page_query.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanPageQuery Pagination settings for a span search request. +type LLMObsSpanPageQuery struct { + // Cursor from the previous response to retrieve the next page. + Cursor *string `json:"cursor,omitempty"` + // Maximum number of spans to return. Defaults to `10`. + Limit *int64 `json:"limit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanPageQuery instantiates a new LLMObsSpanPageQuery object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanPageQuery() *LLMObsSpanPageQuery { + this := LLMObsSpanPageQuery{} + return &this +} + +// NewLLMObsSpanPageQueryWithDefaults instantiates a new LLMObsSpanPageQuery object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanPageQueryWithDefaults() *LLMObsSpanPageQuery { + this := LLMObsSpanPageQuery{} + return &this +} + +// GetCursor returns the Cursor field value if set, zero value otherwise. +func (o *LLMObsSpanPageQuery) GetCursor() string { + if o == nil || o.Cursor == nil { + var ret string + return ret + } + return *o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanPageQuery) GetCursorOk() (*string, bool) { + if o == nil || o.Cursor == nil { + return nil, false + } + return o.Cursor, true +} + +// HasCursor returns a boolean if a field has been set. +func (o *LLMObsSpanPageQuery) HasCursor() bool { + return o != nil && o.Cursor != nil +} + +// SetCursor gets a reference to the given string and assigns it to the Cursor field. +func (o *LLMObsSpanPageQuery) SetCursor(v string) { + o.Cursor = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LLMObsSpanPageQuery) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanPageQuery) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *LLMObsSpanPageQuery) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *LLMObsSpanPageQuery) SetLimit(v int64) { + o.Limit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanPageQuery) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cursor != nil { + toSerialize["cursor"] = o.Cursor + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanPageQuery) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cursor *string `json:"cursor,omitempty"` + Limit *int64 `json:"limit,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cursor", "limit"}) + } else { + return err + } + o.Cursor = all.Cursor + o.Limit = all.Limit + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_search_options.go b/api/datadogV2/model_llm_obs_span_search_options.go new file mode 100644 index 00000000000..6121958026c --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_search_options.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanSearchOptions Additional options for a span search request. +type LLMObsSpanSearchOptions struct { + // Whether to include attachment data in the response. Defaults to `true`. + IncludeAttachments *bool `json:"include_attachments,omitempty"` + // Offset in seconds applied to both `from` and `to` timestamps. + TimeOffset *int64 `json:"time_offset,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanSearchOptions instantiates a new LLMObsSpanSearchOptions object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanSearchOptions() *LLMObsSpanSearchOptions { + this := LLMObsSpanSearchOptions{} + return &this +} + +// NewLLMObsSpanSearchOptionsWithDefaults instantiates a new LLMObsSpanSearchOptions object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanSearchOptionsWithDefaults() *LLMObsSpanSearchOptions { + this := LLMObsSpanSearchOptions{} + return &this +} + +// GetIncludeAttachments returns the IncludeAttachments field value if set, zero value otherwise. +func (o *LLMObsSpanSearchOptions) GetIncludeAttachments() bool { + if o == nil || o.IncludeAttachments == nil { + var ret bool + return ret + } + return *o.IncludeAttachments +} + +// GetIncludeAttachmentsOk returns a tuple with the IncludeAttachments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanSearchOptions) GetIncludeAttachmentsOk() (*bool, bool) { + if o == nil || o.IncludeAttachments == nil { + return nil, false + } + return o.IncludeAttachments, true +} + +// HasIncludeAttachments returns a boolean if a field has been set. +func (o *LLMObsSpanSearchOptions) HasIncludeAttachments() bool { + return o != nil && o.IncludeAttachments != nil +} + +// SetIncludeAttachments gets a reference to the given bool and assigns it to the IncludeAttachments field. +func (o *LLMObsSpanSearchOptions) SetIncludeAttachments(v bool) { + o.IncludeAttachments = &v +} + +// GetTimeOffset returns the TimeOffset field value if set, zero value otherwise. +func (o *LLMObsSpanSearchOptions) GetTimeOffset() int64 { + if o == nil || o.TimeOffset == nil { + var ret int64 + return ret + } + return *o.TimeOffset +} + +// GetTimeOffsetOk returns a tuple with the TimeOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanSearchOptions) GetTimeOffsetOk() (*int64, bool) { + if o == nil || o.TimeOffset == nil { + return nil, false + } + return o.TimeOffset, true +} + +// HasTimeOffset returns a boolean if a field has been set. +func (o *LLMObsSpanSearchOptions) HasTimeOffset() bool { + return o != nil && o.TimeOffset != nil +} + +// SetTimeOffset gets a reference to the given int64 and assigns it to the TimeOffset field. +func (o *LLMObsSpanSearchOptions) SetTimeOffset(v int64) { + o.TimeOffset = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanSearchOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.IncludeAttachments != nil { + toSerialize["include_attachments"] = o.IncludeAttachments + } + if o.TimeOffset != nil { + toSerialize["time_offset"] = o.TimeOffset + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanSearchOptions) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + IncludeAttachments *bool `json:"include_attachments,omitempty"` + TimeOffset *int64 `json:"time_offset,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"include_attachments", "time_offset"}) + } else { + return err + } + o.IncludeAttachments = all.IncludeAttachments + o.TimeOffset = all.TimeOffset + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_tool_call.go b/api/datadogV2/model_llm_obs_span_tool_call.go new file mode 100644 index 00000000000..30724920a80 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_tool_call.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanToolCall A tool call made during a span. +type LLMObsSpanToolCall struct { + // Arguments passed to the tool. + Arguments map[string]interface{} `json:"arguments,omitempty"` + // Name of the tool called. + Name *string `json:"name,omitempty"` + // Identifier of the tool call. + ToolId *string `json:"tool_id,omitempty"` + // Type of the tool call. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanToolCall instantiates a new LLMObsSpanToolCall object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanToolCall() *LLMObsSpanToolCall { + this := LLMObsSpanToolCall{} + return &this +} + +// NewLLMObsSpanToolCallWithDefaults instantiates a new LLMObsSpanToolCall object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanToolCallWithDefaults() *LLMObsSpanToolCall { + this := LLMObsSpanToolCall{} + return &this +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *LLMObsSpanToolCall) GetArguments() map[string]interface{} { + if o == nil || o.Arguments == nil { + var ret map[string]interface{} + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolCall) GetArgumentsOk() (*map[string]interface{}, bool) { + if o == nil || o.Arguments == nil { + return nil, false + } + return &o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *LLMObsSpanToolCall) HasArguments() bool { + return o != nil && o.Arguments != nil +} + +// SetArguments gets a reference to the given map[string]interface{} and assigns it to the Arguments field. +func (o *LLMObsSpanToolCall) SetArguments(v map[string]interface{}) { + o.Arguments = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsSpanToolCall) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolCall) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsSpanToolCall) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsSpanToolCall) SetName(v string) { + o.Name = &v +} + +// GetToolId returns the ToolId field value if set, zero value otherwise. +func (o *LLMObsSpanToolCall) GetToolId() string { + if o == nil || o.ToolId == nil { + var ret string + return ret + } + return *o.ToolId +} + +// GetToolIdOk returns a tuple with the ToolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolCall) GetToolIdOk() (*string, bool) { + if o == nil || o.ToolId == nil { + return nil, false + } + return o.ToolId, true +} + +// HasToolId returns a boolean if a field has been set. +func (o *LLMObsSpanToolCall) HasToolId() bool { + return o != nil && o.ToolId != nil +} + +// SetToolId gets a reference to the given string and assigns it to the ToolId field. +func (o *LLMObsSpanToolCall) SetToolId(v string) { + o.ToolId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LLMObsSpanToolCall) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolCall) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LLMObsSpanToolCall) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LLMObsSpanToolCall) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanToolCall) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Arguments != nil { + toSerialize["arguments"] = o.Arguments + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ToolId != nil { + toSerialize["tool_id"] = o.ToolId + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanToolCall) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Arguments map[string]interface{} `json:"arguments,omitempty"` + Name *string `json:"name,omitempty"` + ToolId *string `json:"tool_id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"arguments", "name", "tool_id", "type"}) + } else { + return err + } + o.Arguments = all.Arguments + o.Name = all.Name + o.ToolId = all.ToolId + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_tool_definition.go b/api/datadogV2/model_llm_obs_span_tool_definition.go new file mode 100644 index 00000000000..92963602260 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_tool_definition.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanToolDefinition A tool definition available to an LLM span. +type LLMObsSpanToolDefinition struct { + // Description of what the tool does. + Description *string `json:"description,omitempty"` + // Name of the tool. + Name *string `json:"name,omitempty"` + // JSON schema describing the tool's input parameters. + Schema map[string]interface{} `json:"schema,omitempty"` + // Version of the tool definition. + Version *string `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanToolDefinition instantiates a new LLMObsSpanToolDefinition object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanToolDefinition() *LLMObsSpanToolDefinition { + this := LLMObsSpanToolDefinition{} + return &this +} + +// NewLLMObsSpanToolDefinitionWithDefaults instantiates a new LLMObsSpanToolDefinition object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanToolDefinitionWithDefaults() *LLMObsSpanToolDefinition { + this := LLMObsSpanToolDefinition{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LLMObsSpanToolDefinition) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolDefinition) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LLMObsSpanToolDefinition) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LLMObsSpanToolDefinition) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsSpanToolDefinition) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolDefinition) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsSpanToolDefinition) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsSpanToolDefinition) SetName(v string) { + o.Name = &v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *LLMObsSpanToolDefinition) GetSchema() map[string]interface{} { + if o == nil || o.Schema == nil { + var ret map[string]interface{} + return ret + } + return o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolDefinition) GetSchemaOk() (*map[string]interface{}, bool) { + if o == nil || o.Schema == nil { + return nil, false + } + return &o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *LLMObsSpanToolDefinition) HasSchema() bool { + return o != nil && o.Schema != nil +} + +// SetSchema gets a reference to the given map[string]interface{} and assigns it to the Schema field. +func (o *LLMObsSpanToolDefinition) SetSchema(v map[string]interface{}) { + o.Schema = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *LLMObsSpanToolDefinition) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolDefinition) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *LLMObsSpanToolDefinition) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *LLMObsSpanToolDefinition) SetVersion(v string) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanToolDefinition) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Schema != nil { + toSerialize["schema"] = o.Schema + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanToolDefinition) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + Version *string `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name", "schema", "version"}) + } else { + return err + } + o.Description = all.Description + o.Name = all.Name + o.Schema = all.Schema + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_tool_result.go b/api/datadogV2/model_llm_obs_span_tool_result.go new file mode 100644 index 00000000000..baadbbde756 --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_tool_result.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanToolResult A result returned from a tool call during a span. +type LLMObsSpanToolResult struct { + // Name of the tool that produced this result. + Name *string `json:"name,omitempty"` + // Result value returned by the tool. + Result *string `json:"result,omitempty"` + // Identifier of the corresponding tool call. + ToolId *string `json:"tool_id,omitempty"` + // Type of the tool result. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpanToolResult instantiates a new LLMObsSpanToolResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpanToolResult() *LLMObsSpanToolResult { + this := LLMObsSpanToolResult{} + return &this +} + +// NewLLMObsSpanToolResultWithDefaults instantiates a new LLMObsSpanToolResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpanToolResultWithDefaults() *LLMObsSpanToolResult { + this := LLMObsSpanToolResult{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsSpanToolResult) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolResult) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsSpanToolResult) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsSpanToolResult) SetName(v string) { + o.Name = &v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *LLMObsSpanToolResult) GetResult() string { + if o == nil || o.Result == nil { + var ret string + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolResult) GetResultOk() (*string, bool) { + if o == nil || o.Result == nil { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *LLMObsSpanToolResult) HasResult() bool { + return o != nil && o.Result != nil +} + +// SetResult gets a reference to the given string and assigns it to the Result field. +func (o *LLMObsSpanToolResult) SetResult(v string) { + o.Result = &v +} + +// GetToolId returns the ToolId field value if set, zero value otherwise. +func (o *LLMObsSpanToolResult) GetToolId() string { + if o == nil || o.ToolId == nil { + var ret string + return ret + } + return *o.ToolId +} + +// GetToolIdOk returns a tuple with the ToolId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolResult) GetToolIdOk() (*string, bool) { + if o == nil || o.ToolId == nil { + return nil, false + } + return o.ToolId, true +} + +// HasToolId returns a boolean if a field has been set. +func (o *LLMObsSpanToolResult) HasToolId() bool { + return o != nil && o.ToolId != nil +} + +// SetToolId gets a reference to the given string and assigns it to the ToolId field. +func (o *LLMObsSpanToolResult) SetToolId(v string) { + o.ToolId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LLMObsSpanToolResult) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpanToolResult) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LLMObsSpanToolResult) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *LLMObsSpanToolResult) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpanToolResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Result != nil { + toSerialize["result"] = o.Result + } + if o.ToolId != nil { + toSerialize["tool_id"] = o.ToolId + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpanToolResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + Result *string `json:"result,omitempty"` + ToolId *string `json:"tool_id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "result", "tool_id", "type"}) + } else { + return err + } + o.Name = all.Name + o.Result = all.Result + o.ToolId = all.ToolId + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_span_type.go b/api/datadogV2/model_llm_obs_span_type.go new file mode 100644 index 00000000000..57efa05c33c --- /dev/null +++ b/api/datadogV2/model_llm_obs_span_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpanType Resource type for an LLM Observability span. +type LLMObsSpanType string + +// List of LLMObsSpanType. +const ( + LLMOBSSPANTYPE_SPAN LLMObsSpanType = "span" +) + +var allowedLLMObsSpanTypeEnumValues = []LLMObsSpanType{ + LLMOBSSPANTYPE_SPAN, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsSpanType) GetAllowedValues() []LLMObsSpanType { + return allowedLLMObsSpanTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsSpanType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsSpanType(value) + return nil +} + +// NewLLMObsSpanTypeFromValue returns a pointer to a valid LLMObsSpanType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsSpanTypeFromValue(v string) (*LLMObsSpanType, error) { + ev := LLMObsSpanType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsSpanType: valid values are %v", v, allowedLLMObsSpanTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsSpanType) IsValid() bool { + for _, existing := range allowedLLMObsSpanTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsSpanType value. +func (v LLMObsSpanType) Ptr() *LLMObsSpanType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_spans_response.go b/api/datadogV2/model_llm_obs_spans_response.go new file mode 100644 index 00000000000..8eb741e04b6 --- /dev/null +++ b/api/datadogV2/model_llm_obs_spans_response.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpansResponse Response containing a list of LLM Observability spans. +type LLMObsSpansResponse struct { + // List of spans matching the query. + Data []LLMObsSpanData `json:"data"` + // Pagination links accompanying the spans response. + Links *LLMObsSpansResponseLinks `json:"links,omitempty"` + // Metadata accompanying the spans response. + Meta LLMObsSpansResponseMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpansResponse instantiates a new LLMObsSpansResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpansResponse(data []LLMObsSpanData, meta LLMObsSpansResponseMeta) *LLMObsSpansResponse { + this := LLMObsSpansResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewLLMObsSpansResponseWithDefaults instantiates a new LLMObsSpansResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpansResponseWithDefaults() *LLMObsSpansResponse { + this := LLMObsSpansResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsSpansResponse) GetData() []LLMObsSpanData { + if o == nil { + var ret []LLMObsSpanData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponse) GetDataOk() (*[]LLMObsSpanData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsSpansResponse) SetData(v []LLMObsSpanData) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *LLMObsSpansResponse) GetLinks() LLMObsSpansResponseLinks { + if o == nil || o.Links == nil { + var ret LLMObsSpansResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponse) GetLinksOk() (*LLMObsSpansResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *LLMObsSpansResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given LLMObsSpansResponseLinks and assigns it to the Links field. +func (o *LLMObsSpansResponse) SetLinks(v LLMObsSpansResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value. +func (o *LLMObsSpansResponse) GetMeta() LLMObsSpansResponseMeta { + if o == nil { + var ret LLMObsSpansResponseMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponse) GetMetaOk() (*LLMObsSpansResponseMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *LLMObsSpansResponse) SetMeta(v LLMObsSpansResponseMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpansResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpansResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]LLMObsSpanData `json:"data"` + Links *LLMObsSpansResponseLinks `json:"links,omitempty"` + Meta *LLMObsSpansResponseMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_spans_response_links.go b/api/datadogV2/model_llm_obs_spans_response_links.go new file mode 100644 index 00000000000..0d4eeaf5e40 --- /dev/null +++ b/api/datadogV2/model_llm_obs_spans_response_links.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpansResponseLinks Pagination links accompanying the spans response. +type LLMObsSpansResponseLinks struct { + // URL to retrieve the next page of results. + Next *string `json:"next,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpansResponseLinks instantiates a new LLMObsSpansResponseLinks object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpansResponseLinks() *LLMObsSpansResponseLinks { + this := LLMObsSpansResponseLinks{} + return &this +} + +// NewLLMObsSpansResponseLinksWithDefaults instantiates a new LLMObsSpansResponseLinks object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpansResponseLinksWithDefaults() *LLMObsSpansResponseLinks { + this := LLMObsSpansResponseLinks{} + return &this +} + +// GetNext returns the Next field value if set, zero value otherwise. +func (o *LLMObsSpansResponseLinks) GetNext() string { + if o == nil || o.Next == nil { + var ret string + return ret + } + return *o.Next +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponseLinks) GetNextOk() (*string, bool) { + if o == nil || o.Next == nil { + return nil, false + } + return o.Next, true +} + +// HasNext returns a boolean if a field has been set. +func (o *LLMObsSpansResponseLinks) HasNext() bool { + return o != nil && o.Next != nil +} + +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *LLMObsSpansResponseLinks) SetNext(v string) { + o.Next = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpansResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Next != nil { + toSerialize["next"] = o.Next + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpansResponseLinks) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Next *string `json:"next,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"next"}) + } else { + return err + } + o.Next = all.Next + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_spans_response_meta.go b/api/datadogV2/model_llm_obs_spans_response_meta.go new file mode 100644 index 00000000000..5e5912ec115 --- /dev/null +++ b/api/datadogV2/model_llm_obs_spans_response_meta.go @@ -0,0 +1,206 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpansResponseMeta Metadata accompanying the spans response. +type LLMObsSpansResponseMeta struct { + // Time elapsed for the query in milliseconds. + Elapsed int64 `json:"elapsed"` + // Pagination cursor for the spans response. + Page LLMObsSpansResponsePage `json:"page"` + // Unique identifier for the request. + RequestId string `json:"request_id"` + // Status of the query execution. + Status string `json:"status"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpansResponseMeta instantiates a new LLMObsSpansResponseMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpansResponseMeta(elapsed int64, page LLMObsSpansResponsePage, requestId string, status string) *LLMObsSpansResponseMeta { + this := LLMObsSpansResponseMeta{} + this.Elapsed = elapsed + this.Page = page + this.RequestId = requestId + this.Status = status + return &this +} + +// NewLLMObsSpansResponseMetaWithDefaults instantiates a new LLMObsSpansResponseMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpansResponseMetaWithDefaults() *LLMObsSpansResponseMeta { + this := LLMObsSpansResponseMeta{} + return &this +} + +// GetElapsed returns the Elapsed field value. +func (o *LLMObsSpansResponseMeta) GetElapsed() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Elapsed +} + +// GetElapsedOk returns a tuple with the Elapsed field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponseMeta) GetElapsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Elapsed, true +} + +// SetElapsed sets field value. +func (o *LLMObsSpansResponseMeta) SetElapsed(v int64) { + o.Elapsed = v +} + +// GetPage returns the Page field value. +func (o *LLMObsSpansResponseMeta) GetPage() LLMObsSpansResponsePage { + if o == nil { + var ret LLMObsSpansResponsePage + return ret + } + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponseMeta) GetPageOk() (*LLMObsSpansResponsePage, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value. +func (o *LLMObsSpansResponseMeta) SetPage(v LLMObsSpansResponsePage) { + o.Page = v +} + +// GetRequestId returns the RequestId field value. +func (o *LLMObsSpansResponseMeta) GetRequestId() string { + if o == nil { + var ret string + return ret + } + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponseMeta) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value. +func (o *LLMObsSpansResponseMeta) SetRequestId(v string) { + o.RequestId = v +} + +// GetStatus returns the Status field value. +func (o *LLMObsSpansResponseMeta) GetStatus() string { + if o == nil { + var ret string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponseMeta) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *LLMObsSpansResponseMeta) SetStatus(v string) { + o.Status = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpansResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["elapsed"] = o.Elapsed + toSerialize["page"] = o.Page + toSerialize["request_id"] = o.RequestId + toSerialize["status"] = o.Status + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpansResponseMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Elapsed *int64 `json:"elapsed"` + Page *LLMObsSpansResponsePage `json:"page"` + RequestId *string `json:"request_id"` + Status *string `json:"status"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Elapsed == nil { + return fmt.Errorf("required field elapsed missing") + } + if all.Page == nil { + return fmt.Errorf("required field page missing") + } + if all.RequestId == nil { + return fmt.Errorf("required field request_id missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"elapsed", "page", "request_id", "status"}) + } else { + return err + } + + hasInvalidField := false + o.Elapsed = *all.Elapsed + if all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = *all.Page + o.RequestId = *all.RequestId + o.Status = *all.Status + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_spans_response_page.go b/api/datadogV2/model_llm_obs_spans_response_page.go new file mode 100644 index 00000000000..7ac73071f6e --- /dev/null +++ b/api/datadogV2/model_llm_obs_spans_response_page.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsSpansResponsePage Pagination cursor for the spans response. +type LLMObsSpansResponsePage struct { + // Cursor to retrieve the next page of results. Absent when there are no more results. + After *string `json:"after,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsSpansResponsePage instantiates a new LLMObsSpansResponsePage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsSpansResponsePage() *LLMObsSpansResponsePage { + this := LLMObsSpansResponsePage{} + return &this +} + +// NewLLMObsSpansResponsePageWithDefaults instantiates a new LLMObsSpansResponsePage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsSpansResponsePageWithDefaults() *LLMObsSpansResponsePage { + this := LLMObsSpansResponsePage{} + return &this +} + +// GetAfter returns the After field value if set, zero value otherwise. +func (o *LLMObsSpansResponsePage) GetAfter() string { + if o == nil || o.After == nil { + var ret string + return ret + } + return *o.After +} + +// GetAfterOk returns a tuple with the After field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsSpansResponsePage) GetAfterOk() (*string, bool) { + if o == nil || o.After == nil { + return nil, false + } + return o.After, true +} + +// HasAfter returns a boolean if a field has been set. +func (o *LLMObsSpansResponsePage) HasAfter() bool { + return o != nil && o.After != nil +} + +// SetAfter gets a reference to the given string and assigns it to the After field. +func (o *LLMObsSpansResponsePage) SetAfter(v string) { + o.After = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsSpansResponsePage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.After != nil { + toSerialize["after"] = o.After + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsSpansResponsePage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + After *string `json:"after,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"after"}) + } else { + return err + } + o.After = all.After + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_trace_annotated_interaction_item.go b/api/datadogV2/model_llm_obs_trace_annotated_interaction_item.go new file mode 100644 index 00000000000..091d4f598e7 --- /dev/null +++ b/api/datadogV2/model_llm_obs_trace_annotated_interaction_item.go @@ -0,0 +1,280 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsTraceAnnotatedInteractionItem A trace, experiment trace, or session interaction with its associated annotations. +type LLMObsTraceAnnotatedInteractionItem struct { + // List of annotations for this interaction. + Annotations []LLMObsAnnotationItem `json:"annotations"` + // Upstream entity identifier supplied by the caller. + ContentId string `json:"content_id"` + // Timestamp when the interaction was added to the queue. + CreatedAt time.Time `json:"created_at"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Timestamp when the interaction was last updated. + ModifiedAt time.Time `json:"modified_at"` + // Type of an upstream-entity interaction. + Type LLMObsTraceInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsTraceAnnotatedInteractionItem instantiates a new LLMObsTraceAnnotatedInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsTraceAnnotatedInteractionItem(annotations []LLMObsAnnotationItem, contentId string, createdAt time.Time, id string, modifiedAt time.Time, typeVar LLMObsTraceInteractionType) *LLMObsTraceAnnotatedInteractionItem { + this := LLMObsTraceAnnotatedInteractionItem{} + this.Annotations = annotations + this.ContentId = contentId + this.CreatedAt = createdAt + this.Id = id + this.ModifiedAt = modifiedAt + this.Type = typeVar + return &this +} + +// NewLLMObsTraceAnnotatedInteractionItemWithDefaults instantiates a new LLMObsTraceAnnotatedInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsTraceAnnotatedInteractionItemWithDefaults() *LLMObsTraceAnnotatedInteractionItem { + this := LLMObsTraceAnnotatedInteractionItem{} + return &this +} + +// GetAnnotations returns the Annotations field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetAnnotations() []LLMObsAnnotationItem { + if o == nil { + var ret []LLMObsAnnotationItem + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetAnnotationsOk() (*[]LLMObsAnnotationItem, bool) { + if o == nil { + return nil, false + } + return &o.Annotations, true +} + +// SetAnnotations sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetAnnotations(v []LLMObsAnnotationItem) { + o.Annotations = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetContentId(v string) { + o.ContentId = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetId(v string) { + o.Id = v +} + +// GetModifiedAt returns the ModifiedAt field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetType returns the Type field value. +func (o *LLMObsTraceAnnotatedInteractionItem) GetType() LLMObsTraceInteractionType { + if o == nil { + var ret LLMObsTraceInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceAnnotatedInteractionItem) GetTypeOk() (*LLMObsTraceInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsTraceAnnotatedInteractionItem) SetType(v LLMObsTraceInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsTraceAnnotatedInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["annotations"] = o.Annotations + toSerialize["content_id"] = o.ContentId + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["id"] = o.Id + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsTraceAnnotatedInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Annotations *[]LLMObsAnnotationItem `json:"annotations"` + ContentId *string `json:"content_id"` + CreatedAt *time.Time `json:"created_at"` + Id *string `json:"id"` + ModifiedAt *time.Time `json:"modified_at"` + Type *LLMObsTraceInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Annotations == nil { + return fmt.Errorf("required field annotations missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.ModifiedAt == nil { + return fmt.Errorf("required field modified_at missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"annotations", "content_id", "created_at", "id", "modified_at", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Annotations = *all.Annotations + o.ContentId = *all.ContentId + o.CreatedAt = *all.CreatedAt + o.Id = *all.Id + o.ModifiedAt = *all.ModifiedAt + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_trace_interaction_item.go b/api/datadogV2/model_llm_obs_trace_interaction_item.go new file mode 100644 index 00000000000..8f5a899c832 --- /dev/null +++ b/api/datadogV2/model_llm_obs_trace_interaction_item.go @@ -0,0 +1,143 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsTraceInteractionItem An interaction that references an upstream trace, experiment trace, or session. +type LLMObsTraceInteractionItem struct { + // Upstream entity identifier (trace, experiment trace, or session ID). + ContentId string `json:"content_id"` + // Type of an upstream-entity interaction. + Type LLMObsTraceInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsTraceInteractionItem instantiates a new LLMObsTraceInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsTraceInteractionItem(contentId string, typeVar LLMObsTraceInteractionType) *LLMObsTraceInteractionItem { + this := LLMObsTraceInteractionItem{} + this.ContentId = contentId + this.Type = typeVar + return &this +} + +// NewLLMObsTraceInteractionItemWithDefaults instantiates a new LLMObsTraceInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsTraceInteractionItemWithDefaults() *LLMObsTraceInteractionItem { + this := LLMObsTraceInteractionItem{} + return &this +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsTraceInteractionItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsTraceInteractionItem) SetContentId(v string) { + o.ContentId = v +} + +// GetType returns the Type field value. +func (o *LLMObsTraceInteractionItem) GetType() LLMObsTraceInteractionType { + if o == nil { + var ret LLMObsTraceInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionItem) GetTypeOk() (*LLMObsTraceInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsTraceInteractionItem) SetType(v LLMObsTraceInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsTraceInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["content_id"] = o.ContentId + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsTraceInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentId *string `json:"content_id"` + Type *LLMObsTraceInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.ContentId = *all.ContentId + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_trace_interaction_response_item.go b/api/datadogV2/model_llm_obs_trace_interaction_response_item.go new file mode 100644 index 00000000000..7d04d353cbb --- /dev/null +++ b/api/datadogV2/model_llm_obs_trace_interaction_response_item.go @@ -0,0 +1,280 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsTraceInteractionResponseItem A trace, experiment trace, or session interaction result. +type LLMObsTraceInteractionResponseItem struct { + // Whether this interaction already existed in the queue. + AlreadyExisted bool `json:"already_existed"` + // Upstream entity identifier supplied by the caller. + ContentId string `json:"content_id"` + // Timestamp when the interaction was added to the queue. + CreatedAt time.Time `json:"created_at"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Timestamp when the interaction was last updated. + ModifiedAt time.Time `json:"modified_at"` + // Type of an upstream-entity interaction. + Type LLMObsTraceInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsTraceInteractionResponseItem instantiates a new LLMObsTraceInteractionResponseItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsTraceInteractionResponseItem(alreadyExisted bool, contentId string, createdAt time.Time, id string, modifiedAt time.Time, typeVar LLMObsTraceInteractionType) *LLMObsTraceInteractionResponseItem { + this := LLMObsTraceInteractionResponseItem{} + this.AlreadyExisted = alreadyExisted + this.ContentId = contentId + this.CreatedAt = createdAt + this.Id = id + this.ModifiedAt = modifiedAt + this.Type = typeVar + return &this +} + +// NewLLMObsTraceInteractionResponseItemWithDefaults instantiates a new LLMObsTraceInteractionResponseItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsTraceInteractionResponseItemWithDefaults() *LLMObsTraceInteractionResponseItem { + this := LLMObsTraceInteractionResponseItem{} + return &this +} + +// GetAlreadyExisted returns the AlreadyExisted field value. +func (o *LLMObsTraceInteractionResponseItem) GetAlreadyExisted() bool { + if o == nil { + var ret bool + return ret + } + return o.AlreadyExisted +} + +// GetAlreadyExistedOk returns a tuple with the AlreadyExisted field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetAlreadyExistedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AlreadyExisted, true +} + +// SetAlreadyExisted sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetAlreadyExisted(v bool) { + o.AlreadyExisted = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsTraceInteractionResponseItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetContentId(v string) { + o.ContentId = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *LLMObsTraceInteractionResponseItem) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value. +func (o *LLMObsTraceInteractionResponseItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetId(v string) { + o.Id = v +} + +// GetModifiedAt returns the ModifiedAt field value. +func (o *LLMObsTraceInteractionResponseItem) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetType returns the Type field value. +func (o *LLMObsTraceInteractionResponseItem) GetType() LLMObsTraceInteractionType { + if o == nil { + var ret LLMObsTraceInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsTraceInteractionResponseItem) GetTypeOk() (*LLMObsTraceInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsTraceInteractionResponseItem) SetType(v LLMObsTraceInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsTraceInteractionResponseItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["already_existed"] = o.AlreadyExisted + toSerialize["content_id"] = o.ContentId + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["id"] = o.Id + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsTraceInteractionResponseItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AlreadyExisted *bool `json:"already_existed"` + ContentId *string `json:"content_id"` + CreatedAt *time.Time `json:"created_at"` + Id *string `json:"id"` + ModifiedAt *time.Time `json:"modified_at"` + Type *LLMObsTraceInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AlreadyExisted == nil { + return fmt.Errorf("required field already_existed missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.ModifiedAt == nil { + return fmt.Errorf("required field modified_at missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"already_existed", "content_id", "created_at", "id", "modified_at", "type"}) + } else { + return err + } + + hasInvalidField := false + o.AlreadyExisted = *all.AlreadyExisted + o.ContentId = *all.ContentId + o.CreatedAt = *all.CreatedAt + o.Id = *all.Id + o.ModifiedAt = *all.ModifiedAt + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_trace_interaction_type.go b/api/datadogV2/model_llm_obs_trace_interaction_type.go new file mode 100644 index 00000000000..22956af8892 --- /dev/null +++ b/api/datadogV2/model_llm_obs_trace_interaction_type.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsTraceInteractionType Type of an upstream-entity interaction. +type LLMObsTraceInteractionType string + +// List of LLMObsTraceInteractionType. +const ( + LLMOBSTRACEINTERACTIONTYPE_TRACE LLMObsTraceInteractionType = "trace" + LLMOBSTRACEINTERACTIONTYPE_EXPERIMENT_TRACE LLMObsTraceInteractionType = "experiment_trace" + LLMOBSTRACEINTERACTIONTYPE_SESSION LLMObsTraceInteractionType = "session" +) + +var allowedLLMObsTraceInteractionTypeEnumValues = []LLMObsTraceInteractionType{ + LLMOBSTRACEINTERACTIONTYPE_TRACE, + LLMOBSTRACEINTERACTIONTYPE_EXPERIMENT_TRACE, + LLMOBSTRACEINTERACTIONTYPE_SESSION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsTraceInteractionType) GetAllowedValues() []LLMObsTraceInteractionType { + return allowedLLMObsTraceInteractionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsTraceInteractionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsTraceInteractionType(value) + return nil +} + +// NewLLMObsTraceInteractionTypeFromValue returns a pointer to a valid LLMObsTraceInteractionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsTraceInteractionTypeFromValue(v string) (*LLMObsTraceInteractionType, error) { + ev := LLMObsTraceInteractionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsTraceInteractionType: valid values are %v", v, allowedLLMObsTraceInteractionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsTraceInteractionType) IsValid() bool { + for _, existing := range allowedLLMObsTraceInteractionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsTraceInteractionType value. +func (v LLMObsTraceInteractionType) Ptr() *LLMObsTraceInteractionType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_vertex_ai_metadata.go b/api/datadogV2/model_llm_obs_vertex_ai_metadata.go new file mode 100644 index 00000000000..7b3ecad0930 --- /dev/null +++ b/api/datadogV2/model_llm_obs_vertex_ai_metadata.go @@ -0,0 +1,172 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsVertexAIMetadata Vertex AI-specific metadata for an integration account or inference request. +type LLMObsVertexAIMetadata struct { + // The Vertex AI region. + Location *string `json:"location,omitempty"` + // The Google Cloud project ID. + Project *string `json:"project,omitempty"` + // List of Google Cloud project IDs available to the service account. + ProjectIds []string `json:"project_ids,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsVertexAIMetadata instantiates a new LLMObsVertexAIMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsVertexAIMetadata() *LLMObsVertexAIMetadata { + this := LLMObsVertexAIMetadata{} + return &this +} + +// NewLLMObsVertexAIMetadataWithDefaults instantiates a new LLMObsVertexAIMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsVertexAIMetadataWithDefaults() *LLMObsVertexAIMetadata { + this := LLMObsVertexAIMetadata{} + return &this +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *LLMObsVertexAIMetadata) GetLocation() string { + if o == nil || o.Location == nil { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsVertexAIMetadata) GetLocationOk() (*string, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *LLMObsVertexAIMetadata) HasLocation() bool { + return o != nil && o.Location != nil +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *LLMObsVertexAIMetadata) SetLocation(v string) { + o.Location = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *LLMObsVertexAIMetadata) GetProject() string { + if o == nil || o.Project == nil { + var ret string + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsVertexAIMetadata) GetProjectOk() (*string, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *LLMObsVertexAIMetadata) HasProject() bool { + return o != nil && o.Project != nil +} + +// SetProject gets a reference to the given string and assigns it to the Project field. +func (o *LLMObsVertexAIMetadata) SetProject(v string) { + o.Project = &v +} + +// GetProjectIds returns the ProjectIds field value if set, zero value otherwise. +func (o *LLMObsVertexAIMetadata) GetProjectIds() []string { + if o == nil || o.ProjectIds == nil { + var ret []string + return ret + } + return o.ProjectIds +} + +// GetProjectIdsOk returns a tuple with the ProjectIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsVertexAIMetadata) GetProjectIdsOk() (*[]string, bool) { + if o == nil || o.ProjectIds == nil { + return nil, false + } + return &o.ProjectIds, true +} + +// HasProjectIds returns a boolean if a field has been set. +func (o *LLMObsVertexAIMetadata) HasProjectIds() bool { + return o != nil && o.ProjectIds != nil +} + +// SetProjectIds gets a reference to the given []string and assigns it to the ProjectIds field. +func (o *LLMObsVertexAIMetadata) SetProjectIds(v []string) { + o.ProjectIds = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsVertexAIMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.Project != nil { + toSerialize["project"] = o.Project + } + if o.ProjectIds != nil { + toSerialize["project_ids"] = o.ProjectIds + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsVertexAIMetadata) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Location *string `json:"location,omitempty"` + Project *string `json:"project,omitempty"` + ProjectIds []string `json:"project_ids,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"location", "project", "project_ids"}) + } else { + return err + } + o.Location = all.Location + o.Project = all.Project + o.ProjectIds = all.ProjectIds + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window.go b/api/datadogV2/model_maintenance_window.go new file mode 100644 index 00000000000..0f27d67c615 --- /dev/null +++ b/api/datadogV2/model_maintenance_window.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindow A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query. +type MaintenanceWindow struct { + // Attributes of a maintenance window, including its schedule and the query that determines which cases are affected. + Attributes MaintenanceWindowAttributes `json:"attributes"` + // The maintenance window's identifier. + Id string `json:"id"` + // JSON:API resource type for maintenance windows. + Type MaintenanceWindowResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindow instantiates a new MaintenanceWindow object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindow(attributes MaintenanceWindowAttributes, id string, typeVar MaintenanceWindowResourceType) *MaintenanceWindow { + this := MaintenanceWindow{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewMaintenanceWindowWithDefaults instantiates a new MaintenanceWindow object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowWithDefaults() *MaintenanceWindow { + this := MaintenanceWindow{} + var typeVar MaintenanceWindowResourceType = MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *MaintenanceWindow) GetAttributes() MaintenanceWindowAttributes { + if o == nil { + var ret MaintenanceWindowAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindow) GetAttributesOk() (*MaintenanceWindowAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *MaintenanceWindow) SetAttributes(v MaintenanceWindowAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *MaintenanceWindow) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindow) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *MaintenanceWindow) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *MaintenanceWindow) GetType() MaintenanceWindowResourceType { + if o == nil { + var ret MaintenanceWindowResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindow) GetTypeOk() (*MaintenanceWindowResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *MaintenanceWindow) SetType(v MaintenanceWindowResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindow) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindow) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *MaintenanceWindowAttributes `json:"attributes"` + Id *string `json:"id"` + Type *MaintenanceWindowResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_attributes.go b/api/datadogV2/model_maintenance_window_attributes.go new file mode 100644 index 00000000000..12a01d6a8a9 --- /dev/null +++ b/api/datadogV2/model_maintenance_window_attributes.go @@ -0,0 +1,276 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowAttributes Attributes of a maintenance window, including its schedule and the query that determines which cases are affected. +type MaintenanceWindowAttributes struct { + // The UUID of the user who created this maintenance window. Read-only. + CreatedBy *string `json:"created_by,omitempty"` + // The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes. + EndAt time.Time `json:"end_at"` + // A human-readable name for the maintenance window (for example, `Database migration - Dec 15`). + Name string `json:"name"` + // A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar. + Query string `json:"query"` + // The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed. + StartAt time.Time `json:"start_at"` + // The UUID of the user who last modified this maintenance window. Read-only. + UpdatedBy *string `json:"updated_by,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowAttributes instantiates a new MaintenanceWindowAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowAttributes(endAt time.Time, name string, query string, startAt time.Time) *MaintenanceWindowAttributes { + this := MaintenanceWindowAttributes{} + this.EndAt = endAt + this.Name = name + this.Query = query + this.StartAt = startAt + return &this +} + +// NewMaintenanceWindowAttributesWithDefaults instantiates a new MaintenanceWindowAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowAttributesWithDefaults() *MaintenanceWindowAttributes { + this := MaintenanceWindowAttributes{} + return &this +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *MaintenanceWindowAttributes) GetCreatedBy() string { + if o == nil || o.CreatedBy == nil { + var ret string + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetCreatedByOk() (*string, bool) { + if o == nil || o.CreatedBy == nil { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *MaintenanceWindowAttributes) HasCreatedBy() bool { + return o != nil && o.CreatedBy != nil +} + +// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field. +func (o *MaintenanceWindowAttributes) SetCreatedBy(v string) { + o.CreatedBy = &v +} + +// GetEndAt returns the EndAt field value. +func (o *MaintenanceWindowAttributes) GetEndAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetEndAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndAt, true +} + +// SetEndAt sets field value. +func (o *MaintenanceWindowAttributes) SetEndAt(v time.Time) { + o.EndAt = v +} + +// GetName returns the Name field value. +func (o *MaintenanceWindowAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *MaintenanceWindowAttributes) SetName(v string) { + o.Name = v +} + +// GetQuery returns the Query field value. +func (o *MaintenanceWindowAttributes) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *MaintenanceWindowAttributes) SetQuery(v string) { + o.Query = v +} + +// GetStartAt returns the StartAt field value. +func (o *MaintenanceWindowAttributes) GetStartAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetStartAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartAt, true +} + +// SetStartAt sets field value. +func (o *MaintenanceWindowAttributes) SetStartAt(v time.Time) { + o.StartAt = v +} + +// GetUpdatedBy returns the UpdatedBy field value if set, zero value otherwise. +func (o *MaintenanceWindowAttributes) GetUpdatedBy() string { + if o == nil || o.UpdatedBy == nil { + var ret string + return ret + } + return *o.UpdatedBy +} + +// GetUpdatedByOk returns a tuple with the UpdatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowAttributes) GetUpdatedByOk() (*string, bool) { + if o == nil || o.UpdatedBy == nil { + return nil, false + } + return o.UpdatedBy, true +} + +// HasUpdatedBy returns a boolean if a field has been set. +func (o *MaintenanceWindowAttributes) HasUpdatedBy() bool { + return o != nil && o.UpdatedBy != nil +} + +// SetUpdatedBy gets a reference to the given string and assigns it to the UpdatedBy field. +func (o *MaintenanceWindowAttributes) SetUpdatedBy(v string) { + o.UpdatedBy = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedBy != nil { + toSerialize["created_by"] = o.CreatedBy + } + if o.EndAt.Nanosecond() == 0 { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["name"] = o.Name + toSerialize["query"] = o.Query + if o.StartAt.Nanosecond() == 0 { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.UpdatedBy != nil { + toSerialize["updated_by"] = o.UpdatedBy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedBy *string `json:"created_by,omitempty"` + EndAt *time.Time `json:"end_at"` + Name *string `json:"name"` + Query *string `json:"query"` + StartAt *time.Time `json:"start_at"` + UpdatedBy *string `json:"updated_by,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.EndAt == nil { + return fmt.Errorf("required field end_at missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + if all.StartAt == nil { + return fmt.Errorf("required field start_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_by", "end_at", "name", "query", "start_at", "updated_by"}) + } else { + return err + } + o.CreatedBy = all.CreatedBy + o.EndAt = *all.EndAt + o.Name = *all.Name + o.Query = *all.Query + o.StartAt = *all.StartAt + o.UpdatedBy = all.UpdatedBy + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_create.go b/api/datadogV2/model_maintenance_window_create.go new file mode 100644 index 00000000000..8565e855c8d --- /dev/null +++ b/api/datadogV2/model_maintenance_window_create.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowCreate Data object for creating a maintenance window. +type MaintenanceWindowCreate struct { + // Attributes required to create a maintenance window. + Attributes MaintenanceWindowCreateAttributes `json:"attributes"` + // JSON:API resource type for maintenance windows. + Type MaintenanceWindowResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowCreate instantiates a new MaintenanceWindowCreate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowCreate(attributes MaintenanceWindowCreateAttributes, typeVar MaintenanceWindowResourceType) *MaintenanceWindowCreate { + this := MaintenanceWindowCreate{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewMaintenanceWindowCreateWithDefaults instantiates a new MaintenanceWindowCreate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowCreateWithDefaults() *MaintenanceWindowCreate { + this := MaintenanceWindowCreate{} + var typeVar MaintenanceWindowResourceType = MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *MaintenanceWindowCreate) GetAttributes() MaintenanceWindowCreateAttributes { + if o == nil { + var ret MaintenanceWindowCreateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreate) GetAttributesOk() (*MaintenanceWindowCreateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *MaintenanceWindowCreate) SetAttributes(v MaintenanceWindowCreateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *MaintenanceWindowCreate) GetType() MaintenanceWindowResourceType { + if o == nil { + var ret MaintenanceWindowResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreate) GetTypeOk() (*MaintenanceWindowResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *MaintenanceWindowCreate) SetType(v MaintenanceWindowResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowCreate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowCreate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *MaintenanceWindowCreateAttributes `json:"attributes"` + Type *MaintenanceWindowResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_create_attributes.go b/api/datadogV2/model_maintenance_window_create_attributes.go new file mode 100644 index 00000000000..d47ab2d0b50 --- /dev/null +++ b/api/datadogV2/model_maintenance_window_create_attributes.go @@ -0,0 +1,206 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowCreateAttributes Attributes required to create a maintenance window. +type MaintenanceWindowCreateAttributes struct { + // The end time of the maintenance window. + EndAt time.Time `json:"end_at"` + // The name of the maintenance window. + Name string `json:"name"` + // The query to filter event management cases for this maintenance window. + Query string `json:"query"` + // The start time of the maintenance window. + StartAt time.Time `json:"start_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowCreateAttributes instantiates a new MaintenanceWindowCreateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowCreateAttributes(endAt time.Time, name string, query string, startAt time.Time) *MaintenanceWindowCreateAttributes { + this := MaintenanceWindowCreateAttributes{} + this.EndAt = endAt + this.Name = name + this.Query = query + this.StartAt = startAt + return &this +} + +// NewMaintenanceWindowCreateAttributesWithDefaults instantiates a new MaintenanceWindowCreateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowCreateAttributesWithDefaults() *MaintenanceWindowCreateAttributes { + this := MaintenanceWindowCreateAttributes{} + return &this +} + +// GetEndAt returns the EndAt field value. +func (o *MaintenanceWindowCreateAttributes) GetEndAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreateAttributes) GetEndAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndAt, true +} + +// SetEndAt sets field value. +func (o *MaintenanceWindowCreateAttributes) SetEndAt(v time.Time) { + o.EndAt = v +} + +// GetName returns the Name field value. +func (o *MaintenanceWindowCreateAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreateAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *MaintenanceWindowCreateAttributes) SetName(v string) { + o.Name = v +} + +// GetQuery returns the Query field value. +func (o *MaintenanceWindowCreateAttributes) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreateAttributes) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *MaintenanceWindowCreateAttributes) SetQuery(v string) { + o.Query = v +} + +// GetStartAt returns the StartAt field value. +func (o *MaintenanceWindowCreateAttributes) GetStartAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreateAttributes) GetStartAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartAt, true +} + +// SetStartAt sets field value. +func (o *MaintenanceWindowCreateAttributes) SetStartAt(v time.Time) { + o.StartAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowCreateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.EndAt.Nanosecond() == 0 { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["name"] = o.Name + toSerialize["query"] = o.Query + if o.StartAt.Nanosecond() == 0 { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + EndAt *time.Time `json:"end_at"` + Name *string `json:"name"` + Query *string `json:"query"` + StartAt *time.Time `json:"start_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.EndAt == nil { + return fmt.Errorf("required field end_at missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + if all.StartAt == nil { + return fmt.Errorf("required field start_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"end_at", "name", "query", "start_at"}) + } else { + return err + } + o.EndAt = *all.EndAt + o.Name = *all.Name + o.Query = *all.Query + o.StartAt = *all.StartAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_create_request.go b/api/datadogV2/model_maintenance_window_create_request.go new file mode 100644 index 00000000000..5c7b222dfef --- /dev/null +++ b/api/datadogV2/model_maintenance_window_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowCreateRequest Request payload for creating a maintenance window. +type MaintenanceWindowCreateRequest struct { + // Data object for creating a maintenance window. + Data MaintenanceWindowCreate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowCreateRequest instantiates a new MaintenanceWindowCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowCreateRequest(data MaintenanceWindowCreate) *MaintenanceWindowCreateRequest { + this := MaintenanceWindowCreateRequest{} + this.Data = data + return &this +} + +// NewMaintenanceWindowCreateRequestWithDefaults instantiates a new MaintenanceWindowCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowCreateRequestWithDefaults() *MaintenanceWindowCreateRequest { + this := MaintenanceWindowCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *MaintenanceWindowCreateRequest) GetData() MaintenanceWindowCreate { + if o == nil { + var ret MaintenanceWindowCreate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowCreateRequest) GetDataOk() (*MaintenanceWindowCreate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *MaintenanceWindowCreateRequest) SetData(v MaintenanceWindowCreate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *MaintenanceWindowCreate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_resource_type.go b/api/datadogV2/model_maintenance_window_resource_type.go new file mode 100644 index 00000000000..f66299287ec --- /dev/null +++ b/api/datadogV2/model_maintenance_window_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowResourceType JSON:API resource type for maintenance windows. +type MaintenanceWindowResourceType string + +// List of MaintenanceWindowResourceType. +const ( + MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW MaintenanceWindowResourceType = "maintenance_window" +) + +var allowedMaintenanceWindowResourceTypeEnumValues = []MaintenanceWindowResourceType{ + MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *MaintenanceWindowResourceType) GetAllowedValues() []MaintenanceWindowResourceType { + return allowedMaintenanceWindowResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *MaintenanceWindowResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = MaintenanceWindowResourceType(value) + return nil +} + +// NewMaintenanceWindowResourceTypeFromValue returns a pointer to a valid MaintenanceWindowResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewMaintenanceWindowResourceTypeFromValue(v string) (*MaintenanceWindowResourceType, error) { + ev := MaintenanceWindowResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for MaintenanceWindowResourceType: valid values are %v", v, allowedMaintenanceWindowResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v MaintenanceWindowResourceType) IsValid() bool { + for _, existing := range allowedMaintenanceWindowResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MaintenanceWindowResourceType value. +func (v MaintenanceWindowResourceType) Ptr() *MaintenanceWindowResourceType { + return &v +} diff --git a/api/datadogV2/model_maintenance_window_response.go b/api/datadogV2/model_maintenance_window_response.go new file mode 100644 index 00000000000..488fe6b1a46 --- /dev/null +++ b/api/datadogV2/model_maintenance_window_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowResponse Response containing a single maintenance window. +type MaintenanceWindowResponse struct { + // A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query. + Data MaintenanceWindow `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowResponse instantiates a new MaintenanceWindowResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowResponse(data MaintenanceWindow) *MaintenanceWindowResponse { + this := MaintenanceWindowResponse{} + this.Data = data + return &this +} + +// NewMaintenanceWindowResponseWithDefaults instantiates a new MaintenanceWindowResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowResponseWithDefaults() *MaintenanceWindowResponse { + this := MaintenanceWindowResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *MaintenanceWindowResponse) GetData() MaintenanceWindow { + if o == nil { + var ret MaintenanceWindow + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowResponse) GetDataOk() (*MaintenanceWindow, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *MaintenanceWindowResponse) SetData(v MaintenanceWindow) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *MaintenanceWindow `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_update.go b/api/datadogV2/model_maintenance_window_update.go new file mode 100644 index 00000000000..c6c940e2e39 --- /dev/null +++ b/api/datadogV2/model_maintenance_window_update.go @@ -0,0 +1,151 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowUpdate Data object for updating a maintenance window. +type MaintenanceWindowUpdate struct { + // Attributes that can be updated on a maintenance window. All fields are optional; only provided fields are changed. + Attributes *MaintenanceWindowUpdateAttributes `json:"attributes,omitempty"` + // JSON:API resource type for maintenance windows. + Type MaintenanceWindowResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowUpdate instantiates a new MaintenanceWindowUpdate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowUpdate(typeVar MaintenanceWindowResourceType) *MaintenanceWindowUpdate { + this := MaintenanceWindowUpdate{} + this.Type = typeVar + return &this +} + +// NewMaintenanceWindowUpdateWithDefaults instantiates a new MaintenanceWindowUpdate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowUpdateWithDefaults() *MaintenanceWindowUpdate { + this := MaintenanceWindowUpdate{} + var typeVar MaintenanceWindowResourceType = MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *MaintenanceWindowUpdate) GetAttributes() MaintenanceWindowUpdateAttributes { + if o == nil || o.Attributes == nil { + var ret MaintenanceWindowUpdateAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdate) GetAttributesOk() (*MaintenanceWindowUpdateAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *MaintenanceWindowUpdate) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given MaintenanceWindowUpdateAttributes and assigns it to the Attributes field. +func (o *MaintenanceWindowUpdate) SetAttributes(v MaintenanceWindowUpdateAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value. +func (o *MaintenanceWindowUpdate) GetType() MaintenanceWindowResourceType { + if o == nil { + var ret MaintenanceWindowResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdate) GetTypeOk() (*MaintenanceWindowResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *MaintenanceWindowUpdate) SetType(v MaintenanceWindowResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowUpdate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *MaintenanceWindowUpdateAttributes `json:"attributes,omitempty"` + Type *MaintenanceWindowResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_update_attributes.go b/api/datadogV2/model_maintenance_window_update_attributes.go new file mode 100644 index 00000000000..97cc11a343f --- /dev/null +++ b/api/datadogV2/model_maintenance_window_update_attributes.go @@ -0,0 +1,217 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowUpdateAttributes Attributes that can be updated on a maintenance window. All fields are optional; only provided fields are changed. +type MaintenanceWindowUpdateAttributes struct { + // The end time of the maintenance window. + EndAt *time.Time `json:"end_at,omitempty"` + // The name of the maintenance window. + Name *string `json:"name,omitempty"` + // The query to filter event management cases for this maintenance window. + Query *string `json:"query,omitempty"` + // The start time of the maintenance window. + StartAt *time.Time `json:"start_at,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowUpdateAttributes instantiates a new MaintenanceWindowUpdateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowUpdateAttributes() *MaintenanceWindowUpdateAttributes { + this := MaintenanceWindowUpdateAttributes{} + return &this +} + +// NewMaintenanceWindowUpdateAttributesWithDefaults instantiates a new MaintenanceWindowUpdateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowUpdateAttributesWithDefaults() *MaintenanceWindowUpdateAttributes { + this := MaintenanceWindowUpdateAttributes{} + return &this +} + +// GetEndAt returns the EndAt field value if set, zero value otherwise. +func (o *MaintenanceWindowUpdateAttributes) GetEndAt() time.Time { + if o == nil || o.EndAt == nil { + var ret time.Time + return ret + } + return *o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdateAttributes) GetEndAtOk() (*time.Time, bool) { + if o == nil || o.EndAt == nil { + return nil, false + } + return o.EndAt, true +} + +// HasEndAt returns a boolean if a field has been set. +func (o *MaintenanceWindowUpdateAttributes) HasEndAt() bool { + return o != nil && o.EndAt != nil +} + +// SetEndAt gets a reference to the given time.Time and assigns it to the EndAt field. +func (o *MaintenanceWindowUpdateAttributes) SetEndAt(v time.Time) { + o.EndAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *MaintenanceWindowUpdateAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdateAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *MaintenanceWindowUpdateAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *MaintenanceWindowUpdateAttributes) SetName(v string) { + o.Name = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *MaintenanceWindowUpdateAttributes) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdateAttributes) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *MaintenanceWindowUpdateAttributes) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *MaintenanceWindowUpdateAttributes) SetQuery(v string) { + o.Query = &v +} + +// GetStartAt returns the StartAt field value if set, zero value otherwise. +func (o *MaintenanceWindowUpdateAttributes) GetStartAt() time.Time { + if o == nil || o.StartAt == nil { + var ret time.Time + return ret + } + return *o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdateAttributes) GetStartAtOk() (*time.Time, bool) { + if o == nil || o.StartAt == nil { + return nil, false + } + return o.StartAt, true +} + +// HasStartAt returns a boolean if a field has been set. +func (o *MaintenanceWindowUpdateAttributes) HasStartAt() bool { + return o != nil && o.StartAt != nil +} + +// SetStartAt gets a reference to the given time.Time and assigns it to the StartAt field. +func (o *MaintenanceWindowUpdateAttributes) SetStartAt(v time.Time) { + o.StartAt = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowUpdateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.EndAt != nil { + if o.EndAt.Nanosecond() == 0 { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["end_at"] = o.EndAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.StartAt != nil { + if o.StartAt.Nanosecond() == 0 { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["start_at"] = o.StartAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + EndAt *time.Time `json:"end_at,omitempty"` + Name *string `json:"name,omitempty"` + Query *string `json:"query,omitempty"` + StartAt *time.Time `json:"start_at,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"end_at", "name", "query", "start_at"}) + } else { + return err + } + o.EndAt = all.EndAt + o.Name = all.Name + o.Query = all.Query + o.StartAt = all.StartAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_window_update_request.go b/api/datadogV2/model_maintenance_window_update_request.go new file mode 100644 index 00000000000..0fbaf451bf6 --- /dev/null +++ b/api/datadogV2/model_maintenance_window_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowUpdateRequest Request payload for updating a maintenance window. +type MaintenanceWindowUpdateRequest struct { + // Data object for updating a maintenance window. + Data MaintenanceWindowUpdate `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowUpdateRequest instantiates a new MaintenanceWindowUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowUpdateRequest(data MaintenanceWindowUpdate) *MaintenanceWindowUpdateRequest { + this := MaintenanceWindowUpdateRequest{} + this.Data = data + return &this +} + +// NewMaintenanceWindowUpdateRequestWithDefaults instantiates a new MaintenanceWindowUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowUpdateRequestWithDefaults() *MaintenanceWindowUpdateRequest { + this := MaintenanceWindowUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *MaintenanceWindowUpdateRequest) GetData() MaintenanceWindowUpdate { + if o == nil { + var ret MaintenanceWindowUpdate + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowUpdateRequest) GetDataOk() (*MaintenanceWindowUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *MaintenanceWindowUpdateRequest) SetData(v MaintenanceWindowUpdate) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *MaintenanceWindowUpdate `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_maintenance_windows_response.go b/api/datadogV2/model_maintenance_windows_response.go new file mode 100644 index 00000000000..c900894c6a2 --- /dev/null +++ b/api/datadogV2/model_maintenance_windows_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// MaintenanceWindowsResponse Response containing a list of maintenance windows. +type MaintenanceWindowsResponse struct { + // List of maintenance windows. + Data []MaintenanceWindow `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewMaintenanceWindowsResponse instantiates a new MaintenanceWindowsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewMaintenanceWindowsResponse(data []MaintenanceWindow) *MaintenanceWindowsResponse { + this := MaintenanceWindowsResponse{} + this.Data = data + return &this +} + +// NewMaintenanceWindowsResponseWithDefaults instantiates a new MaintenanceWindowsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewMaintenanceWindowsResponseWithDefaults() *MaintenanceWindowsResponse { + this := MaintenanceWindowsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *MaintenanceWindowsResponse) GetData() []MaintenanceWindow { + if o == nil { + var ret []MaintenanceWindow + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *MaintenanceWindowsResponse) GetDataOk() (*[]MaintenanceWindow, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *MaintenanceWindowsResponse) SetData(v []MaintenanceWindow) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o MaintenanceWindowsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *MaintenanceWindowsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]MaintenanceWindow `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_artifact_info.go b/api/datadogV2/model_model_lab_artifact_info.go new file mode 100644 index 00000000000..853818e5e49 --- /dev/null +++ b/api/datadogV2/model_model_lab_artifact_info.go @@ -0,0 +1,216 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabArtifactInfo Information about a project-level artifact file. +type ModelLabArtifactInfo struct { + // The full artifact path relative to the project's artifact root. + ArtifactPath string `json:"artifact_path"` + // The date and time the artifact was created. + CreatedAt time.Time `json:"created_at"` + // The size of the file in bytes. + FileSize datadog.NullableInt64 `json:"file_size,omitempty"` + // The filename of the artifact. + Filename string `json:"filename"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabArtifactInfo instantiates a new ModelLabArtifactInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabArtifactInfo(artifactPath string, createdAt time.Time, filename string) *ModelLabArtifactInfo { + this := ModelLabArtifactInfo{} + this.ArtifactPath = artifactPath + this.CreatedAt = createdAt + this.Filename = filename + return &this +} + +// NewModelLabArtifactInfoWithDefaults instantiates a new ModelLabArtifactInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabArtifactInfoWithDefaults() *ModelLabArtifactInfo { + this := ModelLabArtifactInfo{} + return &this +} + +// GetArtifactPath returns the ArtifactPath field value. +func (o *ModelLabArtifactInfo) GetArtifactPath() string { + if o == nil { + var ret string + return ret + } + return o.ArtifactPath +} + +// GetArtifactPathOk returns a tuple with the ArtifactPath field value +// and a boolean to check if the value has been set. +func (o *ModelLabArtifactInfo) GetArtifactPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ArtifactPath, true +} + +// SetArtifactPath sets field value. +func (o *ModelLabArtifactInfo) SetArtifactPath(v string) { + o.ArtifactPath = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *ModelLabArtifactInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabArtifactInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *ModelLabArtifactInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetFileSize returns the FileSize field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabArtifactInfo) GetFileSize() int64 { + if o == nil || o.FileSize.Get() == nil { + var ret int64 + return ret + } + return *o.FileSize.Get() +} + +// GetFileSizeOk returns a tuple with the FileSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabArtifactInfo) GetFileSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.FileSize.Get(), o.FileSize.IsSet() +} + +// HasFileSize returns a boolean if a field has been set. +func (o *ModelLabArtifactInfo) HasFileSize() bool { + return o != nil && o.FileSize.IsSet() +} + +// SetFileSize gets a reference to the given datadog.NullableInt64 and assigns it to the FileSize field. +func (o *ModelLabArtifactInfo) SetFileSize(v int64) { + o.FileSize.Set(&v) +} + +// SetFileSizeNil sets the value for FileSize to be an explicit nil. +func (o *ModelLabArtifactInfo) SetFileSizeNil() { + o.FileSize.Set(nil) +} + +// UnsetFileSize ensures that no value is present for FileSize, not even an explicit nil. +func (o *ModelLabArtifactInfo) UnsetFileSize() { + o.FileSize.Unset() +} + +// GetFilename returns the Filename field value. +func (o *ModelLabArtifactInfo) GetFilename() string { + if o == nil { + var ret string + return ret + } + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *ModelLabArtifactInfo) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value. +func (o *ModelLabArtifactInfo) SetFilename(v string) { + o.Filename = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabArtifactInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["artifact_path"] = o.ArtifactPath + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.FileSize.IsSet() { + toSerialize["file_size"] = o.FileSize.Get() + } + toSerialize["filename"] = o.Filename + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabArtifactInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ArtifactPath *string `json:"artifact_path"` + CreatedAt *time.Time `json:"created_at"` + FileSize datadog.NullableInt64 `json:"file_size,omitempty"` + Filename *string `json:"filename"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ArtifactPath == nil { + return fmt.Errorf("required field artifact_path missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Filename == nil { + return fmt.Errorf("required field filename missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"artifact_path", "created_at", "file_size", "filename"}) + } else { + return err + } + o.ArtifactPath = *all.ArtifactPath + o.CreatedAt = *all.CreatedAt + o.FileSize = all.FileSize + o.Filename = *all.Filename + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_artifact_object_info.go b/api/datadogV2/model_model_lab_artifact_object_info.go new file mode 100644 index 00000000000..da1e06b50ec --- /dev/null +++ b/api/datadogV2/model_model_lab_artifact_object_info.go @@ -0,0 +1,179 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabArtifactObjectInfo Information about an artifact file or directory within a run. +type ModelLabArtifactObjectInfo struct { + // The size of the file in bytes. + FileSize datadog.NullableInt64 `json:"file_size,omitempty"` + // Whether this artifact entry is a directory. + IsDir bool `json:"is_dir"` + // The path of the artifact relative to the run's artifact root. + Path string `json:"path"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabArtifactObjectInfo instantiates a new ModelLabArtifactObjectInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabArtifactObjectInfo(isDir bool, path string) *ModelLabArtifactObjectInfo { + this := ModelLabArtifactObjectInfo{} + this.IsDir = isDir + this.Path = path + return &this +} + +// NewModelLabArtifactObjectInfoWithDefaults instantiates a new ModelLabArtifactObjectInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabArtifactObjectInfoWithDefaults() *ModelLabArtifactObjectInfo { + this := ModelLabArtifactObjectInfo{} + return &this +} + +// GetFileSize returns the FileSize field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabArtifactObjectInfo) GetFileSize() int64 { + if o == nil || o.FileSize.Get() == nil { + var ret int64 + return ret + } + return *o.FileSize.Get() +} + +// GetFileSizeOk returns a tuple with the FileSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabArtifactObjectInfo) GetFileSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.FileSize.Get(), o.FileSize.IsSet() +} + +// HasFileSize returns a boolean if a field has been set. +func (o *ModelLabArtifactObjectInfo) HasFileSize() bool { + return o != nil && o.FileSize.IsSet() +} + +// SetFileSize gets a reference to the given datadog.NullableInt64 and assigns it to the FileSize field. +func (o *ModelLabArtifactObjectInfo) SetFileSize(v int64) { + o.FileSize.Set(&v) +} + +// SetFileSizeNil sets the value for FileSize to be an explicit nil. +func (o *ModelLabArtifactObjectInfo) SetFileSizeNil() { + o.FileSize.Set(nil) +} + +// UnsetFileSize ensures that no value is present for FileSize, not even an explicit nil. +func (o *ModelLabArtifactObjectInfo) UnsetFileSize() { + o.FileSize.Unset() +} + +// GetIsDir returns the IsDir field value. +func (o *ModelLabArtifactObjectInfo) GetIsDir() bool { + if o == nil { + var ret bool + return ret + } + return o.IsDir +} + +// GetIsDirOk returns a tuple with the IsDir field value +// and a boolean to check if the value has been set. +func (o *ModelLabArtifactObjectInfo) GetIsDirOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDir, true +} + +// SetIsDir sets field value. +func (o *ModelLabArtifactObjectInfo) SetIsDir(v bool) { + o.IsDir = v +} + +// GetPath returns the Path field value. +func (o *ModelLabArtifactObjectInfo) GetPath() string { + if o == nil { + var ret string + return ret + } + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *ModelLabArtifactObjectInfo) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value. +func (o *ModelLabArtifactObjectInfo) SetPath(v string) { + o.Path = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabArtifactObjectInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.FileSize.IsSet() { + toSerialize["file_size"] = o.FileSize.Get() + } + toSerialize["is_dir"] = o.IsDir + toSerialize["path"] = o.Path + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabArtifactObjectInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + FileSize datadog.NullableInt64 `json:"file_size,omitempty"` + IsDir *bool `json:"is_dir"` + Path *string `json:"path"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.IsDir == nil { + return fmt.Errorf("required field is_dir missing") + } + if all.Path == nil { + return fmt.Errorf("required field path missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"file_size", "is_dir", "path"}) + } else { + return err + } + o.FileSize = all.FileSize + o.IsDir = *all.IsDir + o.Path = *all.Path + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_keys_attributes.go b/api/datadogV2/model_model_lab_facet_keys_attributes.go new file mode 100644 index 00000000000..9a771e1bbd3 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_keys_attributes.go @@ -0,0 +1,167 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetKeysAttributes Available facet key names for filtering resources. +type ModelLabFacetKeysAttributes struct { + // The list of available metric facet keys. + Metrics datadog.NullableList[string] `json:"metrics"` + // The list of available parameter facet keys. + Parameters []string `json:"parameters"` + // The list of available tag facet keys. + Tags []string `json:"tags"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetKeysAttributes instantiates a new ModelLabFacetKeysAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetKeysAttributes(metrics datadog.NullableList[string], parameters []string, tags []string) *ModelLabFacetKeysAttributes { + this := ModelLabFacetKeysAttributes{} + this.Metrics = metrics + this.Parameters = parameters + this.Tags = tags + return &this +} + +// NewModelLabFacetKeysAttributesWithDefaults instantiates a new ModelLabFacetKeysAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetKeysAttributesWithDefaults() *ModelLabFacetKeysAttributes { + this := ModelLabFacetKeysAttributes{} + return &this +} + +// GetMetrics returns the Metrics field value. +// If the value is explicit nil, the zero value for []string will be returned. +func (o *ModelLabFacetKeysAttributes) GetMetrics() []string { + if o == nil || o.Metrics.Get() == nil { + var ret []string + return ret + } + return *o.Metrics.Get() +} + +// GetMetricsOk returns a tuple with the Metrics field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabFacetKeysAttributes) GetMetricsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Metrics.Get(), o.Metrics.IsSet() +} + +// SetMetrics sets field value. +func (o *ModelLabFacetKeysAttributes) SetMetrics(v []string) { + o.Metrics.Set(&v) +} + +// GetParameters returns the Parameters field value. +func (o *ModelLabFacetKeysAttributes) GetParameters() []string { + if o == nil { + var ret []string + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysAttributes) GetParametersOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Parameters, true +} + +// SetParameters sets field value. +func (o *ModelLabFacetKeysAttributes) SetParameters(v []string) { + o.Parameters = v +} + +// GetTags returns the Tags field value. +func (o *ModelLabFacetKeysAttributes) GetTags() []string { + if o == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysAttributes) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *ModelLabFacetKeysAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetKeysAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["metrics"] = o.Metrics.Get() + toSerialize["parameters"] = o.Parameters + toSerialize["tags"] = o.Tags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetKeysAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Metrics datadog.NullableList[string] `json:"metrics"` + Parameters *[]string `json:"parameters"` + Tags *[]string `json:"tags"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if !all.Metrics.IsSet() { + return fmt.Errorf("required field metrics missing") + } + if all.Parameters == nil { + return fmt.Errorf("required field parameters missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"metrics", "parameters", "tags"}) + } else { + return err + } + o.Metrics = all.Metrics + o.Parameters = *all.Parameters + o.Tags = *all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_keys_data.go b/api/datadogV2/model_model_lab_facet_keys_data.go new file mode 100644 index 00000000000..9290cd88ab0 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_keys_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetKeysData A facet keys JSON:API resource object. +type ModelLabFacetKeysData struct { + // Available facet key names for filtering resources. + Attributes ModelLabFacetKeysAttributes `json:"attributes"` + // The unique identifier of the facet keys resource. + Id string `json:"id"` + // The JSON:API type for a facet keys resource. + Type ModelLabFacetKeysType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetKeysData instantiates a new ModelLabFacetKeysData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetKeysData(attributes ModelLabFacetKeysAttributes, id string, typeVar ModelLabFacetKeysType) *ModelLabFacetKeysData { + this := ModelLabFacetKeysData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabFacetKeysDataWithDefaults instantiates a new ModelLabFacetKeysData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetKeysDataWithDefaults() *ModelLabFacetKeysData { + this := ModelLabFacetKeysData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabFacetKeysData) GetAttributes() ModelLabFacetKeysAttributes { + if o == nil { + var ret ModelLabFacetKeysAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysData) GetAttributesOk() (*ModelLabFacetKeysAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabFacetKeysData) SetAttributes(v ModelLabFacetKeysAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabFacetKeysData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabFacetKeysData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabFacetKeysData) GetType() ModelLabFacetKeysType { + if o == nil { + var ret ModelLabFacetKeysType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysData) GetTypeOk() (*ModelLabFacetKeysType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabFacetKeysData) SetType(v ModelLabFacetKeysType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetKeysData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetKeysData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabFacetKeysAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabFacetKeysType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_keys_response.go b/api/datadogV2/model_model_lab_facet_keys_response.go new file mode 100644 index 00000000000..3c1808c631e --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_keys_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetKeysResponse Response containing available facet keys. +type ModelLabFacetKeysResponse struct { + // A facet keys JSON:API resource object. + Data ModelLabFacetKeysData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetKeysResponse instantiates a new ModelLabFacetKeysResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetKeysResponse(data ModelLabFacetKeysData) *ModelLabFacetKeysResponse { + this := ModelLabFacetKeysResponse{} + this.Data = data + return &this +} + +// NewModelLabFacetKeysResponseWithDefaults instantiates a new ModelLabFacetKeysResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetKeysResponseWithDefaults() *ModelLabFacetKeysResponse { + this := ModelLabFacetKeysResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabFacetKeysResponse) GetData() ModelLabFacetKeysData { + if o == nil { + var ret ModelLabFacetKeysData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetKeysResponse) GetDataOk() (*ModelLabFacetKeysData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabFacetKeysResponse) SetData(v ModelLabFacetKeysData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetKeysResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetKeysResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabFacetKeysData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_keys_type.go b/api/datadogV2/model_model_lab_facet_keys_type.go new file mode 100644 index 00000000000..2af10efd031 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_keys_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetKeysType The JSON:API type for a facet keys resource. +type ModelLabFacetKeysType string + +// List of ModelLabFacetKeysType. +const ( + MODELLABFACETKEYSTYPE_FACET_KEYS ModelLabFacetKeysType = "facet_keys" +) + +var allowedModelLabFacetKeysTypeEnumValues = []ModelLabFacetKeysType{ + MODELLABFACETKEYSTYPE_FACET_KEYS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabFacetKeysType) GetAllowedValues() []ModelLabFacetKeysType { + return allowedModelLabFacetKeysTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabFacetKeysType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabFacetKeysType(value) + return nil +} + +// NewModelLabFacetKeysTypeFromValue returns a pointer to a valid ModelLabFacetKeysType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabFacetKeysTypeFromValue(v string) (*ModelLabFacetKeysType, error) { + ev := ModelLabFacetKeysType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabFacetKeysType: valid values are %v", v, allowedModelLabFacetKeysTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabFacetKeysType) IsValid() bool { + for _, existing := range allowedModelLabFacetKeysTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabFacetKeysType value. +func (v ModelLabFacetKeysType) Ptr() *ModelLabFacetKeysType { + return &v +} diff --git a/api/datadogV2/model_model_lab_facet_type.go b/api/datadogV2/model_model_lab_facet_type.go new file mode 100644 index 00000000000..494efb230db --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_type.go @@ -0,0 +1,70 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetType The type of facet for filtering Model Lab runs. +type ModelLabFacetType string + +// List of ModelLabFacetType. +const ( + MODELLABFACETTYPE_PARAMETER ModelLabFacetType = "parameter" + MODELLABFACETTYPE_ATTRIBUTE ModelLabFacetType = "attribute" + MODELLABFACETTYPE_TAG ModelLabFacetType = "tag" + MODELLABFACETTYPE_METRIC ModelLabFacetType = "metric" +) + +var allowedModelLabFacetTypeEnumValues = []ModelLabFacetType{ + MODELLABFACETTYPE_PARAMETER, + MODELLABFACETTYPE_ATTRIBUTE, + MODELLABFACETTYPE_TAG, + MODELLABFACETTYPE_METRIC, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabFacetType) GetAllowedValues() []ModelLabFacetType { + return allowedModelLabFacetTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabFacetType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabFacetType(value) + return nil +} + +// NewModelLabFacetTypeFromValue returns a pointer to a valid ModelLabFacetType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabFacetTypeFromValue(v string) (*ModelLabFacetType, error) { + ev := ModelLabFacetType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabFacetType: valid values are %v", v, allowedModelLabFacetTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabFacetType) IsValid() bool { + for _, existing := range allowedModelLabFacetTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabFacetType value. +func (v ModelLabFacetType) Ptr() *ModelLabFacetType { + return &v +} diff --git a/api/datadogV2/model_model_lab_facet_values_attributes.go b/api/datadogV2/model_model_lab_facet_values_attributes.go new file mode 100644 index 00000000000..73c4d784f11 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_values_attributes.go @@ -0,0 +1,244 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetValuesAttributes Available values for a specific facet key. +type ModelLabFacetValuesAttributes struct { + // The name of the facet. + FacetName string `json:"facet_name"` + // The type of the facet. + FacetType string `json:"facet_type"` + // The ranges for each metric statistic. + MetricStatRanges []ModelLabMetricStatRange `json:"metric_stat_ranges,omitempty"` + // The numeric range of values for a facet. + NumericRange *ModelLabNumericRange `json:"numeric_range,omitempty"` + // The list of available string values for this facet. + Values []string `json:"values"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetValuesAttributes instantiates a new ModelLabFacetValuesAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetValuesAttributes(facetName string, facetType string, values []string) *ModelLabFacetValuesAttributes { + this := ModelLabFacetValuesAttributes{} + this.FacetName = facetName + this.FacetType = facetType + this.Values = values + return &this +} + +// NewModelLabFacetValuesAttributesWithDefaults instantiates a new ModelLabFacetValuesAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetValuesAttributesWithDefaults() *ModelLabFacetValuesAttributes { + this := ModelLabFacetValuesAttributes{} + return &this +} + +// GetFacetName returns the FacetName field value. +func (o *ModelLabFacetValuesAttributes) GetFacetName() string { + if o == nil { + var ret string + return ret + } + return o.FacetName +} + +// GetFacetNameOk returns a tuple with the FacetName field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesAttributes) GetFacetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FacetName, true +} + +// SetFacetName sets field value. +func (o *ModelLabFacetValuesAttributes) SetFacetName(v string) { + o.FacetName = v +} + +// GetFacetType returns the FacetType field value. +func (o *ModelLabFacetValuesAttributes) GetFacetType() string { + if o == nil { + var ret string + return ret + } + return o.FacetType +} + +// GetFacetTypeOk returns a tuple with the FacetType field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesAttributes) GetFacetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FacetType, true +} + +// SetFacetType sets field value. +func (o *ModelLabFacetValuesAttributes) SetFacetType(v string) { + o.FacetType = v +} + +// GetMetricStatRanges returns the MetricStatRanges field value if set, zero value otherwise. +func (o *ModelLabFacetValuesAttributes) GetMetricStatRanges() []ModelLabMetricStatRange { + if o == nil || o.MetricStatRanges == nil { + var ret []ModelLabMetricStatRange + return ret + } + return o.MetricStatRanges +} + +// GetMetricStatRangesOk returns a tuple with the MetricStatRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesAttributes) GetMetricStatRangesOk() (*[]ModelLabMetricStatRange, bool) { + if o == nil || o.MetricStatRanges == nil { + return nil, false + } + return &o.MetricStatRanges, true +} + +// HasMetricStatRanges returns a boolean if a field has been set. +func (o *ModelLabFacetValuesAttributes) HasMetricStatRanges() bool { + return o != nil && o.MetricStatRanges != nil +} + +// SetMetricStatRanges gets a reference to the given []ModelLabMetricStatRange and assigns it to the MetricStatRanges field. +func (o *ModelLabFacetValuesAttributes) SetMetricStatRanges(v []ModelLabMetricStatRange) { + o.MetricStatRanges = v +} + +// GetNumericRange returns the NumericRange field value if set, zero value otherwise. +func (o *ModelLabFacetValuesAttributes) GetNumericRange() ModelLabNumericRange { + if o == nil || o.NumericRange == nil { + var ret ModelLabNumericRange + return ret + } + return *o.NumericRange +} + +// GetNumericRangeOk returns a tuple with the NumericRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesAttributes) GetNumericRangeOk() (*ModelLabNumericRange, bool) { + if o == nil || o.NumericRange == nil { + return nil, false + } + return o.NumericRange, true +} + +// HasNumericRange returns a boolean if a field has been set. +func (o *ModelLabFacetValuesAttributes) HasNumericRange() bool { + return o != nil && o.NumericRange != nil +} + +// SetNumericRange gets a reference to the given ModelLabNumericRange and assigns it to the NumericRange field. +func (o *ModelLabFacetValuesAttributes) SetNumericRange(v ModelLabNumericRange) { + o.NumericRange = &v +} + +// GetValues returns the Values field value. +func (o *ModelLabFacetValuesAttributes) GetValues() []string { + if o == nil { + var ret []string + return ret + } + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesAttributes) GetValuesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Values, true +} + +// SetValues sets field value. +func (o *ModelLabFacetValuesAttributes) SetValues(v []string) { + o.Values = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetValuesAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["facet_name"] = o.FacetName + toSerialize["facet_type"] = o.FacetType + if o.MetricStatRanges != nil { + toSerialize["metric_stat_ranges"] = o.MetricStatRanges + } + if o.NumericRange != nil { + toSerialize["numeric_range"] = o.NumericRange + } + toSerialize["values"] = o.Values + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetValuesAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + FacetName *string `json:"facet_name"` + FacetType *string `json:"facet_type"` + MetricStatRanges []ModelLabMetricStatRange `json:"metric_stat_ranges,omitempty"` + NumericRange *ModelLabNumericRange `json:"numeric_range,omitempty"` + Values *[]string `json:"values"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.FacetName == nil { + return fmt.Errorf("required field facet_name missing") + } + if all.FacetType == nil { + return fmt.Errorf("required field facet_type missing") + } + if all.Values == nil { + return fmt.Errorf("required field values missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"facet_name", "facet_type", "metric_stat_ranges", "numeric_range", "values"}) + } else { + return err + } + + hasInvalidField := false + o.FacetName = *all.FacetName + o.FacetType = *all.FacetType + o.MetricStatRanges = all.MetricStatRanges + if all.NumericRange != nil && all.NumericRange.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.NumericRange = all.NumericRange + o.Values = *all.Values + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_values_data.go b/api/datadogV2/model_model_lab_facet_values_data.go new file mode 100644 index 00000000000..27b544b0ba0 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_values_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetValuesData A facet values JSON:API resource object. +type ModelLabFacetValuesData struct { + // Available values for a specific facet key. + Attributes ModelLabFacetValuesAttributes `json:"attributes"` + // The unique identifier of the facet values resource. + Id string `json:"id"` + // The JSON:API type for a facet values resource. + Type ModelLabFacetValuesType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetValuesData instantiates a new ModelLabFacetValuesData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetValuesData(attributes ModelLabFacetValuesAttributes, id string, typeVar ModelLabFacetValuesType) *ModelLabFacetValuesData { + this := ModelLabFacetValuesData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabFacetValuesDataWithDefaults instantiates a new ModelLabFacetValuesData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetValuesDataWithDefaults() *ModelLabFacetValuesData { + this := ModelLabFacetValuesData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabFacetValuesData) GetAttributes() ModelLabFacetValuesAttributes { + if o == nil { + var ret ModelLabFacetValuesAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesData) GetAttributesOk() (*ModelLabFacetValuesAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabFacetValuesData) SetAttributes(v ModelLabFacetValuesAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabFacetValuesData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabFacetValuesData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabFacetValuesData) GetType() ModelLabFacetValuesType { + if o == nil { + var ret ModelLabFacetValuesType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesData) GetTypeOk() (*ModelLabFacetValuesType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabFacetValuesData) SetType(v ModelLabFacetValuesType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetValuesData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetValuesData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabFacetValuesAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabFacetValuesType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_values_response.go b/api/datadogV2/model_model_lab_facet_values_response.go new file mode 100644 index 00000000000..8b1b87ae76d --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_values_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetValuesResponse Response containing available values for a facet key. +type ModelLabFacetValuesResponse struct { + // A facet values JSON:API resource object. + Data ModelLabFacetValuesData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabFacetValuesResponse instantiates a new ModelLabFacetValuesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabFacetValuesResponse(data ModelLabFacetValuesData) *ModelLabFacetValuesResponse { + this := ModelLabFacetValuesResponse{} + this.Data = data + return &this +} + +// NewModelLabFacetValuesResponseWithDefaults instantiates a new ModelLabFacetValuesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabFacetValuesResponseWithDefaults() *ModelLabFacetValuesResponse { + this := ModelLabFacetValuesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabFacetValuesResponse) GetData() ModelLabFacetValuesData { + if o == nil { + var ret ModelLabFacetValuesData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabFacetValuesResponse) GetDataOk() (*ModelLabFacetValuesData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabFacetValuesResponse) SetData(v ModelLabFacetValuesData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabFacetValuesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabFacetValuesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabFacetValuesData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_facet_values_type.go b/api/datadogV2/model_model_lab_facet_values_type.go new file mode 100644 index 00000000000..311c1ec4992 --- /dev/null +++ b/api/datadogV2/model_model_lab_facet_values_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabFacetValuesType The JSON:API type for a facet values resource. +type ModelLabFacetValuesType string + +// List of ModelLabFacetValuesType. +const ( + MODELLABFACETVALUESTYPE_FACET_VALUES ModelLabFacetValuesType = "facet_values" +) + +var allowedModelLabFacetValuesTypeEnumValues = []ModelLabFacetValuesType{ + MODELLABFACETVALUESTYPE_FACET_VALUES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabFacetValuesType) GetAllowedValues() []ModelLabFacetValuesType { + return allowedModelLabFacetValuesTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabFacetValuesType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabFacetValuesType(value) + return nil +} + +// NewModelLabFacetValuesTypeFromValue returns a pointer to a valid ModelLabFacetValuesType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabFacetValuesTypeFromValue(v string) (*ModelLabFacetValuesType, error) { + ev := ModelLabFacetValuesType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabFacetValuesType: valid values are %v", v, allowedModelLabFacetValuesTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabFacetValuesType) IsValid() bool { + for _, existing := range allowedModelLabFacetValuesTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabFacetValuesType value. +func (v ModelLabFacetValuesType) Ptr() *ModelLabFacetValuesType { + return &v +} diff --git a/api/datadogV2/model_model_lab_metric_stat_range.go b/api/datadogV2/model_model_lab_metric_stat_range.go new file mode 100644 index 00000000000..67a58078c84 --- /dev/null +++ b/api/datadogV2/model_model_lab_metric_stat_range.go @@ -0,0 +1,165 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabMetricStatRange The range of values for a specific metric statistic. +type ModelLabMetricStatRange struct { + // The maximum value of the statistic. + Max float64 `json:"max"` + // The minimum value of the statistic. + Min float64 `json:"min"` + // The metric statistic name. + Stat string `json:"stat"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabMetricStatRange instantiates a new ModelLabMetricStatRange object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabMetricStatRange(max float64, min float64, stat string) *ModelLabMetricStatRange { + this := ModelLabMetricStatRange{} + this.Max = max + this.Min = min + this.Stat = stat + return &this +} + +// NewModelLabMetricStatRangeWithDefaults instantiates a new ModelLabMetricStatRange object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabMetricStatRangeWithDefaults() *ModelLabMetricStatRange { + this := ModelLabMetricStatRange{} + return &this +} + +// GetMax returns the Max field value. +func (o *ModelLabMetricStatRange) GetMax() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *ModelLabMetricStatRange) GetMaxOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value. +func (o *ModelLabMetricStatRange) SetMax(v float64) { + o.Max = v +} + +// GetMin returns the Min field value. +func (o *ModelLabMetricStatRange) GetMin() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *ModelLabMetricStatRange) GetMinOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value. +func (o *ModelLabMetricStatRange) SetMin(v float64) { + o.Min = v +} + +// GetStat returns the Stat field value. +func (o *ModelLabMetricStatRange) GetStat() string { + if o == nil { + var ret string + return ret + } + return o.Stat +} + +// GetStatOk returns a tuple with the Stat field value +// and a boolean to check if the value has been set. +func (o *ModelLabMetricStatRange) GetStatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stat, true +} + +// SetStat sets field value. +func (o *ModelLabMetricStatRange) SetStat(v string) { + o.Stat = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabMetricStatRange) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + toSerialize["stat"] = o.Stat + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabMetricStatRange) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Max *float64 `json:"max"` + Min *float64 `json:"min"` + Stat *string `json:"stat"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Max == nil { + return fmt.Errorf("required field max missing") + } + if all.Min == nil { + return fmt.Errorf("required field min missing") + } + if all.Stat == nil { + return fmt.Errorf("required field stat missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"max", "min", "stat"}) + } else { + return err + } + o.Max = *all.Max + o.Min = *all.Min + o.Stat = *all.Stat + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_metric_summary.go b/api/datadogV2/model_model_lab_metric_summary.go new file mode 100644 index 00000000000..04924d103da --- /dev/null +++ b/api/datadogV2/model_model_lab_metric_summary.go @@ -0,0 +1,455 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabMetricSummary Summary statistics for a metric recorded during a Model Lab run. +type ModelLabMetricSummary struct { + // The total number of recorded values. + Count int64 `json:"count"` + // The first step at which the metric was recorded. + FirstStep datadog.NullableInt64 `json:"first_step,omitempty"` + // The metric name. + Key string `json:"key"` + // The last step at which the metric was recorded. + LastStep datadog.NullableInt64 `json:"last_step,omitempty"` + // The most recently recorded value. + Latest datadog.NullableFloat64 `json:"latest,omitempty"` + // The maximum recorded value. + Max datadog.NullableFloat64 `json:"max,omitempty"` + // The mean of recorded values. + Mean datadog.NullableFloat64 `json:"mean,omitempty"` + // The minimum recorded value. + Min datadog.NullableFloat64 `json:"min,omitempty"` + // The standard deviation of recorded values. + Stddev datadog.NullableFloat64 `json:"stddev,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabMetricSummary instantiates a new ModelLabMetricSummary object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabMetricSummary(count int64, key string) *ModelLabMetricSummary { + this := ModelLabMetricSummary{} + this.Count = count + this.Key = key + return &this +} + +// NewModelLabMetricSummaryWithDefaults instantiates a new ModelLabMetricSummary object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabMetricSummaryWithDefaults() *ModelLabMetricSummary { + this := ModelLabMetricSummary{} + return &this +} + +// GetCount returns the Count field value. +func (o *ModelLabMetricSummary) GetCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ModelLabMetricSummary) GetCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value. +func (o *ModelLabMetricSummary) SetCount(v int64) { + o.Count = v +} + +// GetFirstStep returns the FirstStep field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetFirstStep() int64 { + if o == nil || o.FirstStep.Get() == nil { + var ret int64 + return ret + } + return *o.FirstStep.Get() +} + +// GetFirstStepOk returns a tuple with the FirstStep field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetFirstStepOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.FirstStep.Get(), o.FirstStep.IsSet() +} + +// HasFirstStep returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasFirstStep() bool { + return o != nil && o.FirstStep.IsSet() +} + +// SetFirstStep gets a reference to the given datadog.NullableInt64 and assigns it to the FirstStep field. +func (o *ModelLabMetricSummary) SetFirstStep(v int64) { + o.FirstStep.Set(&v) +} + +// SetFirstStepNil sets the value for FirstStep to be an explicit nil. +func (o *ModelLabMetricSummary) SetFirstStepNil() { + o.FirstStep.Set(nil) +} + +// UnsetFirstStep ensures that no value is present for FirstStep, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetFirstStep() { + o.FirstStep.Unset() +} + +// GetKey returns the Key field value. +func (o *ModelLabMetricSummary) GetKey() string { + if o == nil { + var ret string + return ret + } + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ModelLabMetricSummary) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value. +func (o *ModelLabMetricSummary) SetKey(v string) { + o.Key = v +} + +// GetLastStep returns the LastStep field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetLastStep() int64 { + if o == nil || o.LastStep.Get() == nil { + var ret int64 + return ret + } + return *o.LastStep.Get() +} + +// GetLastStepOk returns a tuple with the LastStep field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetLastStepOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.LastStep.Get(), o.LastStep.IsSet() +} + +// HasLastStep returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasLastStep() bool { + return o != nil && o.LastStep.IsSet() +} + +// SetLastStep gets a reference to the given datadog.NullableInt64 and assigns it to the LastStep field. +func (o *ModelLabMetricSummary) SetLastStep(v int64) { + o.LastStep.Set(&v) +} + +// SetLastStepNil sets the value for LastStep to be an explicit nil. +func (o *ModelLabMetricSummary) SetLastStepNil() { + o.LastStep.Set(nil) +} + +// UnsetLastStep ensures that no value is present for LastStep, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetLastStep() { + o.LastStep.Unset() +} + +// GetLatest returns the Latest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetLatest() float64 { + if o == nil || o.Latest.Get() == nil { + var ret float64 + return ret + } + return *o.Latest.Get() +} + +// GetLatestOk returns a tuple with the Latest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetLatestOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latest.Get(), o.Latest.IsSet() +} + +// HasLatest returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasLatest() bool { + return o != nil && o.Latest.IsSet() +} + +// SetLatest gets a reference to the given datadog.NullableFloat64 and assigns it to the Latest field. +func (o *ModelLabMetricSummary) SetLatest(v float64) { + o.Latest.Set(&v) +} + +// SetLatestNil sets the value for Latest to be an explicit nil. +func (o *ModelLabMetricSummary) SetLatestNil() { + o.Latest.Set(nil) +} + +// UnsetLatest ensures that no value is present for Latest, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetLatest() { + o.Latest.Unset() +} + +// GetMax returns the Max field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetMax() float64 { + if o == nil || o.Max.Get() == nil { + var ret float64 + return ret + } + return *o.Max.Get() +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetMaxOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Max.Get(), o.Max.IsSet() +} + +// HasMax returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasMax() bool { + return o != nil && o.Max.IsSet() +} + +// SetMax gets a reference to the given datadog.NullableFloat64 and assigns it to the Max field. +func (o *ModelLabMetricSummary) SetMax(v float64) { + o.Max.Set(&v) +} + +// SetMaxNil sets the value for Max to be an explicit nil. +func (o *ModelLabMetricSummary) SetMaxNil() { + o.Max.Set(nil) +} + +// UnsetMax ensures that no value is present for Max, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetMax() { + o.Max.Unset() +} + +// GetMean returns the Mean field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetMean() float64 { + if o == nil || o.Mean.Get() == nil { + var ret float64 + return ret + } + return *o.Mean.Get() +} + +// GetMeanOk returns a tuple with the Mean field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetMeanOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Mean.Get(), o.Mean.IsSet() +} + +// HasMean returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasMean() bool { + return o != nil && o.Mean.IsSet() +} + +// SetMean gets a reference to the given datadog.NullableFloat64 and assigns it to the Mean field. +func (o *ModelLabMetricSummary) SetMean(v float64) { + o.Mean.Set(&v) +} + +// SetMeanNil sets the value for Mean to be an explicit nil. +func (o *ModelLabMetricSummary) SetMeanNil() { + o.Mean.Set(nil) +} + +// UnsetMean ensures that no value is present for Mean, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetMean() { + o.Mean.Unset() +} + +// GetMin returns the Min field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetMin() float64 { + if o == nil || o.Min.Get() == nil { + var ret float64 + return ret + } + return *o.Min.Get() +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetMinOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Min.Get(), o.Min.IsSet() +} + +// HasMin returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasMin() bool { + return o != nil && o.Min.IsSet() +} + +// SetMin gets a reference to the given datadog.NullableFloat64 and assigns it to the Min field. +func (o *ModelLabMetricSummary) SetMin(v float64) { + o.Min.Set(&v) +} + +// SetMinNil sets the value for Min to be an explicit nil. +func (o *ModelLabMetricSummary) SetMinNil() { + o.Min.Set(nil) +} + +// UnsetMin ensures that no value is present for Min, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetMin() { + o.Min.Unset() +} + +// GetStddev returns the Stddev field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabMetricSummary) GetStddev() float64 { + if o == nil || o.Stddev.Get() == nil { + var ret float64 + return ret + } + return *o.Stddev.Get() +} + +// GetStddevOk returns a tuple with the Stddev field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabMetricSummary) GetStddevOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Stddev.Get(), o.Stddev.IsSet() +} + +// HasStddev returns a boolean if a field has been set. +func (o *ModelLabMetricSummary) HasStddev() bool { + return o != nil && o.Stddev.IsSet() +} + +// SetStddev gets a reference to the given datadog.NullableFloat64 and assigns it to the Stddev field. +func (o *ModelLabMetricSummary) SetStddev(v float64) { + o.Stddev.Set(&v) +} + +// SetStddevNil sets the value for Stddev to be an explicit nil. +func (o *ModelLabMetricSummary) SetStddevNil() { + o.Stddev.Set(nil) +} + +// UnsetStddev ensures that no value is present for Stddev, not even an explicit nil. +func (o *ModelLabMetricSummary) UnsetStddev() { + o.Stddev.Unset() +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabMetricSummary) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["count"] = o.Count + if o.FirstStep.IsSet() { + toSerialize["first_step"] = o.FirstStep.Get() + } + toSerialize["key"] = o.Key + if o.LastStep.IsSet() { + toSerialize["last_step"] = o.LastStep.Get() + } + if o.Latest.IsSet() { + toSerialize["latest"] = o.Latest.Get() + } + if o.Max.IsSet() { + toSerialize["max"] = o.Max.Get() + } + if o.Mean.IsSet() { + toSerialize["mean"] = o.Mean.Get() + } + if o.Min.IsSet() { + toSerialize["min"] = o.Min.Get() + } + if o.Stddev.IsSet() { + toSerialize["stddev"] = o.Stddev.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabMetricSummary) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Count *int64 `json:"count"` + FirstStep datadog.NullableInt64 `json:"first_step,omitempty"` + Key *string `json:"key"` + LastStep datadog.NullableInt64 `json:"last_step,omitempty"` + Latest datadog.NullableFloat64 `json:"latest,omitempty"` + Max datadog.NullableFloat64 `json:"max,omitempty"` + Mean datadog.NullableFloat64 `json:"mean,omitempty"` + Min datadog.NullableFloat64 `json:"min,omitempty"` + Stddev datadog.NullableFloat64 `json:"stddev,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Count == nil { + return fmt.Errorf("required field count missing") + } + if all.Key == nil { + return fmt.Errorf("required field key missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"count", "first_step", "key", "last_step", "latest", "max", "mean", "min", "stddev"}) + } else { + return err + } + o.Count = *all.Count + o.FirstStep = all.FirstStep + o.Key = *all.Key + o.LastStep = all.LastStep + o.Latest = all.Latest + o.Max = all.Max + o.Mean = all.Mean + o.Min = all.Min + o.Stddev = all.Stddev + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_numeric_range.go b/api/datadogV2/model_model_lab_numeric_range.go new file mode 100644 index 00000000000..680a6421db9 --- /dev/null +++ b/api/datadogV2/model_model_lab_numeric_range.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabNumericRange The numeric range of values for a facet. +type ModelLabNumericRange struct { + // The maximum value. + Max float64 `json:"max"` + // The minimum value. + Min float64 `json:"min"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabNumericRange instantiates a new ModelLabNumericRange object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabNumericRange(max float64, min float64) *ModelLabNumericRange { + this := ModelLabNumericRange{} + this.Max = max + this.Min = min + return &this +} + +// NewModelLabNumericRangeWithDefaults instantiates a new ModelLabNumericRange object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabNumericRangeWithDefaults() *ModelLabNumericRange { + this := ModelLabNumericRange{} + return &this +} + +// GetMax returns the Max field value. +func (o *ModelLabNumericRange) GetMax() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *ModelLabNumericRange) GetMaxOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value. +func (o *ModelLabNumericRange) SetMax(v float64) { + o.Max = v +} + +// GetMin returns the Min field value. +func (o *ModelLabNumericRange) GetMin() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *ModelLabNumericRange) GetMinOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value. +func (o *ModelLabNumericRange) SetMin(v float64) { + o.Min = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabNumericRange) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabNumericRange) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Max *float64 `json:"max"` + Min *float64 `json:"min"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Max == nil { + return fmt.Errorf("required field max missing") + } + if all.Min == nil { + return fmt.Errorf("required field min missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"max", "min"}) + } else { + return err + } + o.Max = *all.Max + o.Min = *all.Min + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_page_meta.go b/api/datadogV2/model_model_lab_page_meta.go new file mode 100644 index 00000000000..2156f9b4888 --- /dev/null +++ b/api/datadogV2/model_model_lab_page_meta.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabPageMeta Pagination metadata for a list response. +type ModelLabPageMeta struct { + // Pagination details for a list response. + Page ModelLabPageMetaPage `json:"page"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabPageMeta instantiates a new ModelLabPageMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabPageMeta(page ModelLabPageMetaPage) *ModelLabPageMeta { + this := ModelLabPageMeta{} + this.Page = page + return &this +} + +// NewModelLabPageMetaWithDefaults instantiates a new ModelLabPageMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabPageMetaWithDefaults() *ModelLabPageMeta { + this := ModelLabPageMeta{} + return &this +} + +// GetPage returns the Page field value. +func (o *ModelLabPageMeta) GetPage() ModelLabPageMetaPage { + if o == nil { + var ret ModelLabPageMetaPage + return ret + } + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *ModelLabPageMeta) GetPageOk() (*ModelLabPageMetaPage, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value. +func (o *ModelLabPageMeta) SetPage(v ModelLabPageMetaPage) { + o.Page = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabPageMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["page"] = o.Page + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabPageMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *ModelLabPageMetaPage `json:"page"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Page == nil { + return fmt.Errorf("required field page missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page"}) + } else { + return err + } + + hasInvalidField := false + if all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = *all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_page_meta_page.go b/api/datadogV2/model_model_lab_page_meta_page.go new file mode 100644 index 00000000000..f4f6816a2cb --- /dev/null +++ b/api/datadogV2/model_model_lab_page_meta_page.go @@ -0,0 +1,362 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabPageMetaPage Pagination details for a list response. +type ModelLabPageMetaPage struct { + // The first page number. + FirstNumber *int64 `json:"first_number,omitempty"` + // The last page number. + LastNumber *int64 `json:"last_number,omitempty"` + // The next page number. + NextNumber datadog.NullableInt64 `json:"next_number,omitempty"` + // The current page number. + Number int64 `json:"number"` + // The previous page number. + PrevNumber datadog.NullableInt64 `json:"prev_number,omitempty"` + // The number of items per page. + Size int64 `json:"size"` + // The total number of items. + Total int64 `json:"total"` + // The pagination type. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabPageMetaPage instantiates a new ModelLabPageMetaPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabPageMetaPage(number int64, size int64, total int64) *ModelLabPageMetaPage { + this := ModelLabPageMetaPage{} + this.Number = number + this.Size = size + this.Total = total + return &this +} + +// NewModelLabPageMetaPageWithDefaults instantiates a new ModelLabPageMetaPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabPageMetaPageWithDefaults() *ModelLabPageMetaPage { + this := ModelLabPageMetaPage{} + return &this +} + +// GetFirstNumber returns the FirstNumber field value if set, zero value otherwise. +func (o *ModelLabPageMetaPage) GetFirstNumber() int64 { + if o == nil || o.FirstNumber == nil { + var ret int64 + return ret + } + return *o.FirstNumber +} + +// GetFirstNumberOk returns a tuple with the FirstNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetFirstNumberOk() (*int64, bool) { + if o == nil || o.FirstNumber == nil { + return nil, false + } + return o.FirstNumber, true +} + +// HasFirstNumber returns a boolean if a field has been set. +func (o *ModelLabPageMetaPage) HasFirstNumber() bool { + return o != nil && o.FirstNumber != nil +} + +// SetFirstNumber gets a reference to the given int64 and assigns it to the FirstNumber field. +func (o *ModelLabPageMetaPage) SetFirstNumber(v int64) { + o.FirstNumber = &v +} + +// GetLastNumber returns the LastNumber field value if set, zero value otherwise. +func (o *ModelLabPageMetaPage) GetLastNumber() int64 { + if o == nil || o.LastNumber == nil { + var ret int64 + return ret + } + return *o.LastNumber +} + +// GetLastNumberOk returns a tuple with the LastNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetLastNumberOk() (*int64, bool) { + if o == nil || o.LastNumber == nil { + return nil, false + } + return o.LastNumber, true +} + +// HasLastNumber returns a boolean if a field has been set. +func (o *ModelLabPageMetaPage) HasLastNumber() bool { + return o != nil && o.LastNumber != nil +} + +// SetLastNumber gets a reference to the given int64 and assigns it to the LastNumber field. +func (o *ModelLabPageMetaPage) SetLastNumber(v int64) { + o.LastNumber = &v +} + +// GetNextNumber returns the NextNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabPageMetaPage) GetNextNumber() int64 { + if o == nil || o.NextNumber.Get() == nil { + var ret int64 + return ret + } + return *o.NextNumber.Get() +} + +// GetNextNumberOk returns a tuple with the NextNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabPageMetaPage) GetNextNumberOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.NextNumber.Get(), o.NextNumber.IsSet() +} + +// HasNextNumber returns a boolean if a field has been set. +func (o *ModelLabPageMetaPage) HasNextNumber() bool { + return o != nil && o.NextNumber.IsSet() +} + +// SetNextNumber gets a reference to the given datadog.NullableInt64 and assigns it to the NextNumber field. +func (o *ModelLabPageMetaPage) SetNextNumber(v int64) { + o.NextNumber.Set(&v) +} + +// SetNextNumberNil sets the value for NextNumber to be an explicit nil. +func (o *ModelLabPageMetaPage) SetNextNumberNil() { + o.NextNumber.Set(nil) +} + +// UnsetNextNumber ensures that no value is present for NextNumber, not even an explicit nil. +func (o *ModelLabPageMetaPage) UnsetNextNumber() { + o.NextNumber.Unset() +} + +// GetNumber returns the Number field value. +func (o *ModelLabPageMetaPage) GetNumber() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetNumberOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value. +func (o *ModelLabPageMetaPage) SetNumber(v int64) { + o.Number = v +} + +// GetPrevNumber returns the PrevNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabPageMetaPage) GetPrevNumber() int64 { + if o == nil || o.PrevNumber.Get() == nil { + var ret int64 + return ret + } + return *o.PrevNumber.Get() +} + +// GetPrevNumberOk returns a tuple with the PrevNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabPageMetaPage) GetPrevNumberOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.PrevNumber.Get(), o.PrevNumber.IsSet() +} + +// HasPrevNumber returns a boolean if a field has been set. +func (o *ModelLabPageMetaPage) HasPrevNumber() bool { + return o != nil && o.PrevNumber.IsSet() +} + +// SetPrevNumber gets a reference to the given datadog.NullableInt64 and assigns it to the PrevNumber field. +func (o *ModelLabPageMetaPage) SetPrevNumber(v int64) { + o.PrevNumber.Set(&v) +} + +// SetPrevNumberNil sets the value for PrevNumber to be an explicit nil. +func (o *ModelLabPageMetaPage) SetPrevNumberNil() { + o.PrevNumber.Set(nil) +} + +// UnsetPrevNumber ensures that no value is present for PrevNumber, not even an explicit nil. +func (o *ModelLabPageMetaPage) UnsetPrevNumber() { + o.PrevNumber.Unset() +} + +// GetSize returns the Size field value. +func (o *ModelLabPageMetaPage) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value. +func (o *ModelLabPageMetaPage) SetSize(v int64) { + o.Size = v +} + +// GetTotal returns the Total field value. +func (o *ModelLabPageMetaPage) GetTotal() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value. +func (o *ModelLabPageMetaPage) SetTotal(v int64) { + o.Total = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ModelLabPageMetaPage) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPageMetaPage) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ModelLabPageMetaPage) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ModelLabPageMetaPage) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabPageMetaPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.FirstNumber != nil { + toSerialize["first_number"] = o.FirstNumber + } + if o.LastNumber != nil { + toSerialize["last_number"] = o.LastNumber + } + if o.NextNumber.IsSet() { + toSerialize["next_number"] = o.NextNumber.Get() + } + toSerialize["number"] = o.Number + if o.PrevNumber.IsSet() { + toSerialize["prev_number"] = o.PrevNumber.Get() + } + toSerialize["size"] = o.Size + toSerialize["total"] = o.Total + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabPageMetaPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + FirstNumber *int64 `json:"first_number,omitempty"` + LastNumber *int64 `json:"last_number,omitempty"` + NextNumber datadog.NullableInt64 `json:"next_number,omitempty"` + Number *int64 `json:"number"` + PrevNumber datadog.NullableInt64 `json:"prev_number,omitempty"` + Size *int64 `json:"size"` + Total *int64 `json:"total"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Number == nil { + return fmt.Errorf("required field number missing") + } + if all.Size == nil { + return fmt.Errorf("required field size missing") + } + if all.Total == nil { + return fmt.Errorf("required field total missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"first_number", "last_number", "next_number", "number", "prev_number", "size", "total", "type"}) + } else { + return err + } + o.FirstNumber = all.FirstNumber + o.LastNumber = all.LastNumber + o.NextNumber = all.NextNumber + o.Number = *all.Number + o.PrevNumber = all.PrevNumber + o.Size = *all.Size + o.Total = *all.Total + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_pagination_links.go b/api/datadogV2/model_model_lab_pagination_links.go new file mode 100644 index 00000000000..c8794ca91d6 --- /dev/null +++ b/api/datadogV2/model_model_lab_pagination_links.go @@ -0,0 +1,264 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabPaginationLinks Pagination links for navigating list responses. +type ModelLabPaginationLinks struct { + // Link to the first page. + First *string `json:"first,omitempty"` + // Link to the last page. + Last *string `json:"last,omitempty"` + // Link to the next page. + Next datadog.NullableString `json:"next,omitempty"` + // Link to the previous page. + Prev datadog.NullableString `json:"prev,omitempty"` + // Link to the current page. + Self *string `json:"self,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabPaginationLinks instantiates a new ModelLabPaginationLinks object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabPaginationLinks() *ModelLabPaginationLinks { + this := ModelLabPaginationLinks{} + return &this +} + +// NewModelLabPaginationLinksWithDefaults instantiates a new ModelLabPaginationLinks object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabPaginationLinksWithDefaults() *ModelLabPaginationLinks { + this := ModelLabPaginationLinks{} + return &this +} + +// GetFirst returns the First field value if set, zero value otherwise. +func (o *ModelLabPaginationLinks) GetFirst() string { + if o == nil || o.First == nil { + var ret string + return ret + } + return *o.First +} + +// GetFirstOk returns a tuple with the First field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPaginationLinks) GetFirstOk() (*string, bool) { + if o == nil || o.First == nil { + return nil, false + } + return o.First, true +} + +// HasFirst returns a boolean if a field has been set. +func (o *ModelLabPaginationLinks) HasFirst() bool { + return o != nil && o.First != nil +} + +// SetFirst gets a reference to the given string and assigns it to the First field. +func (o *ModelLabPaginationLinks) SetFirst(v string) { + o.First = &v +} + +// GetLast returns the Last field value if set, zero value otherwise. +func (o *ModelLabPaginationLinks) GetLast() string { + if o == nil || o.Last == nil { + var ret string + return ret + } + return *o.Last +} + +// GetLastOk returns a tuple with the Last field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPaginationLinks) GetLastOk() (*string, bool) { + if o == nil || o.Last == nil { + return nil, false + } + return o.Last, true +} + +// HasLast returns a boolean if a field has been set. +func (o *ModelLabPaginationLinks) HasLast() bool { + return o != nil && o.Last != nil +} + +// SetLast gets a reference to the given string and assigns it to the Last field. +func (o *ModelLabPaginationLinks) SetLast(v string) { + o.Last = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabPaginationLinks) GetNext() string { + if o == nil || o.Next.Get() == nil { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabPaginationLinks) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *ModelLabPaginationLinks) HasNext() bool { + return o != nil && o.Next.IsSet() +} + +// SetNext gets a reference to the given datadog.NullableString and assigns it to the Next field. +func (o *ModelLabPaginationLinks) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil. +func (o *ModelLabPaginationLinks) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil. +func (o *ModelLabPaginationLinks) UnsetNext() { + o.Next.Unset() +} + +// GetPrev returns the Prev field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabPaginationLinks) GetPrev() string { + if o == nil || o.Prev.Get() == nil { + var ret string + return ret + } + return *o.Prev.Get() +} + +// GetPrevOk returns a tuple with the Prev field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabPaginationLinks) GetPrevOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Prev.Get(), o.Prev.IsSet() +} + +// HasPrev returns a boolean if a field has been set. +func (o *ModelLabPaginationLinks) HasPrev() bool { + return o != nil && o.Prev.IsSet() +} + +// SetPrev gets a reference to the given datadog.NullableString and assigns it to the Prev field. +func (o *ModelLabPaginationLinks) SetPrev(v string) { + o.Prev.Set(&v) +} + +// SetPrevNil sets the value for Prev to be an explicit nil. +func (o *ModelLabPaginationLinks) SetPrevNil() { + o.Prev.Set(nil) +} + +// UnsetPrev ensures that no value is present for Prev, not even an explicit nil. +func (o *ModelLabPaginationLinks) UnsetPrev() { + o.Prev.Unset() +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *ModelLabPaginationLinks) GetSelf() string { + if o == nil || o.Self == nil { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabPaginationLinks) GetSelfOk() (*string, bool) { + if o == nil || o.Self == nil { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *ModelLabPaginationLinks) HasSelf() bool { + return o != nil && o.Self != nil +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *ModelLabPaginationLinks) SetSelf(v string) { + o.Self = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabPaginationLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.First != nil { + toSerialize["first"] = o.First + } + if o.Last != nil { + toSerialize["last"] = o.Last + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Prev.IsSet() { + toSerialize["prev"] = o.Prev.Get() + } + if o.Self != nil { + toSerialize["self"] = o.Self + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabPaginationLinks) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + First *string `json:"first,omitempty"` + Last *string `json:"last,omitempty"` + Next datadog.NullableString `json:"next,omitempty"` + Prev datadog.NullableString `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"first", "last", "next", "prev", "self"}) + } else { + return err + } + o.First = all.First + o.Last = all.Last + o.Next = all.Next + o.Prev = all.Prev + o.Self = all.Self + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_artifacts_attributes.go b/api/datadogV2/model_model_lab_project_artifacts_attributes.go new file mode 100644 index 00000000000..63fd3fe1391 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_artifacts_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectArtifactsAttributes Artifact listing for a Model Lab project. +type ModelLabProjectArtifactsAttributes struct { + // The list of artifact files associated with the project. + Files []ModelLabArtifactInfo `json:"files"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectArtifactsAttributes instantiates a new ModelLabProjectArtifactsAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectArtifactsAttributes(files []ModelLabArtifactInfo) *ModelLabProjectArtifactsAttributes { + this := ModelLabProjectArtifactsAttributes{} + this.Files = files + return &this +} + +// NewModelLabProjectArtifactsAttributesWithDefaults instantiates a new ModelLabProjectArtifactsAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectArtifactsAttributesWithDefaults() *ModelLabProjectArtifactsAttributes { + this := ModelLabProjectArtifactsAttributes{} + return &this +} + +// GetFiles returns the Files field value. +func (o *ModelLabProjectArtifactsAttributes) GetFiles() []ModelLabArtifactInfo { + if o == nil { + var ret []ModelLabArtifactInfo + return ret + } + return o.Files +} + +// GetFilesOk returns a tuple with the Files field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectArtifactsAttributes) GetFilesOk() (*[]ModelLabArtifactInfo, bool) { + if o == nil { + return nil, false + } + return &o.Files, true +} + +// SetFiles sets field value. +func (o *ModelLabProjectArtifactsAttributes) SetFiles(v []ModelLabArtifactInfo) { + o.Files = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectArtifactsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["files"] = o.Files + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectArtifactsAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Files *[]ModelLabArtifactInfo `json:"files"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Files == nil { + return fmt.Errorf("required field files missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"files"}) + } else { + return err + } + o.Files = *all.Files + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_artifacts_data.go b/api/datadogV2/model_model_lab_project_artifacts_data.go new file mode 100644 index 00000000000..36bc1e52fb2 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_artifacts_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectArtifactsData A project artifacts JSON:API resource object. +type ModelLabProjectArtifactsData struct { + // Artifact listing for a Model Lab project. + Attributes ModelLabProjectArtifactsAttributes `json:"attributes"` + // The unique identifier of the project artifacts resource. + Id string `json:"id"` + // The JSON:API type for a project artifacts resource. + Type ModelLabProjectArtifactsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectArtifactsData instantiates a new ModelLabProjectArtifactsData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectArtifactsData(attributes ModelLabProjectArtifactsAttributes, id string, typeVar ModelLabProjectArtifactsType) *ModelLabProjectArtifactsData { + this := ModelLabProjectArtifactsData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabProjectArtifactsDataWithDefaults instantiates a new ModelLabProjectArtifactsData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectArtifactsDataWithDefaults() *ModelLabProjectArtifactsData { + this := ModelLabProjectArtifactsData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabProjectArtifactsData) GetAttributes() ModelLabProjectArtifactsAttributes { + if o == nil { + var ret ModelLabProjectArtifactsAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectArtifactsData) GetAttributesOk() (*ModelLabProjectArtifactsAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabProjectArtifactsData) SetAttributes(v ModelLabProjectArtifactsAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabProjectArtifactsData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectArtifactsData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabProjectArtifactsData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabProjectArtifactsData) GetType() ModelLabProjectArtifactsType { + if o == nil { + var ret ModelLabProjectArtifactsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectArtifactsData) GetTypeOk() (*ModelLabProjectArtifactsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabProjectArtifactsData) SetType(v ModelLabProjectArtifactsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectArtifactsData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectArtifactsData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabProjectArtifactsAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabProjectArtifactsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_artifacts_response.go b/api/datadogV2/model_model_lab_project_artifacts_response.go new file mode 100644 index 00000000000..b5d1a724b0b --- /dev/null +++ b/api/datadogV2/model_model_lab_project_artifacts_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectArtifactsResponse Response containing the artifact listing for a Model Lab project. +type ModelLabProjectArtifactsResponse struct { + // A project artifacts JSON:API resource object. + Data ModelLabProjectArtifactsData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectArtifactsResponse instantiates a new ModelLabProjectArtifactsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectArtifactsResponse(data ModelLabProjectArtifactsData) *ModelLabProjectArtifactsResponse { + this := ModelLabProjectArtifactsResponse{} + this.Data = data + return &this +} + +// NewModelLabProjectArtifactsResponseWithDefaults instantiates a new ModelLabProjectArtifactsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectArtifactsResponseWithDefaults() *ModelLabProjectArtifactsResponse { + this := ModelLabProjectArtifactsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabProjectArtifactsResponse) GetData() ModelLabProjectArtifactsData { + if o == nil { + var ret ModelLabProjectArtifactsData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectArtifactsResponse) GetDataOk() (*ModelLabProjectArtifactsData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabProjectArtifactsResponse) SetData(v ModelLabProjectArtifactsData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectArtifactsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectArtifactsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabProjectArtifactsData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_artifacts_type.go b/api/datadogV2/model_model_lab_project_artifacts_type.go new file mode 100644 index 00000000000..5ac971a3424 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_artifacts_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectArtifactsType The JSON:API type for a project artifacts resource. +type ModelLabProjectArtifactsType string + +// List of ModelLabProjectArtifactsType. +const ( + MODELLABPROJECTARTIFACTSTYPE_PROJECT_FILES ModelLabProjectArtifactsType = "project_files" +) + +var allowedModelLabProjectArtifactsTypeEnumValues = []ModelLabProjectArtifactsType{ + MODELLABPROJECTARTIFACTSTYPE_PROJECT_FILES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabProjectArtifactsType) GetAllowedValues() []ModelLabProjectArtifactsType { + return allowedModelLabProjectArtifactsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabProjectArtifactsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabProjectArtifactsType(value) + return nil +} + +// NewModelLabProjectArtifactsTypeFromValue returns a pointer to a valid ModelLabProjectArtifactsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabProjectArtifactsTypeFromValue(v string) (*ModelLabProjectArtifactsType, error) { + ev := ModelLabProjectArtifactsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabProjectArtifactsType: valid values are %v", v, allowedModelLabProjectArtifactsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabProjectArtifactsType) IsValid() bool { + for _, existing := range allowedModelLabProjectArtifactsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabProjectArtifactsType value. +func (v ModelLabProjectArtifactsType) Ptr() *ModelLabProjectArtifactsType { + return &v +} diff --git a/api/datadogV2/model_model_lab_project_attributes.go b/api/datadogV2/model_model_lab_project_attributes.go new file mode 100644 index 00000000000..a06b5a0a310 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_attributes.go @@ -0,0 +1,440 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectAttributes Attributes of a Model Lab project. +type ModelLabProjectAttributes struct { + // The storage location for project artifacts. + ArtifactStorageLocation string `json:"artifact_storage_location"` + // The date and time the project was created. + CreatedAt time.Time `json:"created_at"` + // The date and time the project was soft-deleted. + DeletedAt datadog.NullableTime `json:"deleted_at,omitempty"` + // A description of the project. + Description string `json:"description"` + // An optional external URL associated with the project. + ExternalUrl datadog.NullableString `json:"external_url,omitempty"` + // Whether the project is starred by the current user. + IsStarred bool `json:"is_starred"` + // The name of the project. + Name string `json:"name"` + // The UUID of the project owner. + OwnerId datadog.NullableString `json:"owner_id,omitempty"` + // The list of tags associated with the project. + Tags []ModelLabTag `json:"tags"` + // The date and time the project was last updated. + UpdatedAt time.Time `json:"updated_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectAttributes instantiates a new ModelLabProjectAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectAttributes(artifactStorageLocation string, createdAt time.Time, description string, isStarred bool, name string, tags []ModelLabTag, updatedAt time.Time) *ModelLabProjectAttributes { + this := ModelLabProjectAttributes{} + this.ArtifactStorageLocation = artifactStorageLocation + this.CreatedAt = createdAt + this.Description = description + this.IsStarred = isStarred + this.Name = name + this.Tags = tags + this.UpdatedAt = updatedAt + return &this +} + +// NewModelLabProjectAttributesWithDefaults instantiates a new ModelLabProjectAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectAttributesWithDefaults() *ModelLabProjectAttributes { + this := ModelLabProjectAttributes{} + return &this +} + +// GetArtifactStorageLocation returns the ArtifactStorageLocation field value. +func (o *ModelLabProjectAttributes) GetArtifactStorageLocation() string { + if o == nil { + var ret string + return ret + } + return o.ArtifactStorageLocation +} + +// GetArtifactStorageLocationOk returns a tuple with the ArtifactStorageLocation field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetArtifactStorageLocationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ArtifactStorageLocation, true +} + +// SetArtifactStorageLocation sets field value. +func (o *ModelLabProjectAttributes) SetArtifactStorageLocation(v string) { + o.ArtifactStorageLocation = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *ModelLabProjectAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *ModelLabProjectAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabProjectAttributes) GetDeletedAt() time.Time { + if o == nil || o.DeletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.DeletedAt.Get() +} + +// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabProjectAttributes) GetDeletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DeletedAt.Get(), o.DeletedAt.IsSet() +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *ModelLabProjectAttributes) HasDeletedAt() bool { + return o != nil && o.DeletedAt.IsSet() +} + +// SetDeletedAt gets a reference to the given datadog.NullableTime and assigns it to the DeletedAt field. +func (o *ModelLabProjectAttributes) SetDeletedAt(v time.Time) { + o.DeletedAt.Set(&v) +} + +// SetDeletedAtNil sets the value for DeletedAt to be an explicit nil. +func (o *ModelLabProjectAttributes) SetDeletedAtNil() { + o.DeletedAt.Set(nil) +} + +// UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil. +func (o *ModelLabProjectAttributes) UnsetDeletedAt() { + o.DeletedAt.Unset() +} + +// GetDescription returns the Description field value. +func (o *ModelLabProjectAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *ModelLabProjectAttributes) SetDescription(v string) { + o.Description = v +} + +// GetExternalUrl returns the ExternalUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabProjectAttributes) GetExternalUrl() string { + if o == nil || o.ExternalUrl.Get() == nil { + var ret string + return ret + } + return *o.ExternalUrl.Get() +} + +// GetExternalUrlOk returns a tuple with the ExternalUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabProjectAttributes) GetExternalUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExternalUrl.Get(), o.ExternalUrl.IsSet() +} + +// HasExternalUrl returns a boolean if a field has been set. +func (o *ModelLabProjectAttributes) HasExternalUrl() bool { + return o != nil && o.ExternalUrl.IsSet() +} + +// SetExternalUrl gets a reference to the given datadog.NullableString and assigns it to the ExternalUrl field. +func (o *ModelLabProjectAttributes) SetExternalUrl(v string) { + o.ExternalUrl.Set(&v) +} + +// SetExternalUrlNil sets the value for ExternalUrl to be an explicit nil. +func (o *ModelLabProjectAttributes) SetExternalUrlNil() { + o.ExternalUrl.Set(nil) +} + +// UnsetExternalUrl ensures that no value is present for ExternalUrl, not even an explicit nil. +func (o *ModelLabProjectAttributes) UnsetExternalUrl() { + o.ExternalUrl.Unset() +} + +// GetIsStarred returns the IsStarred field value. +func (o *ModelLabProjectAttributes) GetIsStarred() bool { + if o == nil { + var ret bool + return ret + } + return o.IsStarred +} + +// GetIsStarredOk returns a tuple with the IsStarred field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetIsStarredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsStarred, true +} + +// SetIsStarred sets field value. +func (o *ModelLabProjectAttributes) SetIsStarred(v bool) { + o.IsStarred = v +} + +// GetName returns the Name field value. +func (o *ModelLabProjectAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *ModelLabProjectAttributes) SetName(v string) { + o.Name = v +} + +// GetOwnerId returns the OwnerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabProjectAttributes) GetOwnerId() string { + if o == nil || o.OwnerId.Get() == nil { + var ret string + return ret + } + return *o.OwnerId.Get() +} + +// GetOwnerIdOk returns a tuple with the OwnerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabProjectAttributes) GetOwnerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OwnerId.Get(), o.OwnerId.IsSet() +} + +// HasOwnerId returns a boolean if a field has been set. +func (o *ModelLabProjectAttributes) HasOwnerId() bool { + return o != nil && o.OwnerId.IsSet() +} + +// SetOwnerId gets a reference to the given datadog.NullableString and assigns it to the OwnerId field. +func (o *ModelLabProjectAttributes) SetOwnerId(v string) { + o.OwnerId.Set(&v) +} + +// SetOwnerIdNil sets the value for OwnerId to be an explicit nil. +func (o *ModelLabProjectAttributes) SetOwnerIdNil() { + o.OwnerId.Set(nil) +} + +// UnsetOwnerId ensures that no value is present for OwnerId, not even an explicit nil. +func (o *ModelLabProjectAttributes) UnsetOwnerId() { + o.OwnerId.Unset() +} + +// GetTags returns the Tags field value. +func (o *ModelLabProjectAttributes) GetTags() []ModelLabTag { + if o == nil { + var ret []ModelLabTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetTagsOk() (*[]ModelLabTag, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *ModelLabProjectAttributes) SetTags(v []ModelLabTag) { + o.Tags = v +} + +// GetUpdatedAt returns the UpdatedAt field value. +func (o *ModelLabProjectAttributes) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectAttributes) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value. +func (o *ModelLabProjectAttributes) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["artifact_storage_location"] = o.ArtifactStorageLocation + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.DeletedAt.IsSet() { + toSerialize["deleted_at"] = o.DeletedAt.Get() + } + toSerialize["description"] = o.Description + if o.ExternalUrl.IsSet() { + toSerialize["external_url"] = o.ExternalUrl.Get() + } + toSerialize["is_starred"] = o.IsStarred + toSerialize["name"] = o.Name + if o.OwnerId.IsSet() { + toSerialize["owner_id"] = o.OwnerId.Get() + } + toSerialize["tags"] = o.Tags + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ArtifactStorageLocation *string `json:"artifact_storage_location"` + CreatedAt *time.Time `json:"created_at"` + DeletedAt datadog.NullableTime `json:"deleted_at,omitempty"` + Description *string `json:"description"` + ExternalUrl datadog.NullableString `json:"external_url,omitempty"` + IsStarred *bool `json:"is_starred"` + Name *string `json:"name"` + OwnerId datadog.NullableString `json:"owner_id,omitempty"` + Tags *[]ModelLabTag `json:"tags"` + UpdatedAt *time.Time `json:"updated_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ArtifactStorageLocation == nil { + return fmt.Errorf("required field artifact_storage_location missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.IsStarred == nil { + return fmt.Errorf("required field is_starred missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + if all.UpdatedAt == nil { + return fmt.Errorf("required field updated_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"artifact_storage_location", "created_at", "deleted_at", "description", "external_url", "is_starred", "name", "owner_id", "tags", "updated_at"}) + } else { + return err + } + o.ArtifactStorageLocation = *all.ArtifactStorageLocation + o.CreatedAt = *all.CreatedAt + o.DeletedAt = all.DeletedAt + o.Description = *all.Description + o.ExternalUrl = all.ExternalUrl + o.IsStarred = *all.IsStarred + o.Name = *all.Name + o.OwnerId = all.OwnerId + o.Tags = *all.Tags + o.UpdatedAt = *all.UpdatedAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_data.go b/api/datadogV2/model_model_lab_project_data.go new file mode 100644 index 00000000000..73a04750341 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectData A Model Lab project JSON:API resource object. +type ModelLabProjectData struct { + // Attributes of a Model Lab project. + Attributes ModelLabProjectAttributes `json:"attributes"` + // The unique identifier of the project. + Id string `json:"id"` + // The JSON:API type for a Model Lab project resource. + Type ModelLabProjectType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectData instantiates a new ModelLabProjectData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectData(attributes ModelLabProjectAttributes, id string, typeVar ModelLabProjectType) *ModelLabProjectData { + this := ModelLabProjectData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabProjectDataWithDefaults instantiates a new ModelLabProjectData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectDataWithDefaults() *ModelLabProjectData { + this := ModelLabProjectData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabProjectData) GetAttributes() ModelLabProjectAttributes { + if o == nil { + var ret ModelLabProjectAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectData) GetAttributesOk() (*ModelLabProjectAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabProjectData) SetAttributes(v ModelLabProjectAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabProjectData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabProjectData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabProjectData) GetType() ModelLabProjectType { + if o == nil { + var ret ModelLabProjectType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectData) GetTypeOk() (*ModelLabProjectType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabProjectData) SetType(v ModelLabProjectType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabProjectAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabProjectType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_facet_type.go b/api/datadogV2/model_model_lab_project_facet_type.go new file mode 100644 index 00000000000..2ffb9d0dd41 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_facet_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectFacetType The type of facet for filtering Model Lab projects. +type ModelLabProjectFacetType string + +// List of ModelLabProjectFacetType. +const ( + MODELLABPROJECTFACETTYPE_TAG ModelLabProjectFacetType = "tag" +) + +var allowedModelLabProjectFacetTypeEnumValues = []ModelLabProjectFacetType{ + MODELLABPROJECTFACETTYPE_TAG, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabProjectFacetType) GetAllowedValues() []ModelLabProjectFacetType { + return allowedModelLabProjectFacetTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabProjectFacetType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabProjectFacetType(value) + return nil +} + +// NewModelLabProjectFacetTypeFromValue returns a pointer to a valid ModelLabProjectFacetType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabProjectFacetTypeFromValue(v string) (*ModelLabProjectFacetType, error) { + ev := ModelLabProjectFacetType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabProjectFacetType: valid values are %v", v, allowedModelLabProjectFacetTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabProjectFacetType) IsValid() bool { + for _, existing := range allowedModelLabProjectFacetTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabProjectFacetType value. +func (v ModelLabProjectFacetType) Ptr() *ModelLabProjectFacetType { + return &v +} diff --git a/api/datadogV2/model_model_lab_project_response.go b/api/datadogV2/model_model_lab_project_response.go new file mode 100644 index 00000000000..91fb6538c80 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectResponse Response containing a single Model Lab project. +type ModelLabProjectResponse struct { + // A Model Lab project JSON:API resource object. + Data ModelLabProjectData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectResponse instantiates a new ModelLabProjectResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectResponse(data ModelLabProjectData) *ModelLabProjectResponse { + this := ModelLabProjectResponse{} + this.Data = data + return &this +} + +// NewModelLabProjectResponseWithDefaults instantiates a new ModelLabProjectResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectResponseWithDefaults() *ModelLabProjectResponse { + this := ModelLabProjectResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabProjectResponse) GetData() ModelLabProjectData { + if o == nil { + var ret ModelLabProjectData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectResponse) GetDataOk() (*ModelLabProjectData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabProjectResponse) SetData(v ModelLabProjectData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabProjectData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_project_type.go b/api/datadogV2/model_model_lab_project_type.go new file mode 100644 index 00000000000..05ca18470d1 --- /dev/null +++ b/api/datadogV2/model_model_lab_project_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectType The JSON:API type for a Model Lab project resource. +type ModelLabProjectType string + +// List of ModelLabProjectType. +const ( + MODELLABPROJECTTYPE_PROJECTS ModelLabProjectType = "projects" +) + +var allowedModelLabProjectTypeEnumValues = []ModelLabProjectType{ + MODELLABPROJECTTYPE_PROJECTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabProjectType) GetAllowedValues() []ModelLabProjectType { + return allowedModelLabProjectTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabProjectType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabProjectType(value) + return nil +} + +// NewModelLabProjectTypeFromValue returns a pointer to a valid ModelLabProjectType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabProjectTypeFromValue(v string) (*ModelLabProjectType, error) { + ev := ModelLabProjectType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabProjectType: valid values are %v", v, allowedModelLabProjectTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabProjectType) IsValid() bool { + for _, existing := range allowedModelLabProjectTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabProjectType value. +func (v ModelLabProjectType) Ptr() *ModelLabProjectType { + return &v +} diff --git a/api/datadogV2/model_model_lab_projects_response.go b/api/datadogV2/model_model_lab_projects_response.go new file mode 100644 index 00000000000..3cf0de4cea1 --- /dev/null +++ b/api/datadogV2/model_model_lab_projects_response.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabProjectsResponse Response containing a list of Model Lab projects with pagination metadata. +type ModelLabProjectsResponse struct { + // The list of projects. + Data []ModelLabProjectData `json:"data"` + // Pagination links for navigating list responses. + Links *ModelLabPaginationLinks `json:"links,omitempty"` + // Pagination metadata for a list response. + Meta ModelLabPageMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabProjectsResponse instantiates a new ModelLabProjectsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabProjectsResponse(data []ModelLabProjectData, meta ModelLabPageMeta) *ModelLabProjectsResponse { + this := ModelLabProjectsResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewModelLabProjectsResponseWithDefaults instantiates a new ModelLabProjectsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabProjectsResponseWithDefaults() *ModelLabProjectsResponse { + this := ModelLabProjectsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabProjectsResponse) GetData() []ModelLabProjectData { + if o == nil { + var ret []ModelLabProjectData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectsResponse) GetDataOk() (*[]ModelLabProjectData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabProjectsResponse) SetData(v []ModelLabProjectData) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ModelLabProjectsResponse) GetLinks() ModelLabPaginationLinks { + if o == nil || o.Links == nil { + var ret ModelLabPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabProjectsResponse) GetLinksOk() (*ModelLabPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ModelLabProjectsResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given ModelLabPaginationLinks and assigns it to the Links field. +func (o *ModelLabProjectsResponse) SetLinks(v ModelLabPaginationLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value. +func (o *ModelLabProjectsResponse) GetMeta() ModelLabPageMeta { + if o == nil { + var ret ModelLabPageMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *ModelLabProjectsResponse) GetMetaOk() (*ModelLabPageMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *ModelLabProjectsResponse) SetMeta(v ModelLabPageMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabProjectsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabProjectsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]ModelLabProjectData `json:"data"` + Links *ModelLabPaginationLinks `json:"links,omitempty"` + Meta *ModelLabPageMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_artifacts_attributes.go b/api/datadogV2/model_model_lab_run_artifacts_attributes.go new file mode 100644 index 00000000000..658262cb354 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_artifacts_attributes.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunArtifactsAttributes Artifact listing for a Model Lab run. +type ModelLabRunArtifactsAttributes struct { + // The list of artifact files and directories. + Files []ModelLabArtifactObjectInfo `json:"files"` + // The path of the run's artifacts relative to the project's artifact root. + PathInProject string `json:"path_in_project"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunArtifactsAttributes instantiates a new ModelLabRunArtifactsAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunArtifactsAttributes(files []ModelLabArtifactObjectInfo, pathInProject string) *ModelLabRunArtifactsAttributes { + this := ModelLabRunArtifactsAttributes{} + this.Files = files + this.PathInProject = pathInProject + return &this +} + +// NewModelLabRunArtifactsAttributesWithDefaults instantiates a new ModelLabRunArtifactsAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunArtifactsAttributesWithDefaults() *ModelLabRunArtifactsAttributes { + this := ModelLabRunArtifactsAttributes{} + return &this +} + +// GetFiles returns the Files field value. +func (o *ModelLabRunArtifactsAttributes) GetFiles() []ModelLabArtifactObjectInfo { + if o == nil { + var ret []ModelLabArtifactObjectInfo + return ret + } + return o.Files +} + +// GetFilesOk returns a tuple with the Files field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsAttributes) GetFilesOk() (*[]ModelLabArtifactObjectInfo, bool) { + if o == nil { + return nil, false + } + return &o.Files, true +} + +// SetFiles sets field value. +func (o *ModelLabRunArtifactsAttributes) SetFiles(v []ModelLabArtifactObjectInfo) { + o.Files = v +} + +// GetPathInProject returns the PathInProject field value. +func (o *ModelLabRunArtifactsAttributes) GetPathInProject() string { + if o == nil { + var ret string + return ret + } + return o.PathInProject +} + +// GetPathInProjectOk returns a tuple with the PathInProject field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsAttributes) GetPathInProjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PathInProject, true +} + +// SetPathInProject sets field value. +func (o *ModelLabRunArtifactsAttributes) SetPathInProject(v string) { + o.PathInProject = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunArtifactsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["files"] = o.Files + toSerialize["path_in_project"] = o.PathInProject + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunArtifactsAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Files *[]ModelLabArtifactObjectInfo `json:"files"` + PathInProject *string `json:"path_in_project"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Files == nil { + return fmt.Errorf("required field files missing") + } + if all.PathInProject == nil { + return fmt.Errorf("required field path_in_project missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"files", "path_in_project"}) + } else { + return err + } + o.Files = *all.Files + o.PathInProject = *all.PathInProject + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_artifacts_data.go b/api/datadogV2/model_model_lab_run_artifacts_data.go new file mode 100644 index 00000000000..c910207ee10 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_artifacts_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunArtifactsData A run artifacts JSON:API resource object. +type ModelLabRunArtifactsData struct { + // Artifact listing for a Model Lab run. + Attributes ModelLabRunArtifactsAttributes `json:"attributes"` + // The unique identifier of the artifacts resource. + Id string `json:"id"` + // The JSON:API type for a run artifacts resource. + Type ModelLabRunArtifactsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunArtifactsData instantiates a new ModelLabRunArtifactsData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunArtifactsData(attributes ModelLabRunArtifactsAttributes, id string, typeVar ModelLabRunArtifactsType) *ModelLabRunArtifactsData { + this := ModelLabRunArtifactsData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabRunArtifactsDataWithDefaults instantiates a new ModelLabRunArtifactsData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunArtifactsDataWithDefaults() *ModelLabRunArtifactsData { + this := ModelLabRunArtifactsData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabRunArtifactsData) GetAttributes() ModelLabRunArtifactsAttributes { + if o == nil { + var ret ModelLabRunArtifactsAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsData) GetAttributesOk() (*ModelLabRunArtifactsAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabRunArtifactsData) SetAttributes(v ModelLabRunArtifactsAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabRunArtifactsData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabRunArtifactsData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabRunArtifactsData) GetType() ModelLabRunArtifactsType { + if o == nil { + var ret ModelLabRunArtifactsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsData) GetTypeOk() (*ModelLabRunArtifactsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabRunArtifactsData) SetType(v ModelLabRunArtifactsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunArtifactsData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunArtifactsData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabRunArtifactsAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabRunArtifactsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_artifacts_response.go b/api/datadogV2/model_model_lab_run_artifacts_response.go new file mode 100644 index 00000000000..4206ab245ba --- /dev/null +++ b/api/datadogV2/model_model_lab_run_artifacts_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunArtifactsResponse Response containing the artifact listing for a Model Lab run. +type ModelLabRunArtifactsResponse struct { + // A run artifacts JSON:API resource object. + Data ModelLabRunArtifactsData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunArtifactsResponse instantiates a new ModelLabRunArtifactsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunArtifactsResponse(data ModelLabRunArtifactsData) *ModelLabRunArtifactsResponse { + this := ModelLabRunArtifactsResponse{} + this.Data = data + return &this +} + +// NewModelLabRunArtifactsResponseWithDefaults instantiates a new ModelLabRunArtifactsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunArtifactsResponseWithDefaults() *ModelLabRunArtifactsResponse { + this := ModelLabRunArtifactsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabRunArtifactsResponse) GetData() ModelLabRunArtifactsData { + if o == nil { + var ret ModelLabRunArtifactsData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunArtifactsResponse) GetDataOk() (*ModelLabRunArtifactsData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabRunArtifactsResponse) SetData(v ModelLabRunArtifactsData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunArtifactsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunArtifactsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabRunArtifactsData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_artifacts_type.go b/api/datadogV2/model_model_lab_run_artifacts_type.go new file mode 100644 index 00000000000..bf2fb3c2278 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_artifacts_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunArtifactsType The JSON:API type for a run artifacts resource. +type ModelLabRunArtifactsType string + +// List of ModelLabRunArtifactsType. +const ( + MODELLABRUNARTIFACTSTYPE_ARTIFACTS ModelLabRunArtifactsType = "artifacts" +) + +var allowedModelLabRunArtifactsTypeEnumValues = []ModelLabRunArtifactsType{ + MODELLABRUNARTIFACTSTYPE_ARTIFACTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabRunArtifactsType) GetAllowedValues() []ModelLabRunArtifactsType { + return allowedModelLabRunArtifactsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabRunArtifactsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabRunArtifactsType(value) + return nil +} + +// NewModelLabRunArtifactsTypeFromValue returns a pointer to a valid ModelLabRunArtifactsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabRunArtifactsTypeFromValue(v string) (*ModelLabRunArtifactsType, error) { + ev := ModelLabRunArtifactsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabRunArtifactsType: valid values are %v", v, allowedModelLabRunArtifactsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabRunArtifactsType) IsValid() bool { + for _, existing := range allowedModelLabRunArtifactsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabRunArtifactsType value. +func (v ModelLabRunArtifactsType) Ptr() *ModelLabRunArtifactsType { + return &v +} diff --git a/api/datadogV2/model_model_lab_run_attributes.go b/api/datadogV2/model_model_lab_run_attributes.go new file mode 100644 index 00000000000..6802dd89b37 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_attributes.go @@ -0,0 +1,772 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunAttributes Attributes of a Model Lab run. +type ModelLabRunAttributes struct { + // The date and time the run completed. + CompletedAt datadog.NullableTime `json:"completed_at,omitempty"` + // The date and time the run was created. + CreatedAt time.Time `json:"created_at"` + // The date and time the run was soft-deleted. + DeletedAt datadog.NullableTime `json:"deleted_at,omitempty"` + // Whether a descendant run matched the applied filters. + DescendantMatch bool `json:"descendant_match"` + // A description of the run. + Description string `json:"description"` + // The duration of the run in seconds. + Duration datadog.NullableFloat64 `json:"duration,omitempty"` + // An optional external URL associated with the run. + ExternalUrl datadog.NullableString `json:"external_url,omitempty"` + // Whether the run has child runs. + HasChildren bool `json:"has_children"` + // Whether the run is pinned by the current user. + IsPinned bool `json:"is_pinned"` + // Summary statistics for metrics recorded during the run. + MetricSummaries []ModelLabMetricSummary `json:"metric_summaries"` + // The MLflow artifact storage location for this run. + MlflowArtifactLocation string `json:"mlflow_artifact_location"` + // The name of the run. + Name string `json:"name"` + // The UUID of the run owner. + OwnerId datadog.NullableString `json:"owner_id,omitempty"` + // The list of parameters used for the run. + Params datadog.NullableList[ModelLabRunParam] `json:"params"` + // The ID of the project this run belongs to. + ProjectId int64 `json:"project_id"` + // The date and time the run started. + StartedAt time.Time `json:"started_at"` + // The status of a Model Lab run. + Status ModelLabRunStatus `json:"status"` + // The list of tags associated with the run. + Tags []ModelLabTag `json:"tags"` + // The date and time the run was last updated. + UpdatedAt time.Time `json:"updated_at"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunAttributes instantiates a new ModelLabRunAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunAttributes(createdAt time.Time, descendantMatch bool, description string, hasChildren bool, isPinned bool, metricSummaries []ModelLabMetricSummary, mlflowArtifactLocation string, name string, params datadog.NullableList[ModelLabRunParam], projectId int64, startedAt time.Time, status ModelLabRunStatus, tags []ModelLabTag, updatedAt time.Time) *ModelLabRunAttributes { + this := ModelLabRunAttributes{} + this.CreatedAt = createdAt + this.DescendantMatch = descendantMatch + this.Description = description + this.HasChildren = hasChildren + this.IsPinned = isPinned + this.MetricSummaries = metricSummaries + this.MlflowArtifactLocation = mlflowArtifactLocation + this.Name = name + this.Params = params + this.ProjectId = projectId + this.StartedAt = startedAt + this.Status = status + this.Tags = tags + this.UpdatedAt = updatedAt + return &this +} + +// NewModelLabRunAttributesWithDefaults instantiates a new ModelLabRunAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunAttributesWithDefaults() *ModelLabRunAttributes { + this := ModelLabRunAttributes{} + return &this +} + +// GetCompletedAt returns the CompletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabRunAttributes) GetCompletedAt() time.Time { + if o == nil || o.CompletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.CompletedAt.Get() +} + +// GetCompletedAtOk returns a tuple with the CompletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetCompletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CompletedAt.Get(), o.CompletedAt.IsSet() +} + +// HasCompletedAt returns a boolean if a field has been set. +func (o *ModelLabRunAttributes) HasCompletedAt() bool { + return o != nil && o.CompletedAt.IsSet() +} + +// SetCompletedAt gets a reference to the given datadog.NullableTime and assigns it to the CompletedAt field. +func (o *ModelLabRunAttributes) SetCompletedAt(v time.Time) { + o.CompletedAt.Set(&v) +} + +// SetCompletedAtNil sets the value for CompletedAt to be an explicit nil. +func (o *ModelLabRunAttributes) SetCompletedAtNil() { + o.CompletedAt.Set(nil) +} + +// UnsetCompletedAt ensures that no value is present for CompletedAt, not even an explicit nil. +func (o *ModelLabRunAttributes) UnsetCompletedAt() { + o.CompletedAt.Unset() +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *ModelLabRunAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *ModelLabRunAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabRunAttributes) GetDeletedAt() time.Time { + if o == nil || o.DeletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.DeletedAt.Get() +} + +// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetDeletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DeletedAt.Get(), o.DeletedAt.IsSet() +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *ModelLabRunAttributes) HasDeletedAt() bool { + return o != nil && o.DeletedAt.IsSet() +} + +// SetDeletedAt gets a reference to the given datadog.NullableTime and assigns it to the DeletedAt field. +func (o *ModelLabRunAttributes) SetDeletedAt(v time.Time) { + o.DeletedAt.Set(&v) +} + +// SetDeletedAtNil sets the value for DeletedAt to be an explicit nil. +func (o *ModelLabRunAttributes) SetDeletedAtNil() { + o.DeletedAt.Set(nil) +} + +// UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil. +func (o *ModelLabRunAttributes) UnsetDeletedAt() { + o.DeletedAt.Unset() +} + +// GetDescendantMatch returns the DescendantMatch field value. +func (o *ModelLabRunAttributes) GetDescendantMatch() bool { + if o == nil { + var ret bool + return ret + } + return o.DescendantMatch +} + +// GetDescendantMatchOk returns a tuple with the DescendantMatch field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetDescendantMatchOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.DescendantMatch, true +} + +// SetDescendantMatch sets field value. +func (o *ModelLabRunAttributes) SetDescendantMatch(v bool) { + o.DescendantMatch = v +} + +// GetDescription returns the Description field value. +func (o *ModelLabRunAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *ModelLabRunAttributes) SetDescription(v string) { + o.Description = v +} + +// GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabRunAttributes) GetDuration() float64 { + if o == nil || o.Duration.Get() == nil { + var ret float64 + return ret + } + return *o.Duration.Get() +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetDurationOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Duration.Get(), o.Duration.IsSet() +} + +// HasDuration returns a boolean if a field has been set. +func (o *ModelLabRunAttributes) HasDuration() bool { + return o != nil && o.Duration.IsSet() +} + +// SetDuration gets a reference to the given datadog.NullableFloat64 and assigns it to the Duration field. +func (o *ModelLabRunAttributes) SetDuration(v float64) { + o.Duration.Set(&v) +} + +// SetDurationNil sets the value for Duration to be an explicit nil. +func (o *ModelLabRunAttributes) SetDurationNil() { + o.Duration.Set(nil) +} + +// UnsetDuration ensures that no value is present for Duration, not even an explicit nil. +func (o *ModelLabRunAttributes) UnsetDuration() { + o.Duration.Unset() +} + +// GetExternalUrl returns the ExternalUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabRunAttributes) GetExternalUrl() string { + if o == nil || o.ExternalUrl.Get() == nil { + var ret string + return ret + } + return *o.ExternalUrl.Get() +} + +// GetExternalUrlOk returns a tuple with the ExternalUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetExternalUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExternalUrl.Get(), o.ExternalUrl.IsSet() +} + +// HasExternalUrl returns a boolean if a field has been set. +func (o *ModelLabRunAttributes) HasExternalUrl() bool { + return o != nil && o.ExternalUrl.IsSet() +} + +// SetExternalUrl gets a reference to the given datadog.NullableString and assigns it to the ExternalUrl field. +func (o *ModelLabRunAttributes) SetExternalUrl(v string) { + o.ExternalUrl.Set(&v) +} + +// SetExternalUrlNil sets the value for ExternalUrl to be an explicit nil. +func (o *ModelLabRunAttributes) SetExternalUrlNil() { + o.ExternalUrl.Set(nil) +} + +// UnsetExternalUrl ensures that no value is present for ExternalUrl, not even an explicit nil. +func (o *ModelLabRunAttributes) UnsetExternalUrl() { + o.ExternalUrl.Unset() +} + +// GetHasChildren returns the HasChildren field value. +func (o *ModelLabRunAttributes) GetHasChildren() bool { + if o == nil { + var ret bool + return ret + } + return o.HasChildren +} + +// GetHasChildrenOk returns a tuple with the HasChildren field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetHasChildrenOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasChildren, true +} + +// SetHasChildren sets field value. +func (o *ModelLabRunAttributes) SetHasChildren(v bool) { + o.HasChildren = v +} + +// GetIsPinned returns the IsPinned field value. +func (o *ModelLabRunAttributes) GetIsPinned() bool { + if o == nil { + var ret bool + return ret + } + return o.IsPinned +} + +// GetIsPinnedOk returns a tuple with the IsPinned field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetIsPinnedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPinned, true +} + +// SetIsPinned sets field value. +func (o *ModelLabRunAttributes) SetIsPinned(v bool) { + o.IsPinned = v +} + +// GetMetricSummaries returns the MetricSummaries field value. +func (o *ModelLabRunAttributes) GetMetricSummaries() []ModelLabMetricSummary { + if o == nil { + var ret []ModelLabMetricSummary + return ret + } + return o.MetricSummaries +} + +// GetMetricSummariesOk returns a tuple with the MetricSummaries field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetMetricSummariesOk() (*[]ModelLabMetricSummary, bool) { + if o == nil { + return nil, false + } + return &o.MetricSummaries, true +} + +// SetMetricSummaries sets field value. +func (o *ModelLabRunAttributes) SetMetricSummaries(v []ModelLabMetricSummary) { + o.MetricSummaries = v +} + +// GetMlflowArtifactLocation returns the MlflowArtifactLocation field value. +func (o *ModelLabRunAttributes) GetMlflowArtifactLocation() string { + if o == nil { + var ret string + return ret + } + return o.MlflowArtifactLocation +} + +// GetMlflowArtifactLocationOk returns a tuple with the MlflowArtifactLocation field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetMlflowArtifactLocationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MlflowArtifactLocation, true +} + +// SetMlflowArtifactLocation sets field value. +func (o *ModelLabRunAttributes) SetMlflowArtifactLocation(v string) { + o.MlflowArtifactLocation = v +} + +// GetName returns the Name field value. +func (o *ModelLabRunAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *ModelLabRunAttributes) SetName(v string) { + o.Name = v +} + +// GetOwnerId returns the OwnerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModelLabRunAttributes) GetOwnerId() string { + if o == nil || o.OwnerId.Get() == nil { + var ret string + return ret + } + return *o.OwnerId.Get() +} + +// GetOwnerIdOk returns a tuple with the OwnerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetOwnerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OwnerId.Get(), o.OwnerId.IsSet() +} + +// HasOwnerId returns a boolean if a field has been set. +func (o *ModelLabRunAttributes) HasOwnerId() bool { + return o != nil && o.OwnerId.IsSet() +} + +// SetOwnerId gets a reference to the given datadog.NullableString and assigns it to the OwnerId field. +func (o *ModelLabRunAttributes) SetOwnerId(v string) { + o.OwnerId.Set(&v) +} + +// SetOwnerIdNil sets the value for OwnerId to be an explicit nil. +func (o *ModelLabRunAttributes) SetOwnerIdNil() { + o.OwnerId.Set(nil) +} + +// UnsetOwnerId ensures that no value is present for OwnerId, not even an explicit nil. +func (o *ModelLabRunAttributes) UnsetOwnerId() { + o.OwnerId.Unset() +} + +// GetParams returns the Params field value. +// If the value is explicit nil, the zero value for []ModelLabRunParam will be returned. +func (o *ModelLabRunAttributes) GetParams() []ModelLabRunParam { + if o == nil { + var ret []ModelLabRunParam + return ret + } + return *o.Params.Get() +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *ModelLabRunAttributes) GetParamsOk() (*[]ModelLabRunParam, bool) { + if o == nil { + return nil, false + } + return o.Params.Get(), o.Params.IsSet() +} + +// SetParams sets field value. +func (o *ModelLabRunAttributes) SetParams(v []ModelLabRunParam) { + o.Params.Set(&v) +} + +// GetProjectId returns the ProjectId field value. +func (o *ModelLabRunAttributes) GetProjectId() int64 { + if o == nil { + var ret int64 + return ret + } + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetProjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value. +func (o *ModelLabRunAttributes) SetProjectId(v int64) { + o.ProjectId = v +} + +// GetStartedAt returns the StartedAt field value. +func (o *ModelLabRunAttributes) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value. +func (o *ModelLabRunAttributes) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetStatus returns the Status field value. +func (o *ModelLabRunAttributes) GetStatus() ModelLabRunStatus { + if o == nil { + var ret ModelLabRunStatus + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetStatusOk() (*ModelLabRunStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *ModelLabRunAttributes) SetStatus(v ModelLabRunStatus) { + o.Status = v +} + +// GetTags returns the Tags field value. +func (o *ModelLabRunAttributes) GetTags() []ModelLabTag { + if o == nil { + var ret []ModelLabTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetTagsOk() (*[]ModelLabTag, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *ModelLabRunAttributes) SetTags(v []ModelLabTag) { + o.Tags = v +} + +// GetUpdatedAt returns the UpdatedAt field value. +func (o *ModelLabRunAttributes) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunAttributes) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value. +func (o *ModelLabRunAttributes) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CompletedAt.IsSet() { + toSerialize["completed_at"] = o.CompletedAt.Get() + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.DeletedAt.IsSet() { + toSerialize["deleted_at"] = o.DeletedAt.Get() + } + toSerialize["descendant_match"] = o.DescendantMatch + toSerialize["description"] = o.Description + if o.Duration.IsSet() { + toSerialize["duration"] = o.Duration.Get() + } + if o.ExternalUrl.IsSet() { + toSerialize["external_url"] = o.ExternalUrl.Get() + } + toSerialize["has_children"] = o.HasChildren + toSerialize["is_pinned"] = o.IsPinned + toSerialize["metric_summaries"] = o.MetricSummaries + toSerialize["mlflow_artifact_location"] = o.MlflowArtifactLocation + toSerialize["name"] = o.Name + if o.OwnerId.IsSet() { + toSerialize["owner_id"] = o.OwnerId.Get() + } + toSerialize["params"] = o.Params.Get() + toSerialize["project_id"] = o.ProjectId + if o.StartedAt.Nanosecond() == 0 { + toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["started_at"] = o.StartedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["status"] = o.Status + toSerialize["tags"] = o.Tags + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CompletedAt datadog.NullableTime `json:"completed_at,omitempty"` + CreatedAt *time.Time `json:"created_at"` + DeletedAt datadog.NullableTime `json:"deleted_at,omitempty"` + DescendantMatch *bool `json:"descendant_match"` + Description *string `json:"description"` + Duration datadog.NullableFloat64 `json:"duration,omitempty"` + ExternalUrl datadog.NullableString `json:"external_url,omitempty"` + HasChildren *bool `json:"has_children"` + IsPinned *bool `json:"is_pinned"` + MetricSummaries *[]ModelLabMetricSummary `json:"metric_summaries"` + MlflowArtifactLocation *string `json:"mlflow_artifact_location"` + Name *string `json:"name"` + OwnerId datadog.NullableString `json:"owner_id,omitempty"` + Params datadog.NullableList[ModelLabRunParam] `json:"params"` + ProjectId *int64 `json:"project_id"` + StartedAt *time.Time `json:"started_at"` + Status *ModelLabRunStatus `json:"status"` + Tags *[]ModelLabTag `json:"tags"` + UpdatedAt *time.Time `json:"updated_at"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.DescendantMatch == nil { + return fmt.Errorf("required field descendant_match missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.HasChildren == nil { + return fmt.Errorf("required field has_children missing") + } + if all.IsPinned == nil { + return fmt.Errorf("required field is_pinned missing") + } + if all.MetricSummaries == nil { + return fmt.Errorf("required field metric_summaries missing") + } + if all.MlflowArtifactLocation == nil { + return fmt.Errorf("required field mlflow_artifact_location missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if !all.Params.IsSet() { + return fmt.Errorf("required field params missing") + } + if all.ProjectId == nil { + return fmt.Errorf("required field project_id missing") + } + if all.StartedAt == nil { + return fmt.Errorf("required field started_at missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + if all.UpdatedAt == nil { + return fmt.Errorf("required field updated_at missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"completed_at", "created_at", "deleted_at", "descendant_match", "description", "duration", "external_url", "has_children", "is_pinned", "metric_summaries", "mlflow_artifact_location", "name", "owner_id", "params", "project_id", "started_at", "status", "tags", "updated_at"}) + } else { + return err + } + + hasInvalidField := false + o.CompletedAt = all.CompletedAt + o.CreatedAt = *all.CreatedAt + o.DeletedAt = all.DeletedAt + o.DescendantMatch = *all.DescendantMatch + o.Description = *all.Description + o.Duration = all.Duration + o.ExternalUrl = all.ExternalUrl + o.HasChildren = *all.HasChildren + o.IsPinned = *all.IsPinned + o.MetricSummaries = *all.MetricSummaries + o.MlflowArtifactLocation = *all.MlflowArtifactLocation + o.Name = *all.Name + o.OwnerId = all.OwnerId + o.Params = all.Params + o.ProjectId = *all.ProjectId + o.StartedAt = *all.StartedAt + if !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = *all.Status + } + o.Tags = *all.Tags + o.UpdatedAt = *all.UpdatedAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_data.go b/api/datadogV2/model_model_lab_run_data.go new file mode 100644 index 00000000000..f0ec1c05b71 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunData A Model Lab run JSON:API resource object. +type ModelLabRunData struct { + // Attributes of a Model Lab run. + Attributes ModelLabRunAttributes `json:"attributes"` + // The unique identifier of the run. + Id string `json:"id"` + // The JSON:API type for a Model Lab run resource. + Type ModelLabRunType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunData instantiates a new ModelLabRunData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunData(attributes ModelLabRunAttributes, id string, typeVar ModelLabRunType) *ModelLabRunData { + this := ModelLabRunData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewModelLabRunDataWithDefaults instantiates a new ModelLabRunData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunDataWithDefaults() *ModelLabRunData { + this := ModelLabRunData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ModelLabRunData) GetAttributes() ModelLabRunAttributes { + if o == nil { + var ret ModelLabRunAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunData) GetAttributesOk() (*ModelLabRunAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ModelLabRunData) SetAttributes(v ModelLabRunAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ModelLabRunData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ModelLabRunData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ModelLabRunData) GetType() ModelLabRunType { + if o == nil { + var ret ModelLabRunType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunData) GetTypeOk() (*ModelLabRunType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ModelLabRunData) SetType(v ModelLabRunType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ModelLabRunAttributes `json:"attributes"` + Id *string `json:"id"` + Type *ModelLabRunType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_param.go b/api/datadogV2/model_model_lab_run_param.go new file mode 100644 index 00000000000..a1f1a083f71 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_param.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunParam A key-value parameter for a Model Lab run. +type ModelLabRunParam struct { + // The parameter key. + Key string `json:"key"` + // The parameter value. + Value string `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunParam instantiates a new ModelLabRunParam object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunParam(key string, value string) *ModelLabRunParam { + this := ModelLabRunParam{} + this.Key = key + this.Value = value + return &this +} + +// NewModelLabRunParamWithDefaults instantiates a new ModelLabRunParam object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunParamWithDefaults() *ModelLabRunParam { + this := ModelLabRunParam{} + return &this +} + +// GetKey returns the Key field value. +func (o *ModelLabRunParam) GetKey() string { + if o == nil { + var ret string + return ret + } + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunParam) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value. +func (o *ModelLabRunParam) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value. +func (o *ModelLabRunParam) GetValue() string { + if o == nil { + var ret string + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunParam) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *ModelLabRunParam) SetValue(v string) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunParam) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunParam) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Key *string `json:"key"` + Value *string `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Key == nil { + return fmt.Errorf("required field key missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"key", "value"}) + } else { + return err + } + o.Key = *all.Key + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_response.go b/api/datadogV2/model_model_lab_run_response.go new file mode 100644 index 00000000000..7d3caa543f0 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunResponse Response containing a single Model Lab run. +type ModelLabRunResponse struct { + // A Model Lab run JSON:API resource object. + Data ModelLabRunData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunResponse instantiates a new ModelLabRunResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunResponse(data ModelLabRunData) *ModelLabRunResponse { + this := ModelLabRunResponse{} + this.Data = data + return &this +} + +// NewModelLabRunResponseWithDefaults instantiates a new ModelLabRunResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunResponseWithDefaults() *ModelLabRunResponse { + this := ModelLabRunResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabRunResponse) GetData() ModelLabRunData { + if o == nil { + var ret ModelLabRunData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunResponse) GetDataOk() (*ModelLabRunData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabRunResponse) SetData(v ModelLabRunData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ModelLabRunData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_run_status.go b/api/datadogV2/model_model_lab_run_status.go new file mode 100644 index 00000000000..6e6d6636e53 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_status.go @@ -0,0 +1,76 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunStatus The status of a Model Lab run. +type ModelLabRunStatus string + +// List of ModelLabRunStatus. +const ( + MODELLABRUNSTATUS_PENDING ModelLabRunStatus = "pending" + MODELLABRUNSTATUS_RUNNING ModelLabRunStatus = "running" + MODELLABRUNSTATUS_COMPLETED ModelLabRunStatus = "completed" + MODELLABRUNSTATUS_FAILED ModelLabRunStatus = "failed" + MODELLABRUNSTATUS_KILLED ModelLabRunStatus = "killed" + MODELLABRUNSTATUS_UNRESPONSIVE ModelLabRunStatus = "unresponsive" + MODELLABRUNSTATUS_PAUSED ModelLabRunStatus = "paused" +) + +var allowedModelLabRunStatusEnumValues = []ModelLabRunStatus{ + MODELLABRUNSTATUS_PENDING, + MODELLABRUNSTATUS_RUNNING, + MODELLABRUNSTATUS_COMPLETED, + MODELLABRUNSTATUS_FAILED, + MODELLABRUNSTATUS_KILLED, + MODELLABRUNSTATUS_UNRESPONSIVE, + MODELLABRUNSTATUS_PAUSED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabRunStatus) GetAllowedValues() []ModelLabRunStatus { + return allowedModelLabRunStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabRunStatus) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabRunStatus(value) + return nil +} + +// NewModelLabRunStatusFromValue returns a pointer to a valid ModelLabRunStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabRunStatusFromValue(v string) (*ModelLabRunStatus, error) { + ev := ModelLabRunStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabRunStatus: valid values are %v", v, allowedModelLabRunStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabRunStatus) IsValid() bool { + for _, existing := range allowedModelLabRunStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabRunStatus value. +func (v ModelLabRunStatus) Ptr() *ModelLabRunStatus { + return &v +} diff --git a/api/datadogV2/model_model_lab_run_type.go b/api/datadogV2/model_model_lab_run_type.go new file mode 100644 index 00000000000..15371ba5597 --- /dev/null +++ b/api/datadogV2/model_model_lab_run_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunType The JSON:API type for a Model Lab run resource. +type ModelLabRunType string + +// List of ModelLabRunType. +const ( + MODELLABRUNTYPE_RUNS ModelLabRunType = "runs" +) + +var allowedModelLabRunTypeEnumValues = []ModelLabRunType{ + MODELLABRUNTYPE_RUNS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ModelLabRunType) GetAllowedValues() []ModelLabRunType { + return allowedModelLabRunTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ModelLabRunType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ModelLabRunType(value) + return nil +} + +// NewModelLabRunTypeFromValue returns a pointer to a valid ModelLabRunType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewModelLabRunTypeFromValue(v string) (*ModelLabRunType, error) { + ev := ModelLabRunType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ModelLabRunType: valid values are %v", v, allowedModelLabRunTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ModelLabRunType) IsValid() bool { + for _, existing := range allowedModelLabRunTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelLabRunType value. +func (v ModelLabRunType) Ptr() *ModelLabRunType { + return &v +} diff --git a/api/datadogV2/model_model_lab_runs_response.go b/api/datadogV2/model_model_lab_runs_response.go new file mode 100644 index 00000000000..2e30d70d28a --- /dev/null +++ b/api/datadogV2/model_model_lab_runs_response.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabRunsResponse Response containing a list of Model Lab runs with pagination metadata. +type ModelLabRunsResponse struct { + // The list of runs. + Data []ModelLabRunData `json:"data"` + // Pagination links for navigating list responses. + Links *ModelLabPaginationLinks `json:"links,omitempty"` + // Pagination metadata for a list response. + Meta ModelLabPageMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabRunsResponse instantiates a new ModelLabRunsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabRunsResponse(data []ModelLabRunData, meta ModelLabPageMeta) *ModelLabRunsResponse { + this := ModelLabRunsResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewModelLabRunsResponseWithDefaults instantiates a new ModelLabRunsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabRunsResponseWithDefaults() *ModelLabRunsResponse { + this := ModelLabRunsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ModelLabRunsResponse) GetData() []ModelLabRunData { + if o == nil { + var ret []ModelLabRunData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunsResponse) GetDataOk() (*[]ModelLabRunData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ModelLabRunsResponse) SetData(v []ModelLabRunData) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ModelLabRunsResponse) GetLinks() ModelLabPaginationLinks { + if o == nil || o.Links == nil { + var ret ModelLabPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModelLabRunsResponse) GetLinksOk() (*ModelLabPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ModelLabRunsResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given ModelLabPaginationLinks and assigns it to the Links field. +func (o *ModelLabRunsResponse) SetLinks(v ModelLabPaginationLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value. +func (o *ModelLabRunsResponse) GetMeta() ModelLabPageMeta { + if o == nil { + var ret ModelLabPageMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *ModelLabRunsResponse) GetMetaOk() (*ModelLabPageMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *ModelLabRunsResponse) SetMeta(v ModelLabPageMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabRunsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabRunsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]ModelLabRunData `json:"data"` + Links *ModelLabPaginationLinks `json:"links,omitempty"` + Meta *ModelLabPageMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_model_lab_tag.go b/api/datadogV2/model_model_lab_tag.go new file mode 100644 index 00000000000..035628d9324 --- /dev/null +++ b/api/datadogV2/model_model_lab_tag.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ModelLabTag A key-value tag attached to a resource. +type ModelLabTag struct { + // The tag key. + Key string `json:"key"` + // The tag value. + Value string `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewModelLabTag instantiates a new ModelLabTag object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewModelLabTag(key string, value string) *ModelLabTag { + this := ModelLabTag{} + this.Key = key + this.Value = value + return &this +} + +// NewModelLabTagWithDefaults instantiates a new ModelLabTag object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewModelLabTagWithDefaults() *ModelLabTag { + this := ModelLabTag{} + return &this +} + +// GetKey returns the Key field value. +func (o *ModelLabTag) GetKey() string { + if o == nil { + var ret string + return ret + } + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ModelLabTag) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value. +func (o *ModelLabTag) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value. +func (o *ModelLabTag) GetValue() string { + if o == nil { + var ret string + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ModelLabTag) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *ModelLabTag) SetValue(v string) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ModelLabTag) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ModelLabTag) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Key *string `json:"key"` + Value *string `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Key == nil { + return fmt.Errorf("required field key missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"key", "value"}) + } else { + return err + } + o.Key = *all.Key + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_amazon_s3_generic_destination.go b/api/datadogV2/model_observability_pipeline_amazon_s3_generic_destination.go index 210a99934a5..059f30f458f 100644 --- a/api/datadogV2/model_observability_pipeline_amazon_s3_generic_destination.go +++ b/api/datadogV2/model_observability_pipeline_amazon_s3_generic_destination.go @@ -21,6 +21,8 @@ type ObservabilityPipelineAmazonS3GenericDestination struct { BatchSettings *ObservabilityPipelineAmazonS3GenericBatchSettings `json:"batch_settings,omitempty"` // S3 bucket name. Bucket string `json:"bucket"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Compression algorithm applied to encoded logs. Compression ObservabilityPipelineAmazonS3GenericCompression `json:"compression"` // Encoding format for the destination. @@ -148,6 +150,34 @@ func (o *ObservabilityPipelineAmazonS3GenericDestination) SetBucket(v string) { o.Bucket = v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineAmazonS3GenericDestination) GetBuffer() ObservabilityPipelineBufferOptions { + if o == nil || o.Buffer == nil { + var ret ObservabilityPipelineBufferOptions + return ret + } + return *o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineAmazonS3GenericDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) { + if o == nil || o.Buffer == nil { + return nil, false + } + return o.Buffer, true +} + +// HasBuffer returns a boolean if a field has been set. +func (o *ObservabilityPipelineAmazonS3GenericDestination) HasBuffer() bool { + return o != nil && o.Buffer != nil +} + +// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field. +func (o *ObservabilityPipelineAmazonS3GenericDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetCompression returns the Compression field value. func (o *ObservabilityPipelineAmazonS3GenericDestination) GetCompression() ObservabilityPipelineAmazonS3GenericCompression { if o == nil { @@ -350,6 +380,9 @@ func (o ObservabilityPipelineAmazonS3GenericDestination) MarshalJSON() ([]byte, toSerialize["batch_settings"] = o.BatchSettings } toSerialize["bucket"] = o.Bucket + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["compression"] = o.Compression toSerialize["encoding"] = o.Encoding toSerialize["id"] = o.Id @@ -373,6 +406,7 @@ func (o *ObservabilityPipelineAmazonS3GenericDestination) UnmarshalJSON(bytes [] Auth *ObservabilityPipelineAwsAuth `json:"auth,omitempty"` BatchSettings *ObservabilityPipelineAmazonS3GenericBatchSettings `json:"batch_settings,omitempty"` Bucket *string `json:"bucket"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Compression *ObservabilityPipelineAmazonS3GenericCompression `json:"compression"` Encoding *ObservabilityPipelineAmazonS3GenericEncoding `json:"encoding"` Id *string `json:"id"` @@ -411,7 +445,7 @@ func (o *ObservabilityPipelineAmazonS3GenericDestination) UnmarshalJSON(bytes [] } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "batch_settings", "bucket", "compression", "encoding", "id", "inputs", "key_prefix", "region", "storage_class", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "batch_settings", "bucket", "buffer", "compression", "encoding", "id", "inputs", "key_prefix", "region", "storage_class", "type"}) } else { return err } @@ -426,6 +460,7 @@ func (o *ObservabilityPipelineAmazonS3GenericDestination) UnmarshalJSON(bytes [] } o.BatchSettings = all.BatchSettings o.Bucket = *all.Bucket + o.Buffer = all.Buffer o.Compression = *all.Compression o.Encoding = *all.Encoding o.Id = *all.Id diff --git a/api/datadogV2/model_observability_pipeline_cloud_prem_destination.go b/api/datadogV2/model_observability_pipeline_cloud_prem_destination.go index 5b1d45570ca..8d01cb5227f 100644 --- a/api/datadogV2/model_observability_pipeline_cloud_prem_destination.go +++ b/api/datadogV2/model_observability_pipeline_cloud_prem_destination.go @@ -14,6 +14,8 @@ import ( // // **Supported pipeline types:** logs type ObservabilityPipelineCloudPremDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Name of the environment variable or secret that holds the CloudPrem endpoint URL. EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` // The unique identifier for this component. @@ -49,6 +51,34 @@ func NewObservabilityPipelineCloudPremDestinationWithDefaults() *ObservabilityPi return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineCloudPremDestination) GetBuffer() ObservabilityPipelineBufferOptions { + if o == nil || o.Buffer == nil { + var ret ObservabilityPipelineBufferOptions + return ret + } + return *o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineCloudPremDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) { + if o == nil || o.Buffer == nil { + return nil, false + } + return o.Buffer, true +} + +// HasBuffer returns a boolean if a field has been set. +func (o *ObservabilityPipelineCloudPremDestination) HasBuffer() bool { + return o != nil && o.Buffer != nil +} + +// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field. +func (o *ObservabilityPipelineCloudPremDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetEndpointUrlKey returns the EndpointUrlKey field value if set, zero value otherwise. func (o *ObservabilityPipelineCloudPremDestination) GetEndpointUrlKey() string { if o == nil || o.EndpointUrlKey == nil { @@ -152,6 +182,9 @@ func (o ObservabilityPipelineCloudPremDestination) MarshalJSON() ([]byte, error) if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.EndpointUrlKey != nil { toSerialize["endpoint_url_key"] = o.EndpointUrlKey } @@ -168,6 +201,7 @@ func (o ObservabilityPipelineCloudPremDestination) MarshalJSON() ([]byte, error) // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineCloudPremDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` @@ -187,12 +221,13 @@ func (o *ObservabilityPipelineCloudPremDestination) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"endpoint_url_key", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "endpoint_url_key", "id", "inputs", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.EndpointUrlKey = all.EndpointUrlKey o.Id = *all.Id o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go index 0fda24e4bd9..df0cbbb298d 100644 --- a/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go +++ b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go @@ -20,16 +20,16 @@ type ObservabilityPipelineDatabricksZerobusDestination struct { Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` - // Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse. - IngestionEndpoint string `json:"ingestion_endpoint"` + // Name of the environment variable or the secret identifier that references the Databricks Zerobus ingestion endpoint, which is used to stream data directly into your Databricks Lakehouse. + IngestionEndpointKey *string `json:"ingestion_endpoint_key,omitempty"` // A list of component IDs whose output is used as the `input` for this component. Inputs []string `json:"inputs"` // The fully qualified name of your target Databricks table. Make sure this table already exists in your Databricks workspace before deploying. TableName string `json:"table_name"` // The destination type. The value must be `databricks_zerobus`. Type ObservabilityPipelineDatabricksZerobusDestinationType `json:"type"` - // Your Databricks workspace URL. This is used to communicate with the Unity Catalog API. - UnityCatalogEndpoint string `json:"unity_catalog_endpoint"` + // Name of the environment variable or the secret identifier that references your Databricks workspace URL, which is used to communicate with the Unity Catalog API. + UnityCatalogEndpointKey *string `json:"unity_catalog_endpoint_key,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -39,15 +39,13 @@ type ObservabilityPipelineDatabricksZerobusDestination struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewObservabilityPipelineDatabricksZerobusDestination(auth ObservabilityPipelineDatabricksZerobusDestinationAuth, id string, ingestionEndpoint string, inputs []string, tableName string, typeVar ObservabilityPipelineDatabricksZerobusDestinationType, unityCatalogEndpoint string) *ObservabilityPipelineDatabricksZerobusDestination { +func NewObservabilityPipelineDatabricksZerobusDestination(auth ObservabilityPipelineDatabricksZerobusDestinationAuth, id string, inputs []string, tableName string, typeVar ObservabilityPipelineDatabricksZerobusDestinationType) *ObservabilityPipelineDatabricksZerobusDestination { this := ObservabilityPipelineDatabricksZerobusDestination{} this.Auth = auth this.Id = id - this.IngestionEndpoint = ingestionEndpoint this.Inputs = inputs this.TableName = tableName this.Type = typeVar - this.UnityCatalogEndpoint = unityCatalogEndpoint return &this } @@ -135,27 +133,32 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) SetId(v string) { o.Id = v } -// GetIngestionEndpoint returns the IngestionEndpoint field value. -func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpoint() string { - if o == nil { +// GetIngestionEndpointKey returns the IngestionEndpointKey field value if set, zero value otherwise. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpointKey() string { + if o == nil || o.IngestionEndpointKey == nil { var ret string return ret } - return o.IngestionEndpoint + return *o.IngestionEndpointKey } -// GetIngestionEndpointOk returns a tuple with the IngestionEndpoint field value +// GetIngestionEndpointKeyOk returns a tuple with the IngestionEndpointKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpointOk() (*string, bool) { - if o == nil { +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpointKeyOk() (*string, bool) { + if o == nil || o.IngestionEndpointKey == nil { return nil, false } - return &o.IngestionEndpoint, true + return o.IngestionEndpointKey, true +} + +// HasIngestionEndpointKey returns a boolean if a field has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) HasIngestionEndpointKey() bool { + return o != nil && o.IngestionEndpointKey != nil } -// SetIngestionEndpoint sets field value. -func (o *ObservabilityPipelineDatabricksZerobusDestination) SetIngestionEndpoint(v string) { - o.IngestionEndpoint = v +// SetIngestionEndpointKey gets a reference to the given string and assigns it to the IngestionEndpointKey field. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetIngestionEndpointKey(v string) { + o.IngestionEndpointKey = &v } // GetInputs returns the Inputs field value. @@ -227,27 +230,32 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) SetType(v Observabil o.Type = v } -// GetUnityCatalogEndpoint returns the UnityCatalogEndpoint field value. -func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpoint() string { - if o == nil { +// GetUnityCatalogEndpointKey returns the UnityCatalogEndpointKey field value if set, zero value otherwise. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpointKey() string { + if o == nil || o.UnityCatalogEndpointKey == nil { var ret string return ret } - return o.UnityCatalogEndpoint + return *o.UnityCatalogEndpointKey } -// GetUnityCatalogEndpointOk returns a tuple with the UnityCatalogEndpoint field value +// GetUnityCatalogEndpointKeyOk returns a tuple with the UnityCatalogEndpointKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpointOk() (*string, bool) { - if o == nil { +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpointKeyOk() (*string, bool) { + if o == nil || o.UnityCatalogEndpointKey == nil { return nil, false } - return &o.UnityCatalogEndpoint, true + return o.UnityCatalogEndpointKey, true } -// SetUnityCatalogEndpoint sets field value. -func (o *ObservabilityPipelineDatabricksZerobusDestination) SetUnityCatalogEndpoint(v string) { - o.UnityCatalogEndpoint = v +// HasUnityCatalogEndpointKey returns a boolean if a field has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) HasUnityCatalogEndpointKey() bool { + return o != nil && o.UnityCatalogEndpointKey != nil +} + +// SetUnityCatalogEndpointKey gets a reference to the given string and assigns it to the UnityCatalogEndpointKey field. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetUnityCatalogEndpointKey(v string) { + o.UnityCatalogEndpointKey = &v } // MarshalJSON serializes the struct using spec logic. @@ -261,11 +269,15 @@ func (o ObservabilityPipelineDatabricksZerobusDestination) MarshalJSON() ([]byte toSerialize["buffer"] = o.Buffer } toSerialize["id"] = o.Id - toSerialize["ingestion_endpoint"] = o.IngestionEndpoint + if o.IngestionEndpointKey != nil { + toSerialize["ingestion_endpoint_key"] = o.IngestionEndpointKey + } toSerialize["inputs"] = o.Inputs toSerialize["table_name"] = o.TableName toSerialize["type"] = o.Type - toSerialize["unity_catalog_endpoint"] = o.UnityCatalogEndpoint + if o.UnityCatalogEndpointKey != nil { + toSerialize["unity_catalog_endpoint_key"] = o.UnityCatalogEndpointKey + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -276,14 +288,14 @@ func (o ObservabilityPipelineDatabricksZerobusDestination) MarshalJSON() ([]byte // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Auth *ObservabilityPipelineDatabricksZerobusDestinationAuth `json:"auth"` - Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` - Id *string `json:"id"` - IngestionEndpoint *string `json:"ingestion_endpoint"` - Inputs *[]string `json:"inputs"` - TableName *string `json:"table_name"` - Type *ObservabilityPipelineDatabricksZerobusDestinationType `json:"type"` - UnityCatalogEndpoint *string `json:"unity_catalog_endpoint"` + Auth *ObservabilityPipelineDatabricksZerobusDestinationAuth `json:"auth"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + Id *string `json:"id"` + IngestionEndpointKey *string `json:"ingestion_endpoint_key,omitempty"` + Inputs *[]string `json:"inputs"` + TableName *string `json:"table_name"` + Type *ObservabilityPipelineDatabricksZerobusDestinationType `json:"type"` + UnityCatalogEndpointKey *string `json:"unity_catalog_endpoint_key,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -294,9 +306,6 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes if all.Id == nil { return fmt.Errorf("required field id missing") } - if all.IngestionEndpoint == nil { - return fmt.Errorf("required field ingestion_endpoint missing") - } if all.Inputs == nil { return fmt.Errorf("required field inputs missing") } @@ -306,12 +315,9 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes if all.Type == nil { return fmt.Errorf("required field type missing") } - if all.UnityCatalogEndpoint == nil { - return fmt.Errorf("required field unity_catalog_endpoint missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "buffer", "id", "ingestion_endpoint", "inputs", "table_name", "type", "unity_catalog_endpoint"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "buffer", "id", "ingestion_endpoint_key", "inputs", "table_name", "type", "unity_catalog_endpoint_key"}) } else { return err } @@ -323,7 +329,7 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes o.Auth = *all.Auth o.Buffer = all.Buffer o.Id = *all.Id - o.IngestionEndpoint = *all.IngestionEndpoint + o.IngestionEndpointKey = all.IngestionEndpointKey o.Inputs = *all.Inputs o.TableName = *all.TableName if !all.Type.IsValid() { @@ -331,7 +337,7 @@ func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes } else { o.Type = *all.Type } - o.UnityCatalogEndpoint = *all.UnityCatalogEndpoint + o.UnityCatalogEndpointKey = all.UnityCatalogEndpointKey if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_observability_pipeline_fluent_bit_source.go b/api/datadogV2/model_observability_pipeline_fluent_bit_source.go index 3cd680da7d2..0c05277d759 100644 --- a/api/datadogV2/model_observability_pipeline_fluent_bit_source.go +++ b/api/datadogV2/model_observability_pipeline_fluent_bit_source.go @@ -18,8 +18,8 @@ type ObservabilityPipelineFluentBitSource struct { AddressKey *string `json:"address_key,omitempty"` // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). Id string `json:"id"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `fluent_bit`. Type ObservabilityPipelineFluentBitSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -100,9 +100,9 @@ func (o *ObservabilityPipelineFluentBitSource) SetId(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineFluentBitSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineFluentBitSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -110,7 +110,7 @@ func (o *ObservabilityPipelineFluentBitSource) GetTls() ObservabilityPipelineTls // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineFluentBitSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineFluentBitSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -122,8 +122,8 @@ func (o *ObservabilityPipelineFluentBitSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineFluentBitSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineFluentBitSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -176,7 +176,7 @@ func (o *ObservabilityPipelineFluentBitSource) UnmarshalJSON(bytes []byte) (err all := struct { AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineFluentBitSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_fluentd_source.go b/api/datadogV2/model_observability_pipeline_fluentd_source.go index bf17156ca7c..125cf5fced2 100644 --- a/api/datadogV2/model_observability_pipeline_fluentd_source.go +++ b/api/datadogV2/model_observability_pipeline_fluentd_source.go @@ -18,8 +18,8 @@ type ObservabilityPipelineFluentdSource struct { AddressKey *string `json:"address_key,omitempty"` // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). Id string `json:"id"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `fluentd. Type ObservabilityPipelineFluentdSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -100,9 +100,9 @@ func (o *ObservabilityPipelineFluentdSource) SetId(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineFluentdSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineFluentdSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -110,7 +110,7 @@ func (o *ObservabilityPipelineFluentdSource) GetTls() ObservabilityPipelineTls { // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineFluentdSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineFluentdSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -122,8 +122,8 @@ func (o *ObservabilityPipelineFluentdSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineFluentdSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineFluentdSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -176,7 +176,7 @@ func (o *ObservabilityPipelineFluentdSource) UnmarshalJSON(bytes []byte) (err er all := struct { AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineFluentdSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_http_client_destination.go b/api/datadogV2/model_observability_pipeline_http_client_destination.go index 87ecd9c1d1f..94e105fcb3d 100644 --- a/api/datadogV2/model_observability_pipeline_http_client_destination.go +++ b/api/datadogV2/model_observability_pipeline_http_client_destination.go @@ -16,6 +16,8 @@ import ( type ObservabilityPipelineHttpClientDestination struct { // HTTP authentication strategy. AuthStrategy *ObservabilityPipelineHttpClientDestinationAuthStrategy `json:"auth_strategy,omitempty"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Compression configuration for HTTP requests. Compression *ObservabilityPipelineHttpClientDestinationCompression `json:"compression,omitempty"` // Name of the environment variable or secret that holds a custom header value (used with custom auth strategies). @@ -94,6 +96,34 @@ func (o *ObservabilityPipelineHttpClientDestination) SetAuthStrategy(v Observabi o.AuthStrategy = &v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineHttpClientDestination) GetBuffer() ObservabilityPipelineBufferOptions { + if o == nil || o.Buffer == nil { + var ret ObservabilityPipelineBufferOptions + return ret + } + return *o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpClientDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) { + if o == nil || o.Buffer == nil { + return nil, false + } + return o.Buffer, true +} + +// HasBuffer returns a boolean if a field has been set. +func (o *ObservabilityPipelineHttpClientDestination) HasBuffer() bool { + return o != nil && o.Buffer != nil +} + +// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field. +func (o *ObservabilityPipelineHttpClientDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetCompression returns the Compression field value if set, zero value otherwise. func (o *ObservabilityPipelineHttpClientDestination) GetCompression() ObservabilityPipelineHttpClientDestinationCompression { if o == nil || o.Compression == nil { @@ -391,6 +421,9 @@ func (o ObservabilityPipelineHttpClientDestination) MarshalJSON() ([]byte, error if o.AuthStrategy != nil { toSerialize["auth_strategy"] = o.AuthStrategy } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.Compression != nil { toSerialize["compression"] = o.Compression } @@ -427,6 +460,7 @@ func (o ObservabilityPipelineHttpClientDestination) MarshalJSON() ([]byte, error func (o *ObservabilityPipelineHttpClientDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { AuthStrategy *ObservabilityPipelineHttpClientDestinationAuthStrategy `json:"auth_strategy,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Compression *ObservabilityPipelineHttpClientDestinationCompression `json:"compression,omitempty"` CustomKey *string `json:"custom_key,omitempty"` Encoding *ObservabilityPipelineHttpClientDestinationEncoding `json:"encoding"` @@ -456,7 +490,7 @@ func (o *ObservabilityPipelineHttpClientDestination) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth_strategy", "compression", "custom_key", "encoding", "id", "inputs", "password_key", "tls", "token_key", "type", "uri_key", "username_key"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth_strategy", "buffer", "compression", "custom_key", "encoding", "id", "inputs", "password_key", "tls", "token_key", "type", "uri_key", "username_key"}) } else { return err } @@ -467,6 +501,7 @@ func (o *ObservabilityPipelineHttpClientDestination) UnmarshalJSON(bytes []byte) } else { o.AuthStrategy = all.AuthStrategy } + o.Buffer = all.Buffer if all.Compression != nil && all.Compression.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } diff --git a/api/datadogV2/model_observability_pipeline_http_server_source.go b/api/datadogV2/model_observability_pipeline_http_server_source.go index c04b538abfc..127d7174581 100644 --- a/api/datadogV2/model_observability_pipeline_http_server_source.go +++ b/api/datadogV2/model_observability_pipeline_http_server_source.go @@ -26,12 +26,16 @@ type ObservabilityPipelineHttpServerSource struct { Id string `json:"id"` // Name of the environment variable or secret that holds the password (used when `auth_strategy` is `plain`). PasswordKey *string `json:"password_key,omitempty"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `http_server`. Type ObservabilityPipelineHttpServerSourceType `json:"type"` // Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`). UsernameKey *string `json:"username_key,omitempty"` + // A list of tokens that are accepted for authenticating incoming HTTP requests. When set, + // the source rejects any request whose token does not match an enabled entry in this list. + // Cannot be combined with the `plain` auth strategy. + ValidTokens []ObservabilityPipelineHttpServerSourceValidToken `json:"valid_tokens,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -214,9 +218,9 @@ func (o *ObservabilityPipelineHttpServerSource) SetPasswordKey(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineHttpServerSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineHttpServerSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -224,7 +228,7 @@ func (o *ObservabilityPipelineHttpServerSource) GetTls() ObservabilityPipelineTl // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineHttpServerSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineHttpServerSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -236,8 +240,8 @@ func (o *ObservabilityPipelineHttpServerSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineHttpServerSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineHttpServerSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -292,6 +296,34 @@ func (o *ObservabilityPipelineHttpServerSource) SetUsernameKey(v string) { o.UsernameKey = &v } +// GetValidTokens returns the ValidTokens field value if set, zero value otherwise. +func (o *ObservabilityPipelineHttpServerSource) GetValidTokens() []ObservabilityPipelineHttpServerSourceValidToken { + if o == nil || o.ValidTokens == nil { + var ret []ObservabilityPipelineHttpServerSourceValidToken + return ret + } + return o.ValidTokens +} + +// GetValidTokensOk returns a tuple with the ValidTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSource) GetValidTokensOk() (*[]ObservabilityPipelineHttpServerSourceValidToken, bool) { + if o == nil || o.ValidTokens == nil { + return nil, false + } + return &o.ValidTokens, true +} + +// HasValidTokens returns a boolean if a field has been set. +func (o *ObservabilityPipelineHttpServerSource) HasValidTokens() bool { + return o != nil && o.ValidTokens != nil +} + +// SetValidTokens gets a reference to the given []ObservabilityPipelineHttpServerSourceValidToken and assigns it to the ValidTokens field. +func (o *ObservabilityPipelineHttpServerSource) SetValidTokens(v []ObservabilityPipelineHttpServerSourceValidToken) { + o.ValidTokens = v +} + // MarshalJSON serializes the struct using spec logic. func (o ObservabilityPipelineHttpServerSource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -317,6 +349,9 @@ func (o ObservabilityPipelineHttpServerSource) MarshalJSON() ([]byte, error) { if o.UsernameKey != nil { toSerialize["username_key"] = o.UsernameKey } + if o.ValidTokens != nil { + toSerialize["valid_tokens"] = o.ValidTokens + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -333,9 +368,10 @@ func (o *ObservabilityPipelineHttpServerSource) UnmarshalJSON(bytes []byte) (err Decoding *ObservabilityPipelineDecoding `json:"decoding"` Id *string `json:"id"` PasswordKey *string `json:"password_key,omitempty"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineHttpServerSourceType `json:"type"` UsernameKey *string `json:"username_key,omitempty"` + ValidTokens []ObservabilityPipelineHttpServerSourceValidToken `json:"valid_tokens,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -354,7 +390,7 @@ func (o *ObservabilityPipelineHttpServerSource) UnmarshalJSON(bytes []byte) (err } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"address_key", "auth_strategy", "custom_key", "decoding", "id", "password_key", "tls", "type", "username_key"}) + datadog.DeleteKeys(additionalProperties, &[]string{"address_key", "auth_strategy", "custom_key", "decoding", "id", "password_key", "tls", "type", "username_key", "valid_tokens"}) } else { return err } @@ -384,6 +420,7 @@ func (o *ObservabilityPipelineHttpServerSource) UnmarshalJSON(bytes []byte) (err o.Type = *all.Type } o.UsernameKey = all.UsernameKey + o.ValidTokens = all.ValidTokens if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_observability_pipeline_http_server_source_valid_token.go b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token.go new file mode 100644 index 00000000000..95daaae4b6b --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token.go @@ -0,0 +1,222 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineHttpServerSourceValidToken An accepted token used to authenticate incoming HTTP server requests. +type ObservabilityPipelineHttpServerSourceValidToken struct { + // Indicates whether this token is currently accepted. Disabled tokens are rejected without + // being removed from the configuration. + Enabled *bool `json:"enabled,omitempty"` + // An optional metadata field that is attached to every event authenticated by the + // associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`. + FieldToAdd *ObservabilityPipelineSourceValidTokenFieldToAdd `json:"field_to_add,omitempty"` + // Specifies where the worker extracts the token from in the incoming HTTP request. + // This can be either a built-in location (`path` or `address`) or an HTTP header object. + PathToToken *ObservabilityPipelineHttpServerSourceValidTokenPathToToken `json:"path_to_token,omitempty"` + // Name of the environment variable or secret that holds the expected token value. + TokenKey string `json:"token_key"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineHttpServerSourceValidToken instantiates a new ObservabilityPipelineHttpServerSourceValidToken object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineHttpServerSourceValidToken(tokenKey string) *ObservabilityPipelineHttpServerSourceValidToken { + this := ObservabilityPipelineHttpServerSourceValidToken{} + var enabled bool = true + this.Enabled = &enabled + this.TokenKey = tokenKey + return &this +} + +// NewObservabilityPipelineHttpServerSourceValidTokenWithDefaults instantiates a new ObservabilityPipelineHttpServerSourceValidToken object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineHttpServerSourceValidTokenWithDefaults() *ObservabilityPipelineHttpServerSourceValidToken { + this := ObservabilityPipelineHttpServerSourceValidToken{} + var enabled bool = true + this.Enabled = &enabled + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) HasEnabled() bool { + return o != nil && o.Enabled != nil +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *ObservabilityPipelineHttpServerSourceValidToken) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetFieldToAdd returns the FieldToAdd field value if set, zero value otherwise. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetFieldToAdd() ObservabilityPipelineSourceValidTokenFieldToAdd { + if o == nil || o.FieldToAdd == nil { + var ret ObservabilityPipelineSourceValidTokenFieldToAdd + return ret + } + return *o.FieldToAdd +} + +// GetFieldToAddOk returns a tuple with the FieldToAdd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetFieldToAddOk() (*ObservabilityPipelineSourceValidTokenFieldToAdd, bool) { + if o == nil || o.FieldToAdd == nil { + return nil, false + } + return o.FieldToAdd, true +} + +// HasFieldToAdd returns a boolean if a field has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) HasFieldToAdd() bool { + return o != nil && o.FieldToAdd != nil +} + +// SetFieldToAdd gets a reference to the given ObservabilityPipelineSourceValidTokenFieldToAdd and assigns it to the FieldToAdd field. +func (o *ObservabilityPipelineHttpServerSourceValidToken) SetFieldToAdd(v ObservabilityPipelineSourceValidTokenFieldToAdd) { + o.FieldToAdd = &v +} + +// GetPathToToken returns the PathToToken field value if set, zero value otherwise. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetPathToToken() ObservabilityPipelineHttpServerSourceValidTokenPathToToken { + if o == nil || o.PathToToken == nil { + var ret ObservabilityPipelineHttpServerSourceValidTokenPathToToken + return ret + } + return *o.PathToToken +} + +// GetPathToTokenOk returns a tuple with the PathToToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetPathToTokenOk() (*ObservabilityPipelineHttpServerSourceValidTokenPathToToken, bool) { + if o == nil || o.PathToToken == nil { + return nil, false + } + return o.PathToToken, true +} + +// HasPathToToken returns a boolean if a field has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) HasPathToToken() bool { + return o != nil && o.PathToToken != nil +} + +// SetPathToToken gets a reference to the given ObservabilityPipelineHttpServerSourceValidTokenPathToToken and assigns it to the PathToToken field. +func (o *ObservabilityPipelineHttpServerSourceValidToken) SetPathToToken(v ObservabilityPipelineHttpServerSourceValidTokenPathToToken) { + o.PathToToken = &v +} + +// GetTokenKey returns the TokenKey field value. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetTokenKey() string { + if o == nil { + var ret string + return ret + } + return o.TokenKey +} + +// GetTokenKeyOk returns a tuple with the TokenKey field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSourceValidToken) GetTokenKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenKey, true +} + +// SetTokenKey sets field value. +func (o *ObservabilityPipelineHttpServerSourceValidToken) SetTokenKey(v string) { + o.TokenKey = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineHttpServerSourceValidToken) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + if o.FieldToAdd != nil { + toSerialize["field_to_add"] = o.FieldToAdd + } + if o.PathToToken != nil { + toSerialize["path_to_token"] = o.PathToToken + } + toSerialize["token_key"] = o.TokenKey + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineHttpServerSourceValidToken) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Enabled *bool `json:"enabled,omitempty"` + FieldToAdd *ObservabilityPipelineSourceValidTokenFieldToAdd `json:"field_to_add,omitempty"` + PathToToken *ObservabilityPipelineHttpServerSourceValidTokenPathToToken `json:"path_to_token,omitempty"` + TokenKey *string `json:"token_key"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.TokenKey == nil { + return fmt.Errorf("required field token_key missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"enabled", "field_to_add", "path_to_token", "token_key"}) + } else { + return err + } + + hasInvalidField := false + o.Enabled = all.Enabled + if all.FieldToAdd != nil && all.FieldToAdd.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.FieldToAdd = all.FieldToAdd + o.PathToToken = all.PathToToken + o.TokenKey = *all.TokenKey + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token.go b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token.go new file mode 100644 index 00000000000..17f026b6b97 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token.go @@ -0,0 +1,106 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineHttpServerSourceValidTokenPathToToken - Specifies where the worker extracts the token from in the incoming HTTP request. +// This can be either a built-in location (`path` or `address`) or an HTTP header object. +type ObservabilityPipelineHttpServerSourceValidTokenPathToToken struct { + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationAsObservabilityPipelineHttpServerSourceValidTokenPathToToken is a convenience function that returns ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation wrapped in ObservabilityPipelineHttpServerSourceValidTokenPathToToken. +func ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationAsObservabilityPipelineHttpServerSourceValidTokenPathToToken(v *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) ObservabilityPipelineHttpServerSourceValidTokenPathToToken { + return ObservabilityPipelineHttpServerSourceValidTokenPathToToken{ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation: v} +} + +// ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeaderAsObservabilityPipelineHttpServerSourceValidTokenPathToToken is a convenience function that returns ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader wrapped in ObservabilityPipelineHttpServerSourceValidTokenPathToToken. +func ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeaderAsObservabilityPipelineHttpServerSourceValidTokenPathToToken(v *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) ObservabilityPipelineHttpServerSourceValidTokenPathToToken { + return ObservabilityPipelineHttpServerSourceValidTokenPathToToken{ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ObservabilityPipelineHttpServerSourceValidTokenPathToToken) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) + if err == nil { + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation != nil { + jsonObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation, _ := datadog.Marshal(obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) + if string(jsonObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) == "{}" && string(data) != "{}" { // empty struct + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = nil + } + } else { + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = nil + } + + // try to unmarshal data into ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) + if err == nil { + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader != nil && obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader.UnparsedObject == nil { + jsonObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader, _ := datadog.Marshal(obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) + if string(jsonObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) == "{}" { // empty struct + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader = nil + } + } else { + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = nil + obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ObservabilityPipelineHttpServerSourceValidTokenPathToToken) MarshalJSON() ([]byte, error) { + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation != nil { + return datadog.Marshal(&obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) + } + + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader != nil { + return datadog.Marshal(&obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ObservabilityPipelineHttpServerSourceValidTokenPathToToken) GetActualInstance() interface{} { + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation != nil { + return obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation + } + + if obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader != nil { + return obj.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_header.go b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_header.go new file mode 100644 index 00000000000..1b4d16f741d --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_header.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader Extract the token from a specific HTTP request header. +type ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader struct { + // The name of the HTTP header that carries the token. + Header string `json:"header"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader instantiates a new ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader(header string) *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader { + this := ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader{} + this.Header = header + return &this +} + +// NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeaderWithDefaults instantiates a new ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeaderWithDefaults() *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader { + this := ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader{} + return &this +} + +// GetHeader returns the Header field value. +func (o *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) GetHeader() string { + if o == nil { + var ret string + return ret + } + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) GetHeaderOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Header, true +} + +// SetHeader sets field value. +func (o *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) SetHeader(v string) { + o.Header = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["header"] = o.Header + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Header *string `json:"header"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Header == nil { + return fmt.Errorf("required field header missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"header"}) + } else { + return err + } + o.Header = *all.Header + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_location.go b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_location.go new file mode 100644 index 00000000000..bebabb23c77 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_http_server_source_valid_token_path_to_token_location.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation Built-in token location on the incoming HTTP request. +type ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation string + +// List of ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation. +const ( + OBSERVABILITYPIPELINEHTTPSERVERSOURCEVALIDTOKENPATHTOTOKENLOCATION_PATH ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = "path" + OBSERVABILITYPIPELINEHTTPSERVERSOURCEVALIDTOKENPATHTOTOKENLOCATION_ADDRESS ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation = "address" +) + +var allowedObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationEnumValues = []ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation{ + OBSERVABILITYPIPELINEHTTPSERVERSOURCEVALIDTOKENPATHTOTOKENLOCATION_PATH, + OBSERVABILITYPIPELINEHTTPSERVERSOURCEVALIDTOKENPATHTOTOKENLOCATION_ADDRESS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) GetAllowedValues() []ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation { + return allowedObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation(value) + return nil +} + +// NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationFromValue returns a pointer to a valid ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationFromValue(v string) (*ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation, error) { + ev := ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation: valid values are %v", v, allowedObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) IsValid() bool { + for _, existing := range allowedObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation value. +func (v ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation) Ptr() *ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_kafka_destination.go b/api/datadogV2/model_observability_pipeline_kafka_destination.go index b559bdef914..c2015fc7ab7 100644 --- a/api/datadogV2/model_observability_pipeline_kafka_destination.go +++ b/api/datadogV2/model_observability_pipeline_kafka_destination.go @@ -16,6 +16,8 @@ import ( type ObservabilityPipelineKafkaDestination struct { // Name of the environment variable or secret that holds the Kafka bootstrap servers list. BootstrapServersKey *string `json:"bootstrap_servers_key,omitempty"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Compression codec for Kafka messages. Compression *ObservabilityPipelineKafkaDestinationCompression `json:"compression,omitempty"` // Encoding format for log events. @@ -103,6 +105,34 @@ func (o *ObservabilityPipelineKafkaDestination) SetBootstrapServersKey(v string) o.BootstrapServersKey = &v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineKafkaDestination) GetBuffer() ObservabilityPipelineBufferOptions { + if o == nil || o.Buffer == nil { + var ret ObservabilityPipelineBufferOptions + return ret + } + return *o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineKafkaDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) { + if o == nil || o.Buffer == nil { + return nil, false + } + return o.Buffer, true +} + +// HasBuffer returns a boolean if a field has been set. +func (o *ObservabilityPipelineKafkaDestination) HasBuffer() bool { + return o != nil && o.Buffer != nil +} + +// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field. +func (o *ObservabilityPipelineKafkaDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetCompression returns the Compression field value if set, zero value otherwise. func (o *ObservabilityPipelineKafkaDestination) GetCompression() ObservabilityPipelineKafkaDestinationCompression { if o == nil || o.Compression == nil { @@ -507,6 +537,9 @@ func (o ObservabilityPipelineKafkaDestination) MarshalJSON() ([]byte, error) { if o.BootstrapServersKey != nil { toSerialize["bootstrap_servers_key"] = o.BootstrapServersKey } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.Compression != nil { toSerialize["compression"] = o.Compression } @@ -553,6 +586,7 @@ func (o ObservabilityPipelineKafkaDestination) MarshalJSON() ([]byte, error) { func (o *ObservabilityPipelineKafkaDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { BootstrapServersKey *string `json:"bootstrap_servers_key,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Compression *ObservabilityPipelineKafkaDestinationCompression `json:"compression,omitempty"` Encoding *ObservabilityPipelineKafkaDestinationEncoding `json:"encoding"` HeadersKey *string `json:"headers_key,omitempty"` @@ -589,13 +623,14 @@ func (o *ObservabilityPipelineKafkaDestination) UnmarshalJSON(bytes []byte) (err } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"bootstrap_servers_key", "compression", "encoding", "headers_key", "id", "inputs", "key_field", "librdkafka_options", "message_timeout_ms", "rate_limit_duration_secs", "rate_limit_num", "sasl", "socket_timeout_ms", "tls", "topic", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"bootstrap_servers_key", "buffer", "compression", "encoding", "headers_key", "id", "inputs", "key_field", "librdkafka_options", "message_timeout_ms", "rate_limit_duration_secs", "rate_limit_num", "sasl", "socket_timeout_ms", "tls", "topic", "type"}) } else { return err } hasInvalidField := false o.BootstrapServersKey = all.BootstrapServersKey + o.Buffer = all.Buffer if all.Compression != nil && !all.Compression.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_observability_pipeline_logstash_source.go b/api/datadogV2/model_observability_pipeline_logstash_source.go index 7f3fde9ddcf..ec53e5b45ea 100644 --- a/api/datadogV2/model_observability_pipeline_logstash_source.go +++ b/api/datadogV2/model_observability_pipeline_logstash_source.go @@ -18,8 +18,8 @@ type ObservabilityPipelineLogstashSource struct { AddressKey *string `json:"address_key,omitempty"` // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). Id string `json:"id"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `logstash`. Type ObservabilityPipelineLogstashSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -100,9 +100,9 @@ func (o *ObservabilityPipelineLogstashSource) SetId(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineLogstashSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineLogstashSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -110,7 +110,7 @@ func (o *ObservabilityPipelineLogstashSource) GetTls() ObservabilityPipelineTls // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineLogstashSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineLogstashSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -122,8 +122,8 @@ func (o *ObservabilityPipelineLogstashSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineLogstashSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineLogstashSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -176,7 +176,7 @@ func (o *ObservabilityPipelineLogstashSource) UnmarshalJSON(bytes []byte) (err e all := struct { AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineLogstashSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_mtls_server_tls.go b/api/datadogV2/model_observability_pipeline_mtls_server_tls.go new file mode 100644 index 00000000000..f0d1eba09e8 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_mtls_server_tls.go @@ -0,0 +1,241 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineMtlsServerTls Configuration for enabling TLS encryption between the pipeline component and external connecting clients. +type ObservabilityPipelineMtlsServerTls struct { + // Path to the Certificate Authority (CA) file used to validate connecting clients' TLS certificates. + CaFile *string `json:"ca_file,omitempty"` + // Path to the TLS server certificate file used to used to identify the pipeline component to connecting clients. + CrtFile string `json:"crt_file"` + // Path to the private key file associated with the TLS server certificate. + KeyFile *string `json:"key_file,omitempty"` + // Name of the environment variable or secret that holds the passphrase for the private key file. + KeyPassKey *string `json:"key_pass_key,omitempty"` + // When `true`, requires client connections to present a valid certificate, enabling mutual TLS authentication. + VerifyCertificate *bool `json:"verify_certificate,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineMtlsServerTls instantiates a new ObservabilityPipelineMtlsServerTls object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineMtlsServerTls(crtFile string) *ObservabilityPipelineMtlsServerTls { + this := ObservabilityPipelineMtlsServerTls{} + this.CrtFile = crtFile + return &this +} + +// NewObservabilityPipelineMtlsServerTlsWithDefaults instantiates a new ObservabilityPipelineMtlsServerTls object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineMtlsServerTlsWithDefaults() *ObservabilityPipelineMtlsServerTls { + this := ObservabilityPipelineMtlsServerTls{} + return &this +} + +// GetCaFile returns the CaFile field value if set, zero value otherwise. +func (o *ObservabilityPipelineMtlsServerTls) GetCaFile() string { + if o == nil || o.CaFile == nil { + var ret string + return ret + } + return *o.CaFile +} + +// GetCaFileOk returns a tuple with the CaFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMtlsServerTls) GetCaFileOk() (*string, bool) { + if o == nil || o.CaFile == nil { + return nil, false + } + return o.CaFile, true +} + +// HasCaFile returns a boolean if a field has been set. +func (o *ObservabilityPipelineMtlsServerTls) HasCaFile() bool { + return o != nil && o.CaFile != nil +} + +// SetCaFile gets a reference to the given string and assigns it to the CaFile field. +func (o *ObservabilityPipelineMtlsServerTls) SetCaFile(v string) { + o.CaFile = &v +} + +// GetCrtFile returns the CrtFile field value. +func (o *ObservabilityPipelineMtlsServerTls) GetCrtFile() string { + if o == nil { + var ret string + return ret + } + return o.CrtFile +} + +// GetCrtFileOk returns a tuple with the CrtFile field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMtlsServerTls) GetCrtFileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CrtFile, true +} + +// SetCrtFile sets field value. +func (o *ObservabilityPipelineMtlsServerTls) SetCrtFile(v string) { + o.CrtFile = v +} + +// GetKeyFile returns the KeyFile field value if set, zero value otherwise. +func (o *ObservabilityPipelineMtlsServerTls) GetKeyFile() string { + if o == nil || o.KeyFile == nil { + var ret string + return ret + } + return *o.KeyFile +} + +// GetKeyFileOk returns a tuple with the KeyFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMtlsServerTls) GetKeyFileOk() (*string, bool) { + if o == nil || o.KeyFile == nil { + return nil, false + } + return o.KeyFile, true +} + +// HasKeyFile returns a boolean if a field has been set. +func (o *ObservabilityPipelineMtlsServerTls) HasKeyFile() bool { + return o != nil && o.KeyFile != nil +} + +// SetKeyFile gets a reference to the given string and assigns it to the KeyFile field. +func (o *ObservabilityPipelineMtlsServerTls) SetKeyFile(v string) { + o.KeyFile = &v +} + +// GetKeyPassKey returns the KeyPassKey field value if set, zero value otherwise. +func (o *ObservabilityPipelineMtlsServerTls) GetKeyPassKey() string { + if o == nil || o.KeyPassKey == nil { + var ret string + return ret + } + return *o.KeyPassKey +} + +// GetKeyPassKeyOk returns a tuple with the KeyPassKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMtlsServerTls) GetKeyPassKeyOk() (*string, bool) { + if o == nil || o.KeyPassKey == nil { + return nil, false + } + return o.KeyPassKey, true +} + +// HasKeyPassKey returns a boolean if a field has been set. +func (o *ObservabilityPipelineMtlsServerTls) HasKeyPassKey() bool { + return o != nil && o.KeyPassKey != nil +} + +// SetKeyPassKey gets a reference to the given string and assigns it to the KeyPassKey field. +func (o *ObservabilityPipelineMtlsServerTls) SetKeyPassKey(v string) { + o.KeyPassKey = &v +} + +// GetVerifyCertificate returns the VerifyCertificate field value if set, zero value otherwise. +func (o *ObservabilityPipelineMtlsServerTls) GetVerifyCertificate() bool { + if o == nil || o.VerifyCertificate == nil { + var ret bool + return ret + } + return *o.VerifyCertificate +} + +// GetVerifyCertificateOk returns a tuple with the VerifyCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMtlsServerTls) GetVerifyCertificateOk() (*bool, bool) { + if o == nil || o.VerifyCertificate == nil { + return nil, false + } + return o.VerifyCertificate, true +} + +// HasVerifyCertificate returns a boolean if a field has been set. +func (o *ObservabilityPipelineMtlsServerTls) HasVerifyCertificate() bool { + return o != nil && o.VerifyCertificate != nil +} + +// SetVerifyCertificate gets a reference to the given bool and assigns it to the VerifyCertificate field. +func (o *ObservabilityPipelineMtlsServerTls) SetVerifyCertificate(v bool) { + o.VerifyCertificate = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineMtlsServerTls) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CaFile != nil { + toSerialize["ca_file"] = o.CaFile + } + toSerialize["crt_file"] = o.CrtFile + if o.KeyFile != nil { + toSerialize["key_file"] = o.KeyFile + } + if o.KeyPassKey != nil { + toSerialize["key_pass_key"] = o.KeyPassKey + } + if o.VerifyCertificate != nil { + toSerialize["verify_certificate"] = o.VerifyCertificate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineMtlsServerTls) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CaFile *string `json:"ca_file,omitempty"` + CrtFile *string `json:"crt_file"` + KeyFile *string `json:"key_file,omitempty"` + KeyPassKey *string `json:"key_pass_key,omitempty"` + VerifyCertificate *bool `json:"verify_certificate,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CrtFile == nil { + return fmt.Errorf("required field crt_file missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"ca_file", "crt_file", "key_file", "key_pass_key", "verify_certificate"}) + } else { + return err + } + o.CaFile = all.CaFile + o.CrtFile = *all.CrtFile + o.KeyFile = all.KeyFile + o.KeyPassKey = all.KeyPassKey + o.VerifyCertificate = all.VerifyCertificate + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_opentelemetry_source.go b/api/datadogV2/model_observability_pipeline_opentelemetry_source.go index b524ce88291..8a36fd63b39 100644 --- a/api/datadogV2/model_observability_pipeline_opentelemetry_source.go +++ b/api/datadogV2/model_observability_pipeline_opentelemetry_source.go @@ -20,8 +20,8 @@ type ObservabilityPipelineOpentelemetrySource struct { HttpAddressKey *string `json:"http_address_key,omitempty"` // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). Id string `json:"id"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `opentelemetry`. Type ObservabilityPipelineOpentelemetrySourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -130,9 +130,9 @@ func (o *ObservabilityPipelineOpentelemetrySource) SetId(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineOpentelemetrySource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineOpentelemetrySource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -140,7 +140,7 @@ func (o *ObservabilityPipelineOpentelemetrySource) GetTls() ObservabilityPipelin // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineOpentelemetrySource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineOpentelemetrySource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -152,8 +152,8 @@ func (o *ObservabilityPipelineOpentelemetrySource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineOpentelemetrySource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineOpentelemetrySource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -210,7 +210,7 @@ func (o *ObservabilityPipelineOpentelemetrySource) UnmarshalJSON(bytes []byte) ( GrpcAddressKey *string `json:"grpc_address_key,omitempty"` HttpAddressKey *string `json:"http_address_key,omitempty"` Id *string `json:"id"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineOpentelemetrySourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_rsyslog_source.go b/api/datadogV2/model_observability_pipeline_rsyslog_source.go index da6b93170f8..02056bbd037 100644 --- a/api/datadogV2/model_observability_pipeline_rsyslog_source.go +++ b/api/datadogV2/model_observability_pipeline_rsyslog_source.go @@ -20,8 +20,8 @@ type ObservabilityPipelineRsyslogSource struct { Id string `json:"id"` // Protocol used by the syslog source to receive messages. Mode ObservabilityPipelineSyslogSourceMode `json:"mode"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `rsyslog`. Type ObservabilityPipelineRsyslogSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -126,9 +126,9 @@ func (o *ObservabilityPipelineRsyslogSource) SetMode(v ObservabilityPipelineSysl } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineRsyslogSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineRsyslogSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -136,7 +136,7 @@ func (o *ObservabilityPipelineRsyslogSource) GetTls() ObservabilityPipelineTls { // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineRsyslogSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineRsyslogSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -148,8 +148,8 @@ func (o *ObservabilityPipelineRsyslogSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineRsyslogSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineRsyslogSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -204,7 +204,7 @@ func (o *ObservabilityPipelineRsyslogSource) UnmarshalJSON(bytes []byte) (err er AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` Mode *ObservabilityPipelineSyslogSourceMode `json:"mode"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineRsyslogSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_socket_source.go b/api/datadogV2/model_observability_pipeline_socket_source.go index d7dec06a841..c87fc5075a9 100644 --- a/api/datadogV2/model_observability_pipeline_socket_source.go +++ b/api/datadogV2/model_observability_pipeline_socket_source.go @@ -22,8 +22,8 @@ type ObservabilityPipelineSocketSource struct { Id string `json:"id"` // Protocol used to receive logs. Mode ObservabilityPipelineSocketSourceMode `json:"mode"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `socket`. Type ObservabilityPipelineSocketSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -152,9 +152,9 @@ func (o *ObservabilityPipelineSocketSource) SetMode(v ObservabilityPipelineSocke } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineSocketSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineSocketSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -162,7 +162,7 @@ func (o *ObservabilityPipelineSocketSource) GetTls() ObservabilityPipelineTls { // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSocketSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineSocketSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -174,8 +174,8 @@ func (o *ObservabilityPipelineSocketSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineSocketSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineSocketSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -232,7 +232,7 @@ func (o *ObservabilityPipelineSocketSource) UnmarshalJSON(bytes []byte) (err err Framing *ObservabilityPipelineSocketSourceFraming `json:"framing"` Id *string `json:"id"` Mode *ObservabilityPipelineSocketSourceMode `json:"mode"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineSocketSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_source_valid_token_field_to_add.go b/api/datadogV2/model_observability_pipeline_source_valid_token_field_to_add.go new file mode 100644 index 00000000000..c88870ff8ff --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_source_valid_token_field_to_add.go @@ -0,0 +1,134 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineSourceValidTokenFieldToAdd An optional metadata field that is attached to every event authenticated by the +// associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`. +type ObservabilityPipelineSourceValidTokenFieldToAdd struct { + // The metadata field name to add to incoming events. + Key string `json:"key"` + // The metadata field value to add to incoming events. + Value string `json:"value"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineSourceValidTokenFieldToAdd instantiates a new ObservabilityPipelineSourceValidTokenFieldToAdd object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineSourceValidTokenFieldToAdd(key string, value string) *ObservabilityPipelineSourceValidTokenFieldToAdd { + this := ObservabilityPipelineSourceValidTokenFieldToAdd{} + this.Key = key + this.Value = value + return &this +} + +// NewObservabilityPipelineSourceValidTokenFieldToAddWithDefaults instantiates a new ObservabilityPipelineSourceValidTokenFieldToAdd object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineSourceValidTokenFieldToAddWithDefaults() *ObservabilityPipelineSourceValidTokenFieldToAdd { + this := ObservabilityPipelineSourceValidTokenFieldToAdd{} + return &this +} + +// GetKey returns the Key field value. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) GetKey() string { + if o == nil { + var ret string + return ret + } + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) GetValue() string { + if o == nil { + var ret string + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) SetValue(v string) { + o.Value = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineSourceValidTokenFieldToAdd) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineSourceValidTokenFieldToAdd) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Key *string `json:"key"` + Value *string `json:"value"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Key == nil { + return fmt.Errorf("required field key missing") + } + if all.Value == nil { + return fmt.Errorf("required field value missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"key", "value"}) + } else { + return err + } + o.Key = *all.Key + o.Value = *all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_splunk_hec_source.go b/api/datadogV2/model_observability_pipeline_splunk_hec_source.go index 6ca97f87892..e39ff15d431 100644 --- a/api/datadogV2/model_observability_pipeline_splunk_hec_source.go +++ b/api/datadogV2/model_observability_pipeline_splunk_hec_source.go @@ -21,10 +21,13 @@ type ObservabilityPipelineSplunkHecSource struct { // When `true`, the Splunk HEC token from the incoming request is stored in the event metadata. // This allows downstream components to forward the token to other Splunk HEC destinations. StoreHecToken *bool `json:"store_hec_token,omitempty"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. Always `splunk_hec`. Type ObservabilityPipelineSplunkHecSourceType `json:"type"` + // A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source + // rejects any request whose HEC token does not match an enabled entry in this list. + ValidTokens []ObservabilityPipelineSplunkHecSourceValidToken `json:"valid_tokens,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -131,9 +134,9 @@ func (o *ObservabilityPipelineSplunkHecSource) SetStoreHecToken(v bool) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineSplunkHecSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -141,7 +144,7 @@ func (o *ObservabilityPipelineSplunkHecSource) GetTls() ObservabilityPipelineTls // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineSplunkHecSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -153,8 +156,8 @@ func (o *ObservabilityPipelineSplunkHecSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineSplunkHecSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineSplunkHecSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -181,6 +184,34 @@ func (o *ObservabilityPipelineSplunkHecSource) SetType(v ObservabilityPipelineSp o.Type = v } +// GetValidTokens returns the ValidTokens field value if set, zero value otherwise. +func (o *ObservabilityPipelineSplunkHecSource) GetValidTokens() []ObservabilityPipelineSplunkHecSourceValidToken { + if o == nil || o.ValidTokens == nil { + var ret []ObservabilityPipelineSplunkHecSourceValidToken + return ret + } + return o.ValidTokens +} + +// GetValidTokensOk returns a tuple with the ValidTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSplunkHecSource) GetValidTokensOk() (*[]ObservabilityPipelineSplunkHecSourceValidToken, bool) { + if o == nil || o.ValidTokens == nil { + return nil, false + } + return &o.ValidTokens, true +} + +// HasValidTokens returns a boolean if a field has been set. +func (o *ObservabilityPipelineSplunkHecSource) HasValidTokens() bool { + return o != nil && o.ValidTokens != nil +} + +// SetValidTokens gets a reference to the given []ObservabilityPipelineSplunkHecSourceValidToken and assigns it to the ValidTokens field. +func (o *ObservabilityPipelineSplunkHecSource) SetValidTokens(v []ObservabilityPipelineSplunkHecSourceValidToken) { + o.ValidTokens = v +} + // MarshalJSON serializes the struct using spec logic. func (o ObservabilityPipelineSplunkHecSource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -198,6 +229,9 @@ func (o ObservabilityPipelineSplunkHecSource) MarshalJSON() ([]byte, error) { toSerialize["tls"] = o.Tls } toSerialize["type"] = o.Type + if o.ValidTokens != nil { + toSerialize["valid_tokens"] = o.ValidTokens + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -208,11 +242,12 @@ func (o ObservabilityPipelineSplunkHecSource) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineSplunkHecSource) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AddressKey *string `json:"address_key,omitempty"` - Id *string `json:"id"` - StoreHecToken *bool `json:"store_hec_token,omitempty"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` - Type *ObservabilityPipelineSplunkHecSourceType `json:"type"` + AddressKey *string `json:"address_key,omitempty"` + Id *string `json:"id"` + StoreHecToken *bool `json:"store_hec_token,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` + Type *ObservabilityPipelineSplunkHecSourceType `json:"type"` + ValidTokens []ObservabilityPipelineSplunkHecSourceValidToken `json:"valid_tokens,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -225,7 +260,7 @@ func (o *ObservabilityPipelineSplunkHecSource) UnmarshalJSON(bytes []byte) (err } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"address_key", "id", "store_hec_token", "tls", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"address_key", "id", "store_hec_token", "tls", "type", "valid_tokens"}) } else { return err } @@ -243,6 +278,7 @@ func (o *ObservabilityPipelineSplunkHecSource) UnmarshalJSON(bytes []byte) (err } else { o.Type = *all.Type } + o.ValidTokens = all.ValidTokens if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_observability_pipeline_splunk_hec_source_valid_token.go b/api/datadogV2/model_observability_pipeline_splunk_hec_source_valid_token.go new file mode 100644 index 00000000000..a62498375b8 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_splunk_hec_source_valid_token.go @@ -0,0 +1,186 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineSplunkHecSourceValidToken An accepted HEC token used to authenticate incoming Splunk HEC requests. +type ObservabilityPipelineSplunkHecSourceValidToken struct { + // Indicates whether this token is currently accepted. Disabled tokens are rejected without + // being removed from the configuration. + Enabled *bool `json:"enabled,omitempty"` + // An optional metadata field that is attached to every event authenticated by the + // associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`. + FieldToAdd *ObservabilityPipelineSourceValidTokenFieldToAdd `json:"field_to_add,omitempty"` + // Name of the environment variable or secret that holds the expected HEC token value. + TokenKey string `json:"token_key"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineSplunkHecSourceValidToken instantiates a new ObservabilityPipelineSplunkHecSourceValidToken object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineSplunkHecSourceValidToken(tokenKey string) *ObservabilityPipelineSplunkHecSourceValidToken { + this := ObservabilityPipelineSplunkHecSourceValidToken{} + var enabled bool = true + this.Enabled = &enabled + this.TokenKey = tokenKey + return &this +} + +// NewObservabilityPipelineSplunkHecSourceValidTokenWithDefaults instantiates a new ObservabilityPipelineSplunkHecSourceValidToken object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineSplunkHecSourceValidTokenWithDefaults() *ObservabilityPipelineSplunkHecSourceValidToken { + this := ObservabilityPipelineSplunkHecSourceValidToken{} + var enabled bool = true + this.Enabled = &enabled + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) HasEnabled() bool { + return o != nil && o.Enabled != nil +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetFieldToAdd returns the FieldToAdd field value if set, zero value otherwise. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetFieldToAdd() ObservabilityPipelineSourceValidTokenFieldToAdd { + if o == nil || o.FieldToAdd == nil { + var ret ObservabilityPipelineSourceValidTokenFieldToAdd + return ret + } + return *o.FieldToAdd +} + +// GetFieldToAddOk returns a tuple with the FieldToAdd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetFieldToAddOk() (*ObservabilityPipelineSourceValidTokenFieldToAdd, bool) { + if o == nil || o.FieldToAdd == nil { + return nil, false + } + return o.FieldToAdd, true +} + +// HasFieldToAdd returns a boolean if a field has been set. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) HasFieldToAdd() bool { + return o != nil && o.FieldToAdd != nil +} + +// SetFieldToAdd gets a reference to the given ObservabilityPipelineSourceValidTokenFieldToAdd and assigns it to the FieldToAdd field. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) SetFieldToAdd(v ObservabilityPipelineSourceValidTokenFieldToAdd) { + o.FieldToAdd = &v +} + +// GetTokenKey returns the TokenKey field value. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetTokenKey() string { + if o == nil { + var ret string + return ret + } + return o.TokenKey +} + +// GetTokenKeyOk returns a tuple with the TokenKey field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) GetTokenKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenKey, true +} + +// SetTokenKey sets field value. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) SetTokenKey(v string) { + o.TokenKey = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineSplunkHecSourceValidToken) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + if o.FieldToAdd != nil { + toSerialize["field_to_add"] = o.FieldToAdd + } + toSerialize["token_key"] = o.TokenKey + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineSplunkHecSourceValidToken) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Enabled *bool `json:"enabled,omitempty"` + FieldToAdd *ObservabilityPipelineSourceValidTokenFieldToAdd `json:"field_to_add,omitempty"` + TokenKey *string `json:"token_key"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.TokenKey == nil { + return fmt.Errorf("required field token_key missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"enabled", "field_to_add", "token_key"}) + } else { + return err + } + + hasInvalidField := false + o.Enabled = all.Enabled + if all.FieldToAdd != nil && all.FieldToAdd.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.FieldToAdd = all.FieldToAdd + o.TokenKey = *all.TokenKey + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_splunk_tcp_source.go b/api/datadogV2/model_observability_pipeline_splunk_tcp_source.go index b527e59f8e0..bb2383afd14 100644 --- a/api/datadogV2/model_observability_pipeline_splunk_tcp_source.go +++ b/api/datadogV2/model_observability_pipeline_splunk_tcp_source.go @@ -19,8 +19,8 @@ type ObservabilityPipelineSplunkTcpSource struct { AddressKey *string `json:"address_key,omitempty"` // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). Id string `json:"id"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. Always `splunk_tcp`. Type ObservabilityPipelineSplunkTcpSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -101,9 +101,9 @@ func (o *ObservabilityPipelineSplunkTcpSource) SetId(v string) { } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkTcpSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineSplunkTcpSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -111,7 +111,7 @@ func (o *ObservabilityPipelineSplunkTcpSource) GetTls() ObservabilityPipelineTls // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkTcpSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineSplunkTcpSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -123,8 +123,8 @@ func (o *ObservabilityPipelineSplunkTcpSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineSplunkTcpSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineSplunkTcpSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -177,7 +177,7 @@ func (o *ObservabilityPipelineSplunkTcpSource) UnmarshalJSON(bytes []byte) (err all := struct { AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineSplunkTcpSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_observability_pipeline_syslog_ng_source.go b/api/datadogV2/model_observability_pipeline_syslog_ng_source.go index 5f4f8515da6..1d23506343c 100644 --- a/api/datadogV2/model_observability_pipeline_syslog_ng_source.go +++ b/api/datadogV2/model_observability_pipeline_syslog_ng_source.go @@ -20,8 +20,8 @@ type ObservabilityPipelineSyslogNgSource struct { Id string `json:"id"` // Protocol used by the syslog source to receive messages. Mode ObservabilityPipelineSyslogSourceMode `json:"mode"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external connecting clients. + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` // The source type. The value should always be `syslog_ng`. Type ObservabilityPipelineSyslogNgSourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -126,9 +126,9 @@ func (o *ObservabilityPipelineSyslogNgSource) SetMode(v ObservabilityPipelineSys } // GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineSyslogNgSource) GetTls() ObservabilityPipelineTls { +func (o *ObservabilityPipelineSyslogNgSource) GetTls() ObservabilityPipelineMtlsServerTls { if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls + var ret ObservabilityPipelineMtlsServerTls return ret } return *o.Tls @@ -136,7 +136,7 @@ func (o *ObservabilityPipelineSyslogNgSource) GetTls() ObservabilityPipelineTls // GetTlsOk returns a tuple with the Tls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSyslogNgSource) GetTlsOk() (*ObservabilityPipelineTls, bool) { +func (o *ObservabilityPipelineSyslogNgSource) GetTlsOk() (*ObservabilityPipelineMtlsServerTls, bool) { if o == nil || o.Tls == nil { return nil, false } @@ -148,8 +148,8 @@ func (o *ObservabilityPipelineSyslogNgSource) HasTls() bool { return o != nil && o.Tls != nil } -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineSyslogNgSource) SetTls(v ObservabilityPipelineTls) { +// SetTls gets a reference to the given ObservabilityPipelineMtlsServerTls and assigns it to the Tls field. +func (o *ObservabilityPipelineSyslogNgSource) SetTls(v ObservabilityPipelineMtlsServerTls) { o.Tls = &v } @@ -204,7 +204,7 @@ func (o *ObservabilityPipelineSyslogNgSource) UnmarshalJSON(bytes []byte) (err e AddressKey *string `json:"address_key,omitempty"` Id *string `json:"id"` Mode *ObservabilityPipelineSyslogSourceMode `json:"mode"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Tls *ObservabilityPipelineMtlsServerTls `json:"tls,omitempty"` Type *ObservabilityPipelineSyslogNgSourceType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_project_favorite.go b/api/datadogV2/model_project_favorite.go new file mode 100644 index 00000000000..f6b07d42e4f --- /dev/null +++ b/api/datadogV2/model_project_favorite.go @@ -0,0 +1,145 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ProjectFavorite Represents a case project that the current user has bookmarked for quick access. Favorited projects appear prominently in the Case Management UI. +type ProjectFavorite struct { + // The UUID of the favorited project. + Id string `json:"id"` + // JSON:API resource type for project favorites. + Type ProjectFavoriteResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewProjectFavorite instantiates a new ProjectFavorite object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewProjectFavorite(id string, typeVar ProjectFavoriteResourceType) *ProjectFavorite { + this := ProjectFavorite{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewProjectFavoriteWithDefaults instantiates a new ProjectFavorite object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewProjectFavoriteWithDefaults() *ProjectFavorite { + this := ProjectFavorite{} + var typeVar ProjectFavoriteResourceType = PROJECTFAVORITERESOURCETYPE_PROJECT_FAVORITE + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *ProjectFavorite) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ProjectFavorite) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ProjectFavorite) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ProjectFavorite) GetType() ProjectFavoriteResourceType { + if o == nil { + var ret ProjectFavoriteResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ProjectFavorite) GetTypeOk() (*ProjectFavoriteResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ProjectFavorite) SetType(v ProjectFavoriteResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ProjectFavorite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ProjectFavorite) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *ProjectFavoriteResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_project_favorite_resource_type.go b/api/datadogV2/model_project_favorite_resource_type.go new file mode 100644 index 00000000000..07f4ec4cb27 --- /dev/null +++ b/api/datadogV2/model_project_favorite_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ProjectFavoriteResourceType JSON:API resource type for project favorites. +type ProjectFavoriteResourceType string + +// List of ProjectFavoriteResourceType. +const ( + PROJECTFAVORITERESOURCETYPE_PROJECT_FAVORITE ProjectFavoriteResourceType = "project_favorite" +) + +var allowedProjectFavoriteResourceTypeEnumValues = []ProjectFavoriteResourceType{ + PROJECTFAVORITERESOURCETYPE_PROJECT_FAVORITE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ProjectFavoriteResourceType) GetAllowedValues() []ProjectFavoriteResourceType { + return allowedProjectFavoriteResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ProjectFavoriteResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ProjectFavoriteResourceType(value) + return nil +} + +// NewProjectFavoriteResourceTypeFromValue returns a pointer to a valid ProjectFavoriteResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewProjectFavoriteResourceTypeFromValue(v string) (*ProjectFavoriteResourceType, error) { + ev := ProjectFavoriteResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ProjectFavoriteResourceType: valid values are %v", v, allowedProjectFavoriteResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ProjectFavoriteResourceType) IsValid() bool { + for _, existing := range allowedProjectFavoriteResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProjectFavoriteResourceType value. +func (v ProjectFavoriteResourceType) Ptr() *ProjectFavoriteResourceType { + return &v +} diff --git a/api/datadogV2/model_project_favorites_response.go b/api/datadogV2/model_project_favorites_response.go new file mode 100644 index 00000000000..5f829c223a8 --- /dev/null +++ b/api/datadogV2/model_project_favorites_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ProjectFavoritesResponse Response containing the list of projects the current user has favorited. +type ProjectFavoritesResponse struct { + // List of project favorites. + Data []ProjectFavorite `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewProjectFavoritesResponse instantiates a new ProjectFavoritesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewProjectFavoritesResponse(data []ProjectFavorite) *ProjectFavoritesResponse { + this := ProjectFavoritesResponse{} + this.Data = data + return &this +} + +// NewProjectFavoritesResponseWithDefaults instantiates a new ProjectFavoritesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewProjectFavoritesResponseWithDefaults() *ProjectFavoritesResponse { + this := ProjectFavoritesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *ProjectFavoritesResponse) GetData() []ProjectFavorite { + if o == nil { + var ret []ProjectFavorite + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ProjectFavoritesResponse) GetDataOk() (*[]ProjectFavorite, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *ProjectFavoritesResponse) SetData(v []ProjectFavorite) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ProjectFavoritesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ProjectFavoritesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]ProjectFavorite `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_publish_request_type.go b/api/datadogV2/model_publish_request_type.go new file mode 100644 index 00000000000..d50b2138290 --- /dev/null +++ b/api/datadogV2/model_publish_request_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// PublishRequestType The publish-request resource type. +type PublishRequestType string + +// List of PublishRequestType. +const ( + PUBLISHREQUESTTYPE_PUBLISHREQUEST PublishRequestType = "publishRequest" +) + +var allowedPublishRequestTypeEnumValues = []PublishRequestType{ + PUBLISHREQUESTTYPE_PUBLISHREQUEST, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *PublishRequestType) GetAllowedValues() []PublishRequestType { + return allowedPublishRequestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *PublishRequestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = PublishRequestType(value) + return nil +} + +// NewPublishRequestTypeFromValue returns a pointer to a valid PublishRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewPublishRequestTypeFromValue(v string) (*PublishRequestType, error) { + ev := PublishRequestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for PublishRequestType: valid values are %v", v, allowedPublishRequestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v PublishRequestType) IsValid() bool { + for _, existing := range allowedPublishRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PublishRequestType value. +func (v PublishRequestType) Ptr() *PublishRequestType { + return &v +} diff --git a/api/datadogV2/model_recommendations_filter_request.go b/api/datadogV2/model_recommendations_filter_request.go new file mode 100644 index 00000000000..aa19f52dcf3 --- /dev/null +++ b/api/datadogV2/model_recommendations_filter_request.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RecommendationsFilterRequest Request body for filtering cost recommendations. +type RecommendationsFilterRequest struct { + // Filter expression applied to the recommendations. + Filter *string `json:"filter,omitempty"` + // Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + Scope *string `json:"scope,omitempty"` + // Ordered list of sort clauses applied to the result set. + Sort []RecommendationsFilterRequestSortItems `json:"sort,omitempty"` + // Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + View *string `json:"view,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRecommendationsFilterRequest instantiates a new RecommendationsFilterRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRecommendationsFilterRequest() *RecommendationsFilterRequest { + this := RecommendationsFilterRequest{} + return &this +} + +// NewRecommendationsFilterRequestWithDefaults instantiates a new RecommendationsFilterRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRecommendationsFilterRequestWithDefaults() *RecommendationsFilterRequest { + this := RecommendationsFilterRequest{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *RecommendationsFilterRequest) GetFilter() string { + if o == nil || o.Filter == nil { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequest) GetFilterOk() (*string, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *RecommendationsFilterRequest) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *RecommendationsFilterRequest) SetFilter(v string) { + o.Filter = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *RecommendationsFilterRequest) GetScope() string { + if o == nil || o.Scope == nil { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequest) GetScopeOk() (*string, bool) { + if o == nil || o.Scope == nil { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *RecommendationsFilterRequest) HasScope() bool { + return o != nil && o.Scope != nil +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *RecommendationsFilterRequest) SetScope(v string) { + o.Scope = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *RecommendationsFilterRequest) GetSort() []RecommendationsFilterRequestSortItems { + if o == nil || o.Sort == nil { + var ret []RecommendationsFilterRequestSortItems + return ret + } + return o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequest) GetSortOk() (*[]RecommendationsFilterRequestSortItems, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return &o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *RecommendationsFilterRequest) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given []RecommendationsFilterRequestSortItems and assigns it to the Sort field. +func (o *RecommendationsFilterRequest) SetSort(v []RecommendationsFilterRequestSortItems) { + o.Sort = v +} + +// GetView returns the View field value if set, zero value otherwise. +func (o *RecommendationsFilterRequest) GetView() string { + if o == nil || o.View == nil { + var ret string + return ret + } + return *o.View +} + +// GetViewOk returns a tuple with the View field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequest) GetViewOk() (*string, bool) { + if o == nil || o.View == nil { + return nil, false + } + return o.View, true +} + +// HasView returns a boolean if a field has been set. +func (o *RecommendationsFilterRequest) HasView() bool { + return o != nil && o.View != nil +} + +// SetView gets a reference to the given string and assigns it to the View field. +func (o *RecommendationsFilterRequest) SetView(v string) { + o.View = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RecommendationsFilterRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + if o.View != nil { + toSerialize["view"] = o.View + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RecommendationsFilterRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Filter *string `json:"filter,omitempty"` + Scope *string `json:"scope,omitempty"` + Sort []RecommendationsFilterRequestSortItems `json:"sort,omitempty"` + View *string `json:"view,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"filter", "scope", "sort", "view"}) + } else { + return err + } + o.Filter = all.Filter + o.Scope = all.Scope + o.Sort = all.Sort + o.View = all.View + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_recommendations_filter_request_sort_items.go b/api/datadogV2/model_recommendations_filter_request_sort_items.go new file mode 100644 index 00000000000..fddbf10ca73 --- /dev/null +++ b/api/datadogV2/model_recommendations_filter_request_sort_items.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RecommendationsFilterRequestSortItems A single sort clause applied to the cost recommendations result set. +type RecommendationsFilterRequestSortItems struct { + // Field to sort by (for example, `potential_daily_savings.amount`). + Expression *string `json:"expression,omitempty"` + // Sort direction, either `ASC` or `DESC`. + Order *string `json:"order,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRecommendationsFilterRequestSortItems instantiates a new RecommendationsFilterRequestSortItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRecommendationsFilterRequestSortItems() *RecommendationsFilterRequestSortItems { + this := RecommendationsFilterRequestSortItems{} + return &this +} + +// NewRecommendationsFilterRequestSortItemsWithDefaults instantiates a new RecommendationsFilterRequestSortItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRecommendationsFilterRequestSortItemsWithDefaults() *RecommendationsFilterRequestSortItems { + this := RecommendationsFilterRequestSortItems{} + return &this +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *RecommendationsFilterRequestSortItems) GetExpression() string { + if o == nil || o.Expression == nil { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequestSortItems) GetExpressionOk() (*string, bool) { + if o == nil || o.Expression == nil { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *RecommendationsFilterRequestSortItems) HasExpression() bool { + return o != nil && o.Expression != nil +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *RecommendationsFilterRequestSortItems) SetExpression(v string) { + o.Expression = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *RecommendationsFilterRequestSortItems) GetOrder() string { + if o == nil || o.Order == nil { + var ret string + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsFilterRequestSortItems) GetOrderOk() (*string, bool) { + if o == nil || o.Order == nil { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *RecommendationsFilterRequestSortItems) HasOrder() bool { + return o != nil && o.Order != nil +} + +// SetOrder gets a reference to the given string and assigns it to the Order field. +func (o *RecommendationsFilterRequestSortItems) SetOrder(v string) { + o.Order = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RecommendationsFilterRequestSortItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Expression != nil { + toSerialize["expression"] = o.Expression + } + if o.Order != nil { + toSerialize["order"] = o.Order + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RecommendationsFilterRequestSortItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Expression *string `json:"expression,omitempty"` + Order *string `json:"order,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"expression", "order"}) + } else { + return err + } + o.Expression = all.Expression + o.Order = all.Order + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_recommendations_page_meta.go b/api/datadogV2/model_recommendations_page_meta.go new file mode 100644 index 00000000000..c2bef3900e1 --- /dev/null +++ b/api/datadogV2/model_recommendations_page_meta.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RecommendationsPageMeta Top-level JSON:API meta object for paginated cost recommendation responses. +type RecommendationsPageMeta struct { + // Pagination metadata for a page of cost recommendations. + Page *RecommendationsPageMetaPage `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRecommendationsPageMeta instantiates a new RecommendationsPageMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRecommendationsPageMeta() *RecommendationsPageMeta { + this := RecommendationsPageMeta{} + return &this +} + +// NewRecommendationsPageMetaWithDefaults instantiates a new RecommendationsPageMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRecommendationsPageMetaWithDefaults() *RecommendationsPageMeta { + this := RecommendationsPageMeta{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *RecommendationsPageMeta) GetPage() RecommendationsPageMetaPage { + if o == nil || o.Page == nil { + var ret RecommendationsPageMetaPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsPageMeta) GetPageOk() (*RecommendationsPageMetaPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *RecommendationsPageMeta) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given RecommendationsPageMetaPage and assigns it to the Page field. +func (o *RecommendationsPageMeta) SetPage(v RecommendationsPageMetaPage) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RecommendationsPageMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RecommendationsPageMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *RecommendationsPageMetaPage `json:"page,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page"}) + } else { + return err + } + + hasInvalidField := false + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_recommendations_page_meta_page.go b/api/datadogV2/model_recommendations_page_meta_page.go new file mode 100644 index 00000000000..6f1b1c19013 --- /dev/null +++ b/api/datadogV2/model_recommendations_page_meta_page.go @@ -0,0 +1,207 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RecommendationsPageMetaPage Pagination metadata for a page of cost recommendations. +type RecommendationsPageMetaPage struct { + // The filter expression that was applied to produce this page. + Filter *string `json:"filter,omitempty"` + // Opaque token used to fetch the next page; absent on the last page. + NextPageToken *string `json:"next_page_token,omitempty"` + // Number of items returned in this page (1–10000). + PageSize *int32 `json:"page_size,omitempty"` + // Pagination token echoed back from the request. + PageToken *string `json:"page_token,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRecommendationsPageMetaPage instantiates a new RecommendationsPageMetaPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRecommendationsPageMetaPage() *RecommendationsPageMetaPage { + this := RecommendationsPageMetaPage{} + return &this +} + +// NewRecommendationsPageMetaPageWithDefaults instantiates a new RecommendationsPageMetaPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRecommendationsPageMetaPageWithDefaults() *RecommendationsPageMetaPage { + this := RecommendationsPageMetaPage{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *RecommendationsPageMetaPage) GetFilter() string { + if o == nil || o.Filter == nil { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsPageMetaPage) GetFilterOk() (*string, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *RecommendationsPageMetaPage) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *RecommendationsPageMetaPage) SetFilter(v string) { + o.Filter = &v +} + +// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. +func (o *RecommendationsPageMetaPage) GetNextPageToken() string { + if o == nil || o.NextPageToken == nil { + var ret string + return ret + } + return *o.NextPageToken +} + +// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsPageMetaPage) GetNextPageTokenOk() (*string, bool) { + if o == nil || o.NextPageToken == nil { + return nil, false + } + return o.NextPageToken, true +} + +// HasNextPageToken returns a boolean if a field has been set. +func (o *RecommendationsPageMetaPage) HasNextPageToken() bool { + return o != nil && o.NextPageToken != nil +} + +// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. +func (o *RecommendationsPageMetaPage) SetNextPageToken(v string) { + o.NextPageToken = &v +} + +// GetPageSize returns the PageSize field value if set, zero value otherwise. +func (o *RecommendationsPageMetaPage) GetPageSize() int32 { + if o == nil || o.PageSize == nil { + var ret int32 + return ret + } + return *o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsPageMetaPage) GetPageSizeOk() (*int32, bool) { + if o == nil || o.PageSize == nil { + return nil, false + } + return o.PageSize, true +} + +// HasPageSize returns a boolean if a field has been set. +func (o *RecommendationsPageMetaPage) HasPageSize() bool { + return o != nil && o.PageSize != nil +} + +// SetPageSize gets a reference to the given int32 and assigns it to the PageSize field. +func (o *RecommendationsPageMetaPage) SetPageSize(v int32) { + o.PageSize = &v +} + +// GetPageToken returns the PageToken field value if set, zero value otherwise. +func (o *RecommendationsPageMetaPage) GetPageToken() string { + if o == nil || o.PageToken == nil { + var ret string + return ret + } + return *o.PageToken +} + +// GetPageTokenOk returns a tuple with the PageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecommendationsPageMetaPage) GetPageTokenOk() (*string, bool) { + if o == nil || o.PageToken == nil { + return nil, false + } + return o.PageToken, true +} + +// HasPageToken returns a boolean if a field has been set. +func (o *RecommendationsPageMetaPage) HasPageToken() bool { + return o != nil && o.PageToken != nil +} + +// SetPageToken gets a reference to the given string and assigns it to the PageToken field. +func (o *RecommendationsPageMetaPage) SetPageToken(v string) { + o.PageToken = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RecommendationsPageMetaPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.NextPageToken != nil { + toSerialize["next_page_token"] = o.NextPageToken + } + if o.PageSize != nil { + toSerialize["page_size"] = o.PageSize + } + if o.PageToken != nil { + toSerialize["page_token"] = o.PageToken + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RecommendationsPageMetaPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Filter *string `json:"filter,omitempty"` + NextPageToken *string `json:"next_page_token,omitempty"` + PageSize *int32 `json:"page_size,omitempty"` + PageToken *string `json:"page_token,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"filter", "next_page_token", "page_size", "page_token"}) + } else { + return err + } + o.Filter = all.Filter + o.NextPageToken = all.NextPageToken + o.PageSize = all.PageSize + o.PageToken = all.PageToken + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_routing_rule_action.go b/api/datadogV2/model_routing_rule_action.go index 9c68d759d1a..625d811a0cf 100644 --- a/api/datadogV2/model_routing_rule_action.go +++ b/api/datadogV2/model_routing_rule_action.go @@ -10,9 +10,10 @@ import ( // RoutingRuleAction - Defines an action that is executed when a routing rule matches certain criteria. type RoutingRuleAction struct { - SendSlackMessageAction *SendSlackMessageAction - SendTeamsMessageAction *SendTeamsMessageAction - TriggerWorkflowAutomationAction *TriggerWorkflowAutomationAction + SendSlackMessageAction *SendSlackMessageAction + SendTeamsMessageAction *SendTeamsMessageAction + TriggerWorkflowAutomationAction *TriggerWorkflowAutomationAction + RoutingRuleEscalationPolicyAction *RoutingRuleEscalationPolicyAction // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -33,6 +34,11 @@ func TriggerWorkflowAutomationActionAsRoutingRuleAction(v *TriggerWorkflowAutoma return RoutingRuleAction{TriggerWorkflowAutomationAction: v} } +// RoutingRuleEscalationPolicyActionAsRoutingRuleAction is a convenience function that returns RoutingRuleEscalationPolicyAction wrapped in RoutingRuleAction. +func RoutingRuleEscalationPolicyActionAsRoutingRuleAction(v *RoutingRuleEscalationPolicyAction) RoutingRuleAction { + return RoutingRuleAction{RoutingRuleEscalationPolicyAction: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *RoutingRuleAction) UnmarshalJSON(data []byte) error { var err error @@ -88,11 +94,29 @@ func (obj *RoutingRuleAction) UnmarshalJSON(data []byte) error { obj.TriggerWorkflowAutomationAction = nil } + // try to unmarshal data into RoutingRuleEscalationPolicyAction + err = datadog.Unmarshal(data, &obj.RoutingRuleEscalationPolicyAction) + if err == nil { + if obj.RoutingRuleEscalationPolicyAction != nil && obj.RoutingRuleEscalationPolicyAction.UnparsedObject == nil { + jsonRoutingRuleEscalationPolicyAction, _ := datadog.Marshal(obj.RoutingRuleEscalationPolicyAction) + if string(jsonRoutingRuleEscalationPolicyAction) == "{}" { // empty struct + obj.RoutingRuleEscalationPolicyAction = nil + } else { + match++ + } + } else { + obj.RoutingRuleEscalationPolicyAction = nil + } + } else { + obj.RoutingRuleEscalationPolicyAction = nil + } + if match != 1 { // more than 1 match // reset to nil obj.SendSlackMessageAction = nil obj.SendTeamsMessageAction = nil obj.TriggerWorkflowAutomationAction = nil + obj.RoutingRuleEscalationPolicyAction = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -112,6 +136,10 @@ func (obj RoutingRuleAction) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.TriggerWorkflowAutomationAction) } + if obj.RoutingRuleEscalationPolicyAction != nil { + return datadog.Marshal(&obj.RoutingRuleEscalationPolicyAction) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -132,6 +160,10 @@ func (obj *RoutingRuleAction) GetActualInstance() interface{} { return obj.TriggerWorkflowAutomationAction } + if obj.RoutingRuleEscalationPolicyAction != nil { + return obj.RoutingRuleEscalationPolicyAction + } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_routing_rule_attributes.go b/api/datadogV2/model_routing_rule_attributes.go index 9afc458a4db..672a29734cd 100644 --- a/api/datadogV2/model_routing_rule_attributes.go +++ b/api/datadogV2/model_routing_rule_attributes.go @@ -14,7 +14,7 @@ type RoutingRuleAttributes struct { Actions []RoutingRuleAction `json:"actions,omitempty"` // Defines the query or condition that triggers this routing rule. Query *string `json:"query,omitempty"` - // Holds time zone information and a list of time restrictions for a routing rule. + // Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field. TimeRestriction *TimeRestrictions `json:"time_restriction,omitempty"` // Specifies the level of urgency for a routing rule (low, high, or dynamic). Urgency *Urgency `json:"urgency,omitempty"` diff --git a/api/datadogV2/model_routing_rule_escalation_policy_action.go b/api/datadogV2/model_routing_rule_escalation_policy_action.go new file mode 100644 index 00000000000..237fe6c60e6 --- /dev/null +++ b/api/datadogV2/model_routing_rule_escalation_policy_action.go @@ -0,0 +1,257 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RoutingRuleEscalationPolicyAction Triggers an escalation policy. +type RoutingRuleEscalationPolicyAction struct { + // The number of minutes before an acknowledged page is re-triggered. + AckTimeoutMinutes *int64 `json:"ack_timeout_minutes,omitempty"` + // The ID of the escalation policy to route to. + PolicyId string `json:"policy_id"` + // Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule. + SupportHours *RoutingRuleEscalationPolicyActionSupportHours `json:"support_hours,omitempty"` + // Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule. + Type RoutingRuleEscalationPolicyActionType `json:"type"` + // Specifies the level of urgency for a routing rule (low, high, or dynamic). + Urgency *Urgency `json:"urgency,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRoutingRuleEscalationPolicyAction instantiates a new RoutingRuleEscalationPolicyAction object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRoutingRuleEscalationPolicyAction(policyId string, typeVar RoutingRuleEscalationPolicyActionType) *RoutingRuleEscalationPolicyAction { + this := RoutingRuleEscalationPolicyAction{} + this.PolicyId = policyId + this.Type = typeVar + return &this +} + +// NewRoutingRuleEscalationPolicyActionWithDefaults instantiates a new RoutingRuleEscalationPolicyAction object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRoutingRuleEscalationPolicyActionWithDefaults() *RoutingRuleEscalationPolicyAction { + this := RoutingRuleEscalationPolicyAction{} + var typeVar RoutingRuleEscalationPolicyActionType = ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY + this.Type = typeVar + return &this +} + +// GetAckTimeoutMinutes returns the AckTimeoutMinutes field value if set, zero value otherwise. +func (o *RoutingRuleEscalationPolicyAction) GetAckTimeoutMinutes() int64 { + if o == nil || o.AckTimeoutMinutes == nil { + var ret int64 + return ret + } + return *o.AckTimeoutMinutes +} + +// GetAckTimeoutMinutesOk returns a tuple with the AckTimeoutMinutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyAction) GetAckTimeoutMinutesOk() (*int64, bool) { + if o == nil || o.AckTimeoutMinutes == nil { + return nil, false + } + return o.AckTimeoutMinutes, true +} + +// HasAckTimeoutMinutes returns a boolean if a field has been set. +func (o *RoutingRuleEscalationPolicyAction) HasAckTimeoutMinutes() bool { + return o != nil && o.AckTimeoutMinutes != nil +} + +// SetAckTimeoutMinutes gets a reference to the given int64 and assigns it to the AckTimeoutMinutes field. +func (o *RoutingRuleEscalationPolicyAction) SetAckTimeoutMinutes(v int64) { + o.AckTimeoutMinutes = &v +} + +// GetPolicyId returns the PolicyId field value. +func (o *RoutingRuleEscalationPolicyAction) GetPolicyId() string { + if o == nil { + var ret string + return ret + } + return o.PolicyId +} + +// GetPolicyIdOk returns a tuple with the PolicyId field value +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyAction) GetPolicyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicyId, true +} + +// SetPolicyId sets field value. +func (o *RoutingRuleEscalationPolicyAction) SetPolicyId(v string) { + o.PolicyId = v +} + +// GetSupportHours returns the SupportHours field value if set, zero value otherwise. +func (o *RoutingRuleEscalationPolicyAction) GetSupportHours() RoutingRuleEscalationPolicyActionSupportHours { + if o == nil || o.SupportHours == nil { + var ret RoutingRuleEscalationPolicyActionSupportHours + return ret + } + return *o.SupportHours +} + +// GetSupportHoursOk returns a tuple with the SupportHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyAction) GetSupportHoursOk() (*RoutingRuleEscalationPolicyActionSupportHours, bool) { + if o == nil || o.SupportHours == nil { + return nil, false + } + return o.SupportHours, true +} + +// HasSupportHours returns a boolean if a field has been set. +func (o *RoutingRuleEscalationPolicyAction) HasSupportHours() bool { + return o != nil && o.SupportHours != nil +} + +// SetSupportHours gets a reference to the given RoutingRuleEscalationPolicyActionSupportHours and assigns it to the SupportHours field. +func (o *RoutingRuleEscalationPolicyAction) SetSupportHours(v RoutingRuleEscalationPolicyActionSupportHours) { + o.SupportHours = &v +} + +// GetType returns the Type field value. +func (o *RoutingRuleEscalationPolicyAction) GetType() RoutingRuleEscalationPolicyActionType { + if o == nil { + var ret RoutingRuleEscalationPolicyActionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyAction) GetTypeOk() (*RoutingRuleEscalationPolicyActionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *RoutingRuleEscalationPolicyAction) SetType(v RoutingRuleEscalationPolicyActionType) { + o.Type = v +} + +// GetUrgency returns the Urgency field value if set, zero value otherwise. +func (o *RoutingRuleEscalationPolicyAction) GetUrgency() Urgency { + if o == nil || o.Urgency == nil { + var ret Urgency + return ret + } + return *o.Urgency +} + +// GetUrgencyOk returns a tuple with the Urgency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyAction) GetUrgencyOk() (*Urgency, bool) { + if o == nil || o.Urgency == nil { + return nil, false + } + return o.Urgency, true +} + +// HasUrgency returns a boolean if a field has been set. +func (o *RoutingRuleEscalationPolicyAction) HasUrgency() bool { + return o != nil && o.Urgency != nil +} + +// SetUrgency gets a reference to the given Urgency and assigns it to the Urgency field. +func (o *RoutingRuleEscalationPolicyAction) SetUrgency(v Urgency) { + o.Urgency = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RoutingRuleEscalationPolicyAction) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AckTimeoutMinutes != nil { + toSerialize["ack_timeout_minutes"] = o.AckTimeoutMinutes + } + toSerialize["policy_id"] = o.PolicyId + if o.SupportHours != nil { + toSerialize["support_hours"] = o.SupportHours + } + toSerialize["type"] = o.Type + if o.Urgency != nil { + toSerialize["urgency"] = o.Urgency + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RoutingRuleEscalationPolicyAction) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AckTimeoutMinutes *int64 `json:"ack_timeout_minutes,omitempty"` + PolicyId *string `json:"policy_id"` + SupportHours *RoutingRuleEscalationPolicyActionSupportHours `json:"support_hours,omitempty"` + Type *RoutingRuleEscalationPolicyActionType `json:"type"` + Urgency *Urgency `json:"urgency,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.PolicyId == nil { + return fmt.Errorf("required field policy_id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"ack_timeout_minutes", "policy_id", "support_hours", "type", "urgency"}) + } else { + return err + } + + hasInvalidField := false + o.AckTimeoutMinutes = all.AckTimeoutMinutes + o.PolicyId = *all.PolicyId + if all.SupportHours != nil && all.SupportHours.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.SupportHours = all.SupportHours + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + if all.Urgency != nil && !all.Urgency.IsValid() { + hasInvalidField = true + } else { + o.Urgency = all.Urgency + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_routing_rule_escalation_policy_action_support_hours.go b/api/datadogV2/model_routing_rule_escalation_policy_action_support_hours.go new file mode 100644 index 00000000000..1aeda6c081e --- /dev/null +++ b/api/datadogV2/model_routing_rule_escalation_policy_action_support_hours.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RoutingRuleEscalationPolicyActionSupportHours Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule. +type RoutingRuleEscalationPolicyActionSupportHours struct { + // The list of support hours time windows. + Restrictions []TimeRestriction `json:"restrictions,omitempty"` + // The time zone in which the support hours are expressed. + TimeZone string `json:"time_zone"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRoutingRuleEscalationPolicyActionSupportHours instantiates a new RoutingRuleEscalationPolicyActionSupportHours object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRoutingRuleEscalationPolicyActionSupportHours(timeZone string) *RoutingRuleEscalationPolicyActionSupportHours { + this := RoutingRuleEscalationPolicyActionSupportHours{} + this.TimeZone = timeZone + return &this +} + +// NewRoutingRuleEscalationPolicyActionSupportHoursWithDefaults instantiates a new RoutingRuleEscalationPolicyActionSupportHours object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRoutingRuleEscalationPolicyActionSupportHoursWithDefaults() *RoutingRuleEscalationPolicyActionSupportHours { + this := RoutingRuleEscalationPolicyActionSupportHours{} + return &this +} + +// GetRestrictions returns the Restrictions field value if set, zero value otherwise. +func (o *RoutingRuleEscalationPolicyActionSupportHours) GetRestrictions() []TimeRestriction { + if o == nil || o.Restrictions == nil { + var ret []TimeRestriction + return ret + } + return o.Restrictions +} + +// GetRestrictionsOk returns a tuple with the Restrictions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyActionSupportHours) GetRestrictionsOk() (*[]TimeRestriction, bool) { + if o == nil || o.Restrictions == nil { + return nil, false + } + return &o.Restrictions, true +} + +// HasRestrictions returns a boolean if a field has been set. +func (o *RoutingRuleEscalationPolicyActionSupportHours) HasRestrictions() bool { + return o != nil && o.Restrictions != nil +} + +// SetRestrictions gets a reference to the given []TimeRestriction and assigns it to the Restrictions field. +func (o *RoutingRuleEscalationPolicyActionSupportHours) SetRestrictions(v []TimeRestriction) { + o.Restrictions = v +} + +// GetTimeZone returns the TimeZone field value. +func (o *RoutingRuleEscalationPolicyActionSupportHours) GetTimeZone() string { + if o == nil { + var ret string + return ret + } + return o.TimeZone +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value +// and a boolean to check if the value has been set. +func (o *RoutingRuleEscalationPolicyActionSupportHours) GetTimeZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TimeZone, true +} + +// SetTimeZone sets field value. +func (o *RoutingRuleEscalationPolicyActionSupportHours) SetTimeZone(v string) { + o.TimeZone = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RoutingRuleEscalationPolicyActionSupportHours) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Restrictions != nil { + toSerialize["restrictions"] = o.Restrictions + } + toSerialize["time_zone"] = o.TimeZone + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RoutingRuleEscalationPolicyActionSupportHours) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Restrictions []TimeRestriction `json:"restrictions,omitempty"` + TimeZone *string `json:"time_zone"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.TimeZone == nil { + return fmt.Errorf("required field time_zone missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"restrictions", "time_zone"}) + } else { + return err + } + o.Restrictions = all.Restrictions + o.TimeZone = *all.TimeZone + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_routing_rule_escalation_policy_action_type.go b/api/datadogV2/model_routing_rule_escalation_policy_action_type.go new file mode 100644 index 00000000000..7b17941d83a --- /dev/null +++ b/api/datadogV2/model_routing_rule_escalation_policy_action_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RoutingRuleEscalationPolicyActionType Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule. +type RoutingRuleEscalationPolicyActionType string + +// List of RoutingRuleEscalationPolicyActionType. +const ( + ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY RoutingRuleEscalationPolicyActionType = "escalation_policy" +) + +var allowedRoutingRuleEscalationPolicyActionTypeEnumValues = []RoutingRuleEscalationPolicyActionType{ + ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *RoutingRuleEscalationPolicyActionType) GetAllowedValues() []RoutingRuleEscalationPolicyActionType { + return allowedRoutingRuleEscalationPolicyActionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *RoutingRuleEscalationPolicyActionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = RoutingRuleEscalationPolicyActionType(value) + return nil +} + +// NewRoutingRuleEscalationPolicyActionTypeFromValue returns a pointer to a valid RoutingRuleEscalationPolicyActionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewRoutingRuleEscalationPolicyActionTypeFromValue(v string) (*RoutingRuleEscalationPolicyActionType, error) { + ev := RoutingRuleEscalationPolicyActionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for RoutingRuleEscalationPolicyActionType: valid values are %v", v, allowedRoutingRuleEscalationPolicyActionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v RoutingRuleEscalationPolicyActionType) IsValid() bool { + for _, existing := range allowedRoutingRuleEscalationPolicyActionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RoutingRuleEscalationPolicyActionType value. +func (v RoutingRuleEscalationPolicyActionType) Ptr() *RoutingRuleEscalationPolicyActionType { + return &v +} diff --git a/api/datadogV2/model_rule_based_view_attributes.go b/api/datadogV2/model_rule_based_view_attributes.go new file mode 100644 index 00000000000..ad5157b444d --- /dev/null +++ b/api/datadogV2/model_rule_based_view_attributes.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewAttributes Attributes of the rule-based view. +type RuleBasedViewAttributes struct { + // Total number of rules in the view. + Count int64 `json:"count"` + // List of rules in the rule-based view. + Rules []RuleBasedViewRule `json:"rules"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewAttributes instantiates a new RuleBasedViewAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewAttributes(count int64, rules []RuleBasedViewRule) *RuleBasedViewAttributes { + this := RuleBasedViewAttributes{} + this.Count = count + this.Rules = rules + return &this +} + +// NewRuleBasedViewAttributesWithDefaults instantiates a new RuleBasedViewAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewAttributesWithDefaults() *RuleBasedViewAttributes { + this := RuleBasedViewAttributes{} + return &this +} + +// GetCount returns the Count field value. +func (o *RuleBasedViewAttributes) GetCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewAttributes) GetCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value. +func (o *RuleBasedViewAttributes) SetCount(v int64) { + o.Count = v +} + +// GetRules returns the Rules field value. +func (o *RuleBasedViewAttributes) GetRules() []RuleBasedViewRule { + if o == nil { + var ret []RuleBasedViewRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewAttributes) GetRulesOk() (*[]RuleBasedViewRule, bool) { + if o == nil { + return nil, false + } + return &o.Rules, true +} + +// SetRules sets field value. +func (o *RuleBasedViewAttributes) SetRules(v []RuleBasedViewRule) { + o.Rules = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["count"] = o.Count + toSerialize["rules"] = o.Rules + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Count *int64 `json:"count"` + Rules *[]RuleBasedViewRule `json:"rules"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Count == nil { + return fmt.Errorf("required field count missing") + } + if all.Rules == nil { + return fmt.Errorf("required field rules missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"count", "rules"}) + } else { + return err + } + o.Count = *all.Count + o.Rules = *all.Rules + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_compliance_framework.go b/api/datadogV2/model_rule_based_view_compliance_framework.go new file mode 100644 index 00000000000..abac8595d84 --- /dev/null +++ b/api/datadogV2/model_rule_based_view_compliance_framework.go @@ -0,0 +1,277 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewComplianceFramework Compliance framework mapping for a rule. +type RuleBasedViewComplianceFramework struct { + // Identifier of the control inside the requirement. + Control *string `json:"control,omitempty"` + // Handle of the compliance framework. + Framework *string `json:"framework,omitempty"` + // Whether the framework is a Datadog default framework. `true` indicates a Datadog framework and `false` indicates a custom framework. + IsDefault *bool `json:"is_default,omitempty"` + // Optional message describing the framework mapping for the rule. + Message *string `json:"message,omitempty"` + // Name of the requirement that contains the control. + Requirement *string `json:"requirement,omitempty"` + // Version of the compliance framework. + Version *string `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewComplianceFramework instantiates a new RuleBasedViewComplianceFramework object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewComplianceFramework() *RuleBasedViewComplianceFramework { + this := RuleBasedViewComplianceFramework{} + return &this +} + +// NewRuleBasedViewComplianceFrameworkWithDefaults instantiates a new RuleBasedViewComplianceFramework object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewComplianceFrameworkWithDefaults() *RuleBasedViewComplianceFramework { + this := RuleBasedViewComplianceFramework{} + return &this +} + +// GetControl returns the Control field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetControl() string { + if o == nil || o.Control == nil { + var ret string + return ret + } + return *o.Control +} + +// GetControlOk returns a tuple with the Control field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetControlOk() (*string, bool) { + if o == nil || o.Control == nil { + return nil, false + } + return o.Control, true +} + +// HasControl returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasControl() bool { + return o != nil && o.Control != nil +} + +// SetControl gets a reference to the given string and assigns it to the Control field. +func (o *RuleBasedViewComplianceFramework) SetControl(v string) { + o.Control = &v +} + +// GetFramework returns the Framework field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetFramework() string { + if o == nil || o.Framework == nil { + var ret string + return ret + } + return *o.Framework +} + +// GetFrameworkOk returns a tuple with the Framework field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetFrameworkOk() (*string, bool) { + if o == nil || o.Framework == nil { + return nil, false + } + return o.Framework, true +} + +// HasFramework returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasFramework() bool { + return o != nil && o.Framework != nil +} + +// SetFramework gets a reference to the given string and assigns it to the Framework field. +func (o *RuleBasedViewComplianceFramework) SetFramework(v string) { + o.Framework = &v +} + +// GetIsDefault returns the IsDefault field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetIsDefault() bool { + if o == nil || o.IsDefault == nil { + var ret bool + return ret + } + return *o.IsDefault +} + +// GetIsDefaultOk returns a tuple with the IsDefault field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetIsDefaultOk() (*bool, bool) { + if o == nil || o.IsDefault == nil { + return nil, false + } + return o.IsDefault, true +} + +// HasIsDefault returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasIsDefault() bool { + return o != nil && o.IsDefault != nil +} + +// SetIsDefault gets a reference to the given bool and assigns it to the IsDefault field. +func (o *RuleBasedViewComplianceFramework) SetIsDefault(v bool) { + o.IsDefault = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *RuleBasedViewComplianceFramework) SetMessage(v string) { + o.Message = &v +} + +// GetRequirement returns the Requirement field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetRequirement() string { + if o == nil || o.Requirement == nil { + var ret string + return ret + } + return *o.Requirement +} + +// GetRequirementOk returns a tuple with the Requirement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetRequirementOk() (*string, bool) { + if o == nil || o.Requirement == nil { + return nil, false + } + return o.Requirement, true +} + +// HasRequirement returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasRequirement() bool { + return o != nil && o.Requirement != nil +} + +// SetRequirement gets a reference to the given string and assigns it to the Requirement field. +func (o *RuleBasedViewComplianceFramework) SetRequirement(v string) { + o.Requirement = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *RuleBasedViewComplianceFramework) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleBasedViewComplianceFramework) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *RuleBasedViewComplianceFramework) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *RuleBasedViewComplianceFramework) SetVersion(v string) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewComplianceFramework) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Control != nil { + toSerialize["control"] = o.Control + } + if o.Framework != nil { + toSerialize["framework"] = o.Framework + } + if o.IsDefault != nil { + toSerialize["is_default"] = o.IsDefault + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Requirement != nil { + toSerialize["requirement"] = o.Requirement + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewComplianceFramework) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Control *string `json:"control,omitempty"` + Framework *string `json:"framework,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + Message *string `json:"message,omitempty"` + Requirement *string `json:"requirement,omitempty"` + Version *string `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"control", "framework", "is_default", "message", "requirement", "version"}) + } else { + return err + } + o.Control = all.Control + o.Framework = all.Framework + o.IsDefault = all.IsDefault + o.Message = all.Message + o.Requirement = all.Requirement + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_data.go b/api/datadogV2/model_rule_based_view_data.go new file mode 100644 index 00000000000..241de070ce4 --- /dev/null +++ b/api/datadogV2/model_rule_based_view_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewData Data envelope for the rule-based view response. +type RuleBasedViewData struct { + // Attributes of the rule-based view. + Attributes RuleBasedViewAttributes `json:"attributes"` + // Unique identifier of the rule-based view document. + Id string `json:"id"` + // The type of the resource. The value should always be `rule_based_view`. + Type RuleBasedViewType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewData instantiates a new RuleBasedViewData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewData(attributes RuleBasedViewAttributes, id string, typeVar RuleBasedViewType) *RuleBasedViewData { + this := RuleBasedViewData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewRuleBasedViewDataWithDefaults instantiates a new RuleBasedViewData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewDataWithDefaults() *RuleBasedViewData { + this := RuleBasedViewData{} + var typeVar RuleBasedViewType = RULEBASEDVIEWTYPE_RULE_BASED_VIEW + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *RuleBasedViewData) GetAttributes() RuleBasedViewAttributes { + if o == nil { + var ret RuleBasedViewAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewData) GetAttributesOk() (*RuleBasedViewAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *RuleBasedViewData) SetAttributes(v RuleBasedViewAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *RuleBasedViewData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *RuleBasedViewData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *RuleBasedViewData) GetType() RuleBasedViewType { + if o == nil { + var ret RuleBasedViewType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewData) GetTypeOk() (*RuleBasedViewType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *RuleBasedViewData) SetType(v RuleBasedViewType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *RuleBasedViewAttributes `json:"attributes"` + Id *string `json:"id"` + Type *RuleBasedViewType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_response.go b/api/datadogV2/model_rule_based_view_response.go new file mode 100644 index 00000000000..1274c12b7cc --- /dev/null +++ b/api/datadogV2/model_rule_based_view_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewResponse Response containing an aggregated view of compliance rules with their finding statistics. +type RuleBasedViewResponse struct { + // Data envelope for the rule-based view response. + Data RuleBasedViewData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewResponse instantiates a new RuleBasedViewResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewResponse(data RuleBasedViewData) *RuleBasedViewResponse { + this := RuleBasedViewResponse{} + this.Data = data + return &this +} + +// NewRuleBasedViewResponseWithDefaults instantiates a new RuleBasedViewResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewResponseWithDefaults() *RuleBasedViewResponse { + this := RuleBasedViewResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *RuleBasedViewResponse) GetData() RuleBasedViewData { + if o == nil { + var ret RuleBasedViewData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewResponse) GetDataOk() (*RuleBasedViewData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *RuleBasedViewResponse) SetData(v RuleBasedViewData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *RuleBasedViewData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_rule.go b/api/datadogV2/model_rule_based_view_rule.go new file mode 100644 index 00000000000..0341f8f968b --- /dev/null +++ b/api/datadogV2/model_rule_based_view_rule.go @@ -0,0 +1,434 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewRule A compliance rule along with its evaluation statistics and framework mappings. +type RuleBasedViewRule struct { + // List of compliance framework mappings associated with the rule. + ComplianceFrameworks []RuleBasedViewComplianceFramework `json:"compliance_frameworks"` + // Whether the rule is enabled. + Enabled bool `json:"enabled"` + // Unique identifier of the rule. + Id string `json:"id"` + // Human-readable name of the rule. + Name string `json:"name"` + // List of resource attribute names exposed by the rule. + ResourceAttributes []string `json:"resourceAttributes"` + // Resource category targeted by the rule. + ResourceCategory string `json:"resourceCategory"` + // Resource type targeted by the rule. + ResourceType string `json:"resourceType"` + // Counts of findings for the rule, grouped by their evaluation status. + Stats RuleBasedViewRuleStats `json:"stats"` + // Severity associated with the rule (for example, `info`, `low`, `medium`, `high`, or `critical`). + Status string `json:"status"` + // List of tags attached to the rule. + Tags []string `json:"tags"` + // The category of the security rule. + Type RuleBasedViewRuleCategory `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewRule instantiates a new RuleBasedViewRule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewRule(complianceFrameworks []RuleBasedViewComplianceFramework, enabled bool, id string, name string, resourceAttributes []string, resourceCategory string, resourceType string, stats RuleBasedViewRuleStats, status string, tags []string, typeVar RuleBasedViewRuleCategory) *RuleBasedViewRule { + this := RuleBasedViewRule{} + this.ComplianceFrameworks = complianceFrameworks + this.Enabled = enabled + this.Id = id + this.Name = name + this.ResourceAttributes = resourceAttributes + this.ResourceCategory = resourceCategory + this.ResourceType = resourceType + this.Stats = stats + this.Status = status + this.Tags = tags + this.Type = typeVar + return &this +} + +// NewRuleBasedViewRuleWithDefaults instantiates a new RuleBasedViewRule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewRuleWithDefaults() *RuleBasedViewRule { + this := RuleBasedViewRule{} + return &this +} + +// GetComplianceFrameworks returns the ComplianceFrameworks field value. +func (o *RuleBasedViewRule) GetComplianceFrameworks() []RuleBasedViewComplianceFramework { + if o == nil { + var ret []RuleBasedViewComplianceFramework + return ret + } + return o.ComplianceFrameworks +} + +// GetComplianceFrameworksOk returns a tuple with the ComplianceFrameworks field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetComplianceFrameworksOk() (*[]RuleBasedViewComplianceFramework, bool) { + if o == nil { + return nil, false + } + return &o.ComplianceFrameworks, true +} + +// SetComplianceFrameworks sets field value. +func (o *RuleBasedViewRule) SetComplianceFrameworks(v []RuleBasedViewComplianceFramework) { + o.ComplianceFrameworks = v +} + +// GetEnabled returns the Enabled field value. +func (o *RuleBasedViewRule) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value. +func (o *RuleBasedViewRule) SetEnabled(v bool) { + o.Enabled = v +} + +// GetId returns the Id field value. +func (o *RuleBasedViewRule) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *RuleBasedViewRule) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *RuleBasedViewRule) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *RuleBasedViewRule) SetName(v string) { + o.Name = v +} + +// GetResourceAttributes returns the ResourceAttributes field value. +func (o *RuleBasedViewRule) GetResourceAttributes() []string { + if o == nil { + var ret []string + return ret + } + return o.ResourceAttributes +} + +// GetResourceAttributesOk returns a tuple with the ResourceAttributes field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetResourceAttributesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceAttributes, true +} + +// SetResourceAttributes sets field value. +func (o *RuleBasedViewRule) SetResourceAttributes(v []string) { + o.ResourceAttributes = v +} + +// GetResourceCategory returns the ResourceCategory field value. +func (o *RuleBasedViewRule) GetResourceCategory() string { + if o == nil { + var ret string + return ret + } + return o.ResourceCategory +} + +// GetResourceCategoryOk returns a tuple with the ResourceCategory field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetResourceCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceCategory, true +} + +// SetResourceCategory sets field value. +func (o *RuleBasedViewRule) SetResourceCategory(v string) { + o.ResourceCategory = v +} + +// GetResourceType returns the ResourceType field value. +func (o *RuleBasedViewRule) GetResourceType() string { + if o == nil { + var ret string + return ret + } + return o.ResourceType +} + +// GetResourceTypeOk returns a tuple with the ResourceType field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetResourceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceType, true +} + +// SetResourceType sets field value. +func (o *RuleBasedViewRule) SetResourceType(v string) { + o.ResourceType = v +} + +// GetStats returns the Stats field value. +func (o *RuleBasedViewRule) GetStats() RuleBasedViewRuleStats { + if o == nil { + var ret RuleBasedViewRuleStats + return ret + } + return o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetStatsOk() (*RuleBasedViewRuleStats, bool) { + if o == nil { + return nil, false + } + return &o.Stats, true +} + +// SetStats sets field value. +func (o *RuleBasedViewRule) SetStats(v RuleBasedViewRuleStats) { + o.Stats = v +} + +// GetStatus returns the Status field value. +func (o *RuleBasedViewRule) GetStatus() string { + if o == nil { + var ret string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *RuleBasedViewRule) SetStatus(v string) { + o.Status = v +} + +// GetTags returns the Tags field value. +func (o *RuleBasedViewRule) GetTags() []string { + if o == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *RuleBasedViewRule) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value. +func (o *RuleBasedViewRule) GetType() RuleBasedViewRuleCategory { + if o == nil { + var ret RuleBasedViewRuleCategory + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRule) GetTypeOk() (*RuleBasedViewRuleCategory, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *RuleBasedViewRule) SetType(v RuleBasedViewRuleCategory) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["compliance_frameworks"] = o.ComplianceFrameworks + toSerialize["enabled"] = o.Enabled + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["resourceAttributes"] = o.ResourceAttributes + toSerialize["resourceCategory"] = o.ResourceCategory + toSerialize["resourceType"] = o.ResourceType + toSerialize["stats"] = o.Stats + toSerialize["status"] = o.Status + toSerialize["tags"] = o.Tags + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewRule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ComplianceFrameworks *[]RuleBasedViewComplianceFramework `json:"compliance_frameworks"` + Enabled *bool `json:"enabled"` + Id *string `json:"id"` + Name *string `json:"name"` + ResourceAttributes *[]string `json:"resourceAttributes"` + ResourceCategory *string `json:"resourceCategory"` + ResourceType *string `json:"resourceType"` + Stats *RuleBasedViewRuleStats `json:"stats"` + Status *string `json:"status"` + Tags *[]string `json:"tags"` + Type *RuleBasedViewRuleCategory `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ComplianceFrameworks == nil { + return fmt.Errorf("required field compliance_frameworks missing") + } + if all.Enabled == nil { + return fmt.Errorf("required field enabled missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.ResourceAttributes == nil { + return fmt.Errorf("required field resourceAttributes missing") + } + if all.ResourceCategory == nil { + return fmt.Errorf("required field resourceCategory missing") + } + if all.ResourceType == nil { + return fmt.Errorf("required field resourceType missing") + } + if all.Stats == nil { + return fmt.Errorf("required field stats missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"compliance_frameworks", "enabled", "id", "name", "resourceAttributes", "resourceCategory", "resourceType", "stats", "status", "tags", "type"}) + } else { + return err + } + + hasInvalidField := false + o.ComplianceFrameworks = *all.ComplianceFrameworks + o.Enabled = *all.Enabled + o.Id = *all.Id + o.Name = *all.Name + o.ResourceAttributes = *all.ResourceAttributes + o.ResourceCategory = *all.ResourceCategory + o.ResourceType = *all.ResourceType + if all.Stats.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Stats = *all.Stats + o.Status = *all.Status + o.Tags = *all.Tags + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_rule_category.go b/api/datadogV2/model_rule_based_view_rule_category.go new file mode 100644 index 00000000000..05938526386 --- /dev/null +++ b/api/datadogV2/model_rule_based_view_rule_category.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewRuleCategory The category of the security rule. +type RuleBasedViewRuleCategory string + +// List of RuleBasedViewRuleCategory. +const ( + RULEBASEDVIEWRULECATEGORY_CLOUD_CONFIGURATION RuleBasedViewRuleCategory = "cloud_configuration" + RULEBASEDVIEWRULECATEGORY_INFRASTRUCTURE_CONFIGURATION RuleBasedViewRuleCategory = "infrastructure_configuration" + RULEBASEDVIEWRULECATEGORY_API_SECURITY RuleBasedViewRuleCategory = "api_security" +) + +var allowedRuleBasedViewRuleCategoryEnumValues = []RuleBasedViewRuleCategory{ + RULEBASEDVIEWRULECATEGORY_CLOUD_CONFIGURATION, + RULEBASEDVIEWRULECATEGORY_INFRASTRUCTURE_CONFIGURATION, + RULEBASEDVIEWRULECATEGORY_API_SECURITY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *RuleBasedViewRuleCategory) GetAllowedValues() []RuleBasedViewRuleCategory { + return allowedRuleBasedViewRuleCategoryEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *RuleBasedViewRuleCategory) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = RuleBasedViewRuleCategory(value) + return nil +} + +// NewRuleBasedViewRuleCategoryFromValue returns a pointer to a valid RuleBasedViewRuleCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewRuleBasedViewRuleCategoryFromValue(v string) (*RuleBasedViewRuleCategory, error) { + ev := RuleBasedViewRuleCategory(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for RuleBasedViewRuleCategory: valid values are %v", v, allowedRuleBasedViewRuleCategoryEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v RuleBasedViewRuleCategory) IsValid() bool { + for _, existing := range allowedRuleBasedViewRuleCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RuleBasedViewRuleCategory value. +func (v RuleBasedViewRuleCategory) Ptr() *RuleBasedViewRuleCategory { + return &v +} diff --git a/api/datadogV2/model_rule_based_view_rule_stats.go b/api/datadogV2/model_rule_based_view_rule_stats.go new file mode 100644 index 00000000000..bc1f75e8735 --- /dev/null +++ b/api/datadogV2/model_rule_based_view_rule_stats.go @@ -0,0 +1,165 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewRuleStats Counts of findings for the rule, grouped by their evaluation status. +type RuleBasedViewRuleStats struct { + // Number of findings that failed evaluation. + Fail int64 `json:"fail"` + // Number of findings that have been muted. + Muted int64 `json:"muted"` + // Number of findings that passed evaluation. + Pass int64 `json:"pass"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRuleBasedViewRuleStats instantiates a new RuleBasedViewRuleStats object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRuleBasedViewRuleStats(fail int64, muted int64, pass int64) *RuleBasedViewRuleStats { + this := RuleBasedViewRuleStats{} + this.Fail = fail + this.Muted = muted + this.Pass = pass + return &this +} + +// NewRuleBasedViewRuleStatsWithDefaults instantiates a new RuleBasedViewRuleStats object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRuleBasedViewRuleStatsWithDefaults() *RuleBasedViewRuleStats { + this := RuleBasedViewRuleStats{} + return &this +} + +// GetFail returns the Fail field value. +func (o *RuleBasedViewRuleStats) GetFail() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Fail +} + +// GetFailOk returns a tuple with the Fail field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRuleStats) GetFailOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Fail, true +} + +// SetFail sets field value. +func (o *RuleBasedViewRuleStats) SetFail(v int64) { + o.Fail = v +} + +// GetMuted returns the Muted field value. +func (o *RuleBasedViewRuleStats) GetMuted() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Muted +} + +// GetMutedOk returns a tuple with the Muted field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRuleStats) GetMutedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Muted, true +} + +// SetMuted sets field value. +func (o *RuleBasedViewRuleStats) SetMuted(v int64) { + o.Muted = v +} + +// GetPass returns the Pass field value. +func (o *RuleBasedViewRuleStats) GetPass() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Pass +} + +// GetPassOk returns a tuple with the Pass field value +// and a boolean to check if the value has been set. +func (o *RuleBasedViewRuleStats) GetPassOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Pass, true +} + +// SetPass sets field value. +func (o *RuleBasedViewRuleStats) SetPass(v int64) { + o.Pass = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RuleBasedViewRuleStats) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["fail"] = o.Fail + toSerialize["muted"] = o.Muted + toSerialize["pass"] = o.Pass + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RuleBasedViewRuleStats) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Fail *int64 `json:"fail"` + Muted *int64 `json:"muted"` + Pass *int64 `json:"pass"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Fail == nil { + return fmt.Errorf("required field fail missing") + } + if all.Muted == nil { + return fmt.Errorf("required field muted missing") + } + if all.Pass == nil { + return fmt.Errorf("required field pass missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"fail", "muted", "pass"}) + } else { + return err + } + o.Fail = *all.Fail + o.Muted = *all.Muted + o.Pass = *all.Pass + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_rule_based_view_type.go b/api/datadogV2/model_rule_based_view_type.go new file mode 100644 index 00000000000..b6418391db0 --- /dev/null +++ b/api/datadogV2/model_rule_based_view_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RuleBasedViewType The type of the resource. The value should always be `rule_based_view`. +type RuleBasedViewType string + +// List of RuleBasedViewType. +const ( + RULEBASEDVIEWTYPE_RULE_BASED_VIEW RuleBasedViewType = "rule_based_view" +) + +var allowedRuleBasedViewTypeEnumValues = []RuleBasedViewType{ + RULEBASEDVIEWTYPE_RULE_BASED_VIEW, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *RuleBasedViewType) GetAllowedValues() []RuleBasedViewType { + return allowedRuleBasedViewTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *RuleBasedViewType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = RuleBasedViewType(value) + return nil +} + +// NewRuleBasedViewTypeFromValue returns a pointer to a valid RuleBasedViewType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewRuleBasedViewTypeFromValue(v string) (*RuleBasedViewType, error) { + ev := RuleBasedViewType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for RuleBasedViewType: valid values are %v", v, allowedRuleBasedViewTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v RuleBasedViewType) IsValid() bool { + for _, existing := range allowedRuleBasedViewTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RuleBasedViewType value. +func (v RuleBasedViewType) Ptr() *RuleBasedViewType { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_attributes.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_attributes.go new file mode 100644 index 00000000000..3f047d643e2 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_attributes.go @@ -0,0 +1,150 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionAttributes The attributes for creating sample log generation subscriptions for multiple content packs. +type SampleLogGenerationBulkSubscriptionAttributes struct { + // The identifiers of the Cloud SIEM content packs to subscribe to. At most five content packs can be requested in a single call. + ContentPackIds []string `json:"content_pack_ids"` + // How long the subscription should remain active before expiring. + Duration *SampleLogGenerationDuration `json:"duration,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionAttributes instantiates a new SampleLogGenerationBulkSubscriptionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionAttributes(contentPackIds []string) *SampleLogGenerationBulkSubscriptionAttributes { + this := SampleLogGenerationBulkSubscriptionAttributes{} + this.ContentPackIds = contentPackIds + var duration SampleLogGenerationDuration = SAMPLELOGGENERATIONDURATION_THREE_DAYS + this.Duration = &duration + return &this +} + +// NewSampleLogGenerationBulkSubscriptionAttributesWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionAttributesWithDefaults() *SampleLogGenerationBulkSubscriptionAttributes { + this := SampleLogGenerationBulkSubscriptionAttributes{} + var duration SampleLogGenerationDuration = SAMPLELOGGENERATIONDURATION_THREE_DAYS + this.Duration = &duration + return &this +} + +// GetContentPackIds returns the ContentPackIds field value. +func (o *SampleLogGenerationBulkSubscriptionAttributes) GetContentPackIds() []string { + if o == nil { + var ret []string + return ret + } + return o.ContentPackIds +} + +// GetContentPackIdsOk returns a tuple with the ContentPackIds field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionAttributes) GetContentPackIdsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.ContentPackIds, true +} + +// SetContentPackIds sets field value. +func (o *SampleLogGenerationBulkSubscriptionAttributes) SetContentPackIds(v []string) { + o.ContentPackIds = v +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SampleLogGenerationBulkSubscriptionAttributes) GetDuration() SampleLogGenerationDuration { + if o == nil || o.Duration == nil { + var ret SampleLogGenerationDuration + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionAttributes) GetDurationOk() (*SampleLogGenerationDuration, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SampleLogGenerationBulkSubscriptionAttributes) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given SampleLogGenerationDuration and assigns it to the Duration field. +func (o *SampleLogGenerationBulkSubscriptionAttributes) SetDuration(v SampleLogGenerationDuration) { + o.Duration = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["content_pack_ids"] = o.ContentPackIds + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentPackIds *[]string `json:"content_pack_ids"` + Duration *SampleLogGenerationDuration `json:"duration,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ContentPackIds == nil { + return fmt.Errorf("required field content_pack_ids missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_pack_ids", "duration"}) + } else { + return err + } + + hasInvalidField := false + o.ContentPackIds = *all.ContentPackIds + if all.Duration != nil && !all.Duration.IsValid() { + hasInvalidField = true + } else { + o.Duration = all.Duration + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_data.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_data.go new file mode 100644 index 00000000000..e33ace18cd1 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionData The bulk subscription request body. +type SampleLogGenerationBulkSubscriptionData struct { + // The attributes for creating sample log generation subscriptions for multiple content packs. + Attributes SampleLogGenerationBulkSubscriptionAttributes `json:"attributes"` + // The type of the resource. The value should always be `bulk_subscription_requests`. + Type SampleLogGenerationBulkSubscriptionRequestType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionData instantiates a new SampleLogGenerationBulkSubscriptionData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionData(attributes SampleLogGenerationBulkSubscriptionAttributes, typeVar SampleLogGenerationBulkSubscriptionRequestType) *SampleLogGenerationBulkSubscriptionData { + this := SampleLogGenerationBulkSubscriptionData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewSampleLogGenerationBulkSubscriptionDataWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionDataWithDefaults() *SampleLogGenerationBulkSubscriptionData { + this := SampleLogGenerationBulkSubscriptionData{} + var typeVar SampleLogGenerationBulkSubscriptionRequestType = SAMPLELOGGENERATIONBULKSUBSCRIPTIONREQUESTTYPE_BULK_SUBSCRIPTION_REQUESTS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SampleLogGenerationBulkSubscriptionData) GetAttributes() SampleLogGenerationBulkSubscriptionAttributes { + if o == nil { + var ret SampleLogGenerationBulkSubscriptionAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionData) GetAttributesOk() (*SampleLogGenerationBulkSubscriptionAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SampleLogGenerationBulkSubscriptionData) SetAttributes(v SampleLogGenerationBulkSubscriptionAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *SampleLogGenerationBulkSubscriptionData) GetType() SampleLogGenerationBulkSubscriptionRequestType { + if o == nil { + var ret SampleLogGenerationBulkSubscriptionRequestType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionData) GetTypeOk() (*SampleLogGenerationBulkSubscriptionRequestType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SampleLogGenerationBulkSubscriptionData) SetType(v SampleLogGenerationBulkSubscriptionRequestType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SampleLogGenerationBulkSubscriptionAttributes `json:"attributes"` + Type *SampleLogGenerationBulkSubscriptionRequestType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_item_meta.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_item_meta.go new file mode 100644 index 00000000000..71d12cd467d --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_item_meta.go @@ -0,0 +1,136 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionItemMeta Per-item status returned for a bulk subscription request. +type SampleLogGenerationBulkSubscriptionItemMeta struct { + // A description of the error encountered for this content pack, if the subscription could not be created. + Error *string `json:"error,omitempty"` + // The HTTP status code that resulted from creating the subscription for this content pack. + Status int32 `json:"status"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionItemMeta instantiates a new SampleLogGenerationBulkSubscriptionItemMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionItemMeta(status int32) *SampleLogGenerationBulkSubscriptionItemMeta { + this := SampleLogGenerationBulkSubscriptionItemMeta{} + this.Status = status + return &this +} + +// NewSampleLogGenerationBulkSubscriptionItemMetaWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionItemMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionItemMetaWithDefaults() *SampleLogGenerationBulkSubscriptionItemMeta { + this := SampleLogGenerationBulkSubscriptionItemMeta{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) GetError() string { + if o == nil || o.Error == nil { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) GetErrorOk() (*string, bool) { + if o == nil || o.Error == nil { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) HasError() bool { + return o != nil && o.Error != nil +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) SetError(v string) { + o.Error = &v +} + +// GetStatus returns the Status field value. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) GetStatus() int32 { + if o == nil { + var ret int32 + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) GetStatusOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) SetStatus(v int32) { + o.Status = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionItemMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Error != nil { + toSerialize["error"] = o.Error + } + toSerialize["status"] = o.Status + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionItemMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Error *string `json:"error,omitempty"` + Status *int32 `json:"status"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"error", "status"}) + } else { + return err + } + o.Error = all.Error + o.Status = *all.Status + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_request.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_request.go new file mode 100644 index 00000000000..4897c5b85fc --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionRequest Request body to create sample log generation subscriptions for multiple content packs at once. +type SampleLogGenerationBulkSubscriptionRequest struct { + // The bulk subscription request body. + Data SampleLogGenerationBulkSubscriptionData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionRequest instantiates a new SampleLogGenerationBulkSubscriptionRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionRequest(data SampleLogGenerationBulkSubscriptionData) *SampleLogGenerationBulkSubscriptionRequest { + this := SampleLogGenerationBulkSubscriptionRequest{} + this.Data = data + return &this +} + +// NewSampleLogGenerationBulkSubscriptionRequestWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionRequestWithDefaults() *SampleLogGenerationBulkSubscriptionRequest { + this := SampleLogGenerationBulkSubscriptionRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *SampleLogGenerationBulkSubscriptionRequest) GetData() SampleLogGenerationBulkSubscriptionData { + if o == nil { + var ret SampleLogGenerationBulkSubscriptionData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionRequest) GetDataOk() (*SampleLogGenerationBulkSubscriptionData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SampleLogGenerationBulkSubscriptionRequest) SetData(v SampleLogGenerationBulkSubscriptionData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SampleLogGenerationBulkSubscriptionData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_request_type.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_request_type.go new file mode 100644 index 00000000000..b5cd0eb6399 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_request_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionRequestType The type of the resource. The value should always be `bulk_subscription_requests`. +type SampleLogGenerationBulkSubscriptionRequestType string + +// List of SampleLogGenerationBulkSubscriptionRequestType. +const ( + SAMPLELOGGENERATIONBULKSUBSCRIPTIONREQUESTTYPE_BULK_SUBSCRIPTION_REQUESTS SampleLogGenerationBulkSubscriptionRequestType = "bulk_subscription_requests" +) + +var allowedSampleLogGenerationBulkSubscriptionRequestTypeEnumValues = []SampleLogGenerationBulkSubscriptionRequestType{ + SAMPLELOGGENERATIONBULKSUBSCRIPTIONREQUESTTYPE_BULK_SUBSCRIPTION_REQUESTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationBulkSubscriptionRequestType) GetAllowedValues() []SampleLogGenerationBulkSubscriptionRequestType { + return allowedSampleLogGenerationBulkSubscriptionRequestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationBulkSubscriptionRequestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationBulkSubscriptionRequestType(value) + return nil +} + +// NewSampleLogGenerationBulkSubscriptionRequestTypeFromValue returns a pointer to a valid SampleLogGenerationBulkSubscriptionRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationBulkSubscriptionRequestTypeFromValue(v string) (*SampleLogGenerationBulkSubscriptionRequestType, error) { + ev := SampleLogGenerationBulkSubscriptionRequestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationBulkSubscriptionRequestType: valid values are %v", v, allowedSampleLogGenerationBulkSubscriptionRequestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationBulkSubscriptionRequestType) IsValid() bool { + for _, existing := range allowedSampleLogGenerationBulkSubscriptionRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationBulkSubscriptionRequestType value. +func (v SampleLogGenerationBulkSubscriptionRequestType) Ptr() *SampleLogGenerationBulkSubscriptionRequestType { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_response.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_response.go new file mode 100644 index 00000000000..464c28690df --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionResponse Response containing the per-content-pack results of a bulk subscription request. +type SampleLogGenerationBulkSubscriptionResponse struct { + // The list of bulk subscription results, one per requested content pack. + Data []SampleLogGenerationBulkSubscriptionResultItem `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionResponse instantiates a new SampleLogGenerationBulkSubscriptionResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionResponse(data []SampleLogGenerationBulkSubscriptionResultItem) *SampleLogGenerationBulkSubscriptionResponse { + this := SampleLogGenerationBulkSubscriptionResponse{} + this.Data = data + return &this +} + +// NewSampleLogGenerationBulkSubscriptionResponseWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionResponseWithDefaults() *SampleLogGenerationBulkSubscriptionResponse { + this := SampleLogGenerationBulkSubscriptionResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SampleLogGenerationBulkSubscriptionResponse) GetData() []SampleLogGenerationBulkSubscriptionResultItem { + if o == nil { + var ret []SampleLogGenerationBulkSubscriptionResultItem + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionResponse) GetDataOk() (*[]SampleLogGenerationBulkSubscriptionResultItem, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SampleLogGenerationBulkSubscriptionResponse) SetData(v []SampleLogGenerationBulkSubscriptionResultItem) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]SampleLogGenerationBulkSubscriptionResultItem `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_bulk_subscription_result_item.go b/api/datadogV2/model_sample_log_generation_bulk_subscription_result_item.go new file mode 100644 index 00000000000..7dc7a3c2195 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_bulk_subscription_result_item.go @@ -0,0 +1,215 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationBulkSubscriptionResultItem A single result entry returned by the bulk subscription endpoint. +type SampleLogGenerationBulkSubscriptionResultItem struct { + // The attributes describing a sample log generation subscription. + Attributes SampleLogGenerationSubscriptionAttributes `json:"attributes"` + // The unique identifier of the subscription, when one was created. + Id string `json:"id"` + // Per-item status returned for a bulk subscription request. + Meta SampleLogGenerationBulkSubscriptionItemMeta `json:"meta"` + // The type of the resource. The value should always be `subscriptions`. + Type SampleLogGenerationSubscriptionResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationBulkSubscriptionResultItem instantiates a new SampleLogGenerationBulkSubscriptionResultItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationBulkSubscriptionResultItem(attributes SampleLogGenerationSubscriptionAttributes, id string, meta SampleLogGenerationBulkSubscriptionItemMeta, typeVar SampleLogGenerationSubscriptionResourceType) *SampleLogGenerationBulkSubscriptionResultItem { + this := SampleLogGenerationBulkSubscriptionResultItem{} + this.Attributes = attributes + this.Id = id + this.Meta = meta + this.Type = typeVar + return &this +} + +// NewSampleLogGenerationBulkSubscriptionResultItemWithDefaults instantiates a new SampleLogGenerationBulkSubscriptionResultItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationBulkSubscriptionResultItemWithDefaults() *SampleLogGenerationBulkSubscriptionResultItem { + this := SampleLogGenerationBulkSubscriptionResultItem{} + var typeVar SampleLogGenerationSubscriptionResourceType = SAMPLELOGGENERATIONSUBSCRIPTIONRESOURCETYPE_SUBSCRIPTIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetAttributes() SampleLogGenerationSubscriptionAttributes { + if o == nil { + var ret SampleLogGenerationSubscriptionAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetAttributesOk() (*SampleLogGenerationSubscriptionAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) SetAttributes(v SampleLogGenerationSubscriptionAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) SetId(v string) { + o.Id = v +} + +// GetMeta returns the Meta field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetMeta() SampleLogGenerationBulkSubscriptionItemMeta { + if o == nil { + var ret SampleLogGenerationBulkSubscriptionItemMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetMetaOk() (*SampleLogGenerationBulkSubscriptionItemMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) SetMeta(v SampleLogGenerationBulkSubscriptionItemMeta) { + o.Meta = v +} + +// GetType returns the Type field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetType() SampleLogGenerationSubscriptionResourceType { + if o == nil { + var ret SampleLogGenerationSubscriptionResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationBulkSubscriptionResultItem) GetTypeOk() (*SampleLogGenerationSubscriptionResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SampleLogGenerationBulkSubscriptionResultItem) SetType(v SampleLogGenerationSubscriptionResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationBulkSubscriptionResultItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["meta"] = o.Meta + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationBulkSubscriptionResultItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SampleLogGenerationSubscriptionAttributes `json:"attributes"` + Id *string `json:"id"` + Meta *SampleLogGenerationBulkSubscriptionItemMeta `json:"meta"` + Type *SampleLogGenerationSubscriptionResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_duration.go b/api/datadogV2/model_sample_log_generation_duration.go new file mode 100644 index 00000000000..c2cd6112940 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_duration.go @@ -0,0 +1,70 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationDuration How long the subscription should remain active before expiring. +type SampleLogGenerationDuration string + +// List of SampleLogGenerationDuration. +const ( + SAMPLELOGGENERATIONDURATION_ONE_HOUR SampleLogGenerationDuration = "1h" + SAMPLELOGGENERATIONDURATION_ONE_DAY SampleLogGenerationDuration = "1d" + SAMPLELOGGENERATIONDURATION_THREE_DAYS SampleLogGenerationDuration = "3d" + SAMPLELOGGENERATIONDURATION_SEVEN_DAYS SampleLogGenerationDuration = "7d" +) + +var allowedSampleLogGenerationDurationEnumValues = []SampleLogGenerationDuration{ + SAMPLELOGGENERATIONDURATION_ONE_HOUR, + SAMPLELOGGENERATIONDURATION_ONE_DAY, + SAMPLELOGGENERATIONDURATION_THREE_DAYS, + SAMPLELOGGENERATIONDURATION_SEVEN_DAYS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationDuration) GetAllowedValues() []SampleLogGenerationDuration { + return allowedSampleLogGenerationDurationEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationDuration) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationDuration(value) + return nil +} + +// NewSampleLogGenerationDurationFromValue returns a pointer to a valid SampleLogGenerationDuration +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationDurationFromValue(v string) (*SampleLogGenerationDuration, error) { + ev := SampleLogGenerationDuration(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationDuration: valid values are %v", v, allowedSampleLogGenerationDurationEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationDuration) IsValid() bool { + for _, existing := range allowedSampleLogGenerationDurationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationDuration value. +func (v SampleLogGenerationDuration) Ptr() *SampleLogGenerationDuration { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_attributes.go b/api/datadogV2/model_sample_log_generation_subscription_attributes.go new file mode 100644 index 00000000000..9fd169820ec --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_attributes.go @@ -0,0 +1,248 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionAttributes The attributes describing a sample log generation subscription. +type SampleLogGenerationSubscriptionAttributes struct { + // The identifier of the Cloud SIEM content pack the subscription targets. + ContentPackId string `json:"content_pack_id"` + // The time at which the subscription was created. + CreatedAt time.Time `json:"created_at"` + // The time at which the subscription expires and stops generating logs. + ExpiresAt time.Time `json:"expires_at"` + // Whether the subscription is currently active and generating logs. + IsActive bool `json:"is_active"` + // The status of the subscription. + Status SampleLogGenerationSubscriptionStatus `json:"status"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionAttributes instantiates a new SampleLogGenerationSubscriptionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionAttributes(contentPackId string, createdAt time.Time, expiresAt time.Time, isActive bool, status SampleLogGenerationSubscriptionStatus) *SampleLogGenerationSubscriptionAttributes { + this := SampleLogGenerationSubscriptionAttributes{} + this.ContentPackId = contentPackId + this.CreatedAt = createdAt + this.ExpiresAt = expiresAt + this.IsActive = isActive + this.Status = status + return &this +} + +// NewSampleLogGenerationSubscriptionAttributesWithDefaults instantiates a new SampleLogGenerationSubscriptionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionAttributesWithDefaults() *SampleLogGenerationSubscriptionAttributes { + this := SampleLogGenerationSubscriptionAttributes{} + return &this +} + +// GetContentPackId returns the ContentPackId field value. +func (o *SampleLogGenerationSubscriptionAttributes) GetContentPackId() string { + if o == nil { + var ret string + return ret + } + return o.ContentPackId +} + +// GetContentPackIdOk returns a tuple with the ContentPackId field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionAttributes) GetContentPackIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentPackId, true +} + +// SetContentPackId sets field value. +func (o *SampleLogGenerationSubscriptionAttributes) SetContentPackId(v string) { + o.ContentPackId = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *SampleLogGenerationSubscriptionAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *SampleLogGenerationSubscriptionAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetExpiresAt returns the ExpiresAt field value. +func (o *SampleLogGenerationSubscriptionAttributes) GetExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionAttributes) GetExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ExpiresAt, true +} + +// SetExpiresAt sets field value. +func (o *SampleLogGenerationSubscriptionAttributes) SetExpiresAt(v time.Time) { + o.ExpiresAt = v +} + +// GetIsActive returns the IsActive field value. +func (o *SampleLogGenerationSubscriptionAttributes) GetIsActive() bool { + if o == nil { + var ret bool + return ret + } + return o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionAttributes) GetIsActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsActive, true +} + +// SetIsActive sets field value. +func (o *SampleLogGenerationSubscriptionAttributes) SetIsActive(v bool) { + o.IsActive = v +} + +// GetStatus returns the Status field value. +func (o *SampleLogGenerationSubscriptionAttributes) GetStatus() SampleLogGenerationSubscriptionStatus { + if o == nil { + var ret SampleLogGenerationSubscriptionStatus + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionAttributes) GetStatusOk() (*SampleLogGenerationSubscriptionStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *SampleLogGenerationSubscriptionAttributes) SetStatus(v SampleLogGenerationSubscriptionStatus) { + o.Status = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["content_pack_id"] = o.ContentPackId + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.ExpiresAt.Nanosecond() == 0 { + toSerialize["expires_at"] = o.ExpiresAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["expires_at"] = o.ExpiresAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["is_active"] = o.IsActive + toSerialize["status"] = o.Status + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentPackId *string `json:"content_pack_id"` + CreatedAt *time.Time `json:"created_at"` + ExpiresAt *time.Time `json:"expires_at"` + IsActive *bool `json:"is_active"` + Status *SampleLogGenerationSubscriptionStatus `json:"status"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ContentPackId == nil { + return fmt.Errorf("required field content_pack_id missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.ExpiresAt == nil { + return fmt.Errorf("required field expires_at missing") + } + if all.IsActive == nil { + return fmt.Errorf("required field is_active missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_pack_id", "created_at", "expires_at", "is_active", "status"}) + } else { + return err + } + + hasInvalidField := false + o.ContentPackId = *all.ContentPackId + o.CreatedAt = *all.CreatedAt + o.ExpiresAt = *all.ExpiresAt + o.IsActive = *all.IsActive + if !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = *all.Status + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_create_attributes.go b/api/datadogV2/model_sample_log_generation_subscription_create_attributes.go new file mode 100644 index 00000000000..1984d53887b --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_create_attributes.go @@ -0,0 +1,150 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionCreateAttributes The attributes for creating a sample log generation subscription. +type SampleLogGenerationSubscriptionCreateAttributes struct { + // The identifier of the Cloud SIEM content pack to subscribe to. + ContentPackId string `json:"content_pack_id"` + // How long the subscription should remain active before expiring. + Duration *SampleLogGenerationDuration `json:"duration,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionCreateAttributes instantiates a new SampleLogGenerationSubscriptionCreateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionCreateAttributes(contentPackId string) *SampleLogGenerationSubscriptionCreateAttributes { + this := SampleLogGenerationSubscriptionCreateAttributes{} + this.ContentPackId = contentPackId + var duration SampleLogGenerationDuration = SAMPLELOGGENERATIONDURATION_THREE_DAYS + this.Duration = &duration + return &this +} + +// NewSampleLogGenerationSubscriptionCreateAttributesWithDefaults instantiates a new SampleLogGenerationSubscriptionCreateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionCreateAttributesWithDefaults() *SampleLogGenerationSubscriptionCreateAttributes { + this := SampleLogGenerationSubscriptionCreateAttributes{} + var duration SampleLogGenerationDuration = SAMPLELOGGENERATIONDURATION_THREE_DAYS + this.Duration = &duration + return &this +} + +// GetContentPackId returns the ContentPackId field value. +func (o *SampleLogGenerationSubscriptionCreateAttributes) GetContentPackId() string { + if o == nil { + var ret string + return ret + } + return o.ContentPackId +} + +// GetContentPackIdOk returns a tuple with the ContentPackId field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionCreateAttributes) GetContentPackIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentPackId, true +} + +// SetContentPackId sets field value. +func (o *SampleLogGenerationSubscriptionCreateAttributes) SetContentPackId(v string) { + o.ContentPackId = v +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SampleLogGenerationSubscriptionCreateAttributes) GetDuration() SampleLogGenerationDuration { + if o == nil || o.Duration == nil { + var ret SampleLogGenerationDuration + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionCreateAttributes) GetDurationOk() (*SampleLogGenerationDuration, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SampleLogGenerationSubscriptionCreateAttributes) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given SampleLogGenerationDuration and assigns it to the Duration field. +func (o *SampleLogGenerationSubscriptionCreateAttributes) SetDuration(v SampleLogGenerationDuration) { + o.Duration = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionCreateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["content_pack_id"] = o.ContentPackId + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentPackId *string `json:"content_pack_id"` + Duration *SampleLogGenerationDuration `json:"duration,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ContentPackId == nil { + return fmt.Errorf("required field content_pack_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_pack_id", "duration"}) + } else { + return err + } + + hasInvalidField := false + o.ContentPackId = *all.ContentPackId + if all.Duration != nil && !all.Duration.IsValid() { + hasInvalidField = true + } else { + o.Duration = all.Duration + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_create_data.go b/api/datadogV2/model_sample_log_generation_subscription_create_data.go new file mode 100644 index 00000000000..e9a035ca034 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_create_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionCreateData The subscription request body. +type SampleLogGenerationSubscriptionCreateData struct { + // The attributes for creating a sample log generation subscription. + Attributes SampleLogGenerationSubscriptionCreateAttributes `json:"attributes"` + // The type of the resource. The value should always be `subscription_requests`. + Type SampleLogGenerationSubscriptionRequestType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionCreateData instantiates a new SampleLogGenerationSubscriptionCreateData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionCreateData(attributes SampleLogGenerationSubscriptionCreateAttributes, typeVar SampleLogGenerationSubscriptionRequestType) *SampleLogGenerationSubscriptionCreateData { + this := SampleLogGenerationSubscriptionCreateData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewSampleLogGenerationSubscriptionCreateDataWithDefaults instantiates a new SampleLogGenerationSubscriptionCreateData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionCreateDataWithDefaults() *SampleLogGenerationSubscriptionCreateData { + this := SampleLogGenerationSubscriptionCreateData{} + var typeVar SampleLogGenerationSubscriptionRequestType = SAMPLELOGGENERATIONSUBSCRIPTIONREQUESTTYPE_SUBSCRIPTION_REQUESTS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SampleLogGenerationSubscriptionCreateData) GetAttributes() SampleLogGenerationSubscriptionCreateAttributes { + if o == nil { + var ret SampleLogGenerationSubscriptionCreateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionCreateData) GetAttributesOk() (*SampleLogGenerationSubscriptionCreateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SampleLogGenerationSubscriptionCreateData) SetAttributes(v SampleLogGenerationSubscriptionCreateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *SampleLogGenerationSubscriptionCreateData) GetType() SampleLogGenerationSubscriptionRequestType { + if o == nil { + var ret SampleLogGenerationSubscriptionRequestType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionCreateData) GetTypeOk() (*SampleLogGenerationSubscriptionRequestType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SampleLogGenerationSubscriptionCreateData) SetType(v SampleLogGenerationSubscriptionRequestType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionCreateData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionCreateData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SampleLogGenerationSubscriptionCreateAttributes `json:"attributes"` + Type *SampleLogGenerationSubscriptionRequestType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_create_request.go b/api/datadogV2/model_sample_log_generation_subscription_create_request.go new file mode 100644 index 00000000000..962821ce689 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionCreateRequest Request body to create a sample log generation subscription for a single content pack. +type SampleLogGenerationSubscriptionCreateRequest struct { + // The subscription request body. + Data SampleLogGenerationSubscriptionCreateData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionCreateRequest instantiates a new SampleLogGenerationSubscriptionCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionCreateRequest(data SampleLogGenerationSubscriptionCreateData) *SampleLogGenerationSubscriptionCreateRequest { + this := SampleLogGenerationSubscriptionCreateRequest{} + this.Data = data + return &this +} + +// NewSampleLogGenerationSubscriptionCreateRequestWithDefaults instantiates a new SampleLogGenerationSubscriptionCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionCreateRequestWithDefaults() *SampleLogGenerationSubscriptionCreateRequest { + this := SampleLogGenerationSubscriptionCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *SampleLogGenerationSubscriptionCreateRequest) GetData() SampleLogGenerationSubscriptionCreateData { + if o == nil { + var ret SampleLogGenerationSubscriptionCreateData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionCreateRequest) GetDataOk() (*SampleLogGenerationSubscriptionCreateData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SampleLogGenerationSubscriptionCreateRequest) SetData(v SampleLogGenerationSubscriptionCreateData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SampleLogGenerationSubscriptionCreateData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_data.go b/api/datadogV2/model_sample_log_generation_subscription_data.go new file mode 100644 index 00000000000..e02aac9b6ca --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionData A sample log generation subscription. +type SampleLogGenerationSubscriptionData struct { + // The attributes describing a sample log generation subscription. + Attributes SampleLogGenerationSubscriptionAttributes `json:"attributes"` + // The unique identifier of the subscription. + Id string `json:"id"` + // The type of the resource. The value should always be `subscriptions`. + Type SampleLogGenerationSubscriptionResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionData instantiates a new SampleLogGenerationSubscriptionData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionData(attributes SampleLogGenerationSubscriptionAttributes, id string, typeVar SampleLogGenerationSubscriptionResourceType) *SampleLogGenerationSubscriptionData { + this := SampleLogGenerationSubscriptionData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewSampleLogGenerationSubscriptionDataWithDefaults instantiates a new SampleLogGenerationSubscriptionData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionDataWithDefaults() *SampleLogGenerationSubscriptionData { + this := SampleLogGenerationSubscriptionData{} + var typeVar SampleLogGenerationSubscriptionResourceType = SAMPLELOGGENERATIONSUBSCRIPTIONRESOURCETYPE_SUBSCRIPTIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SampleLogGenerationSubscriptionData) GetAttributes() SampleLogGenerationSubscriptionAttributes { + if o == nil { + var ret SampleLogGenerationSubscriptionAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionData) GetAttributesOk() (*SampleLogGenerationSubscriptionAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SampleLogGenerationSubscriptionData) SetAttributes(v SampleLogGenerationSubscriptionAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *SampleLogGenerationSubscriptionData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SampleLogGenerationSubscriptionData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *SampleLogGenerationSubscriptionData) GetType() SampleLogGenerationSubscriptionResourceType { + if o == nil { + var ret SampleLogGenerationSubscriptionResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionData) GetTypeOk() (*SampleLogGenerationSubscriptionResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SampleLogGenerationSubscriptionData) SetType(v SampleLogGenerationSubscriptionResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SampleLogGenerationSubscriptionAttributes `json:"attributes"` + Id *string `json:"id"` + Type *SampleLogGenerationSubscriptionResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_request_type.go b/api/datadogV2/model_sample_log_generation_subscription_request_type.go new file mode 100644 index 00000000000..d9b27de15ca --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_request_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionRequestType The type of the resource. The value should always be `subscription_requests`. +type SampleLogGenerationSubscriptionRequestType string + +// List of SampleLogGenerationSubscriptionRequestType. +const ( + SAMPLELOGGENERATIONSUBSCRIPTIONREQUESTTYPE_SUBSCRIPTION_REQUESTS SampleLogGenerationSubscriptionRequestType = "subscription_requests" +) + +var allowedSampleLogGenerationSubscriptionRequestTypeEnumValues = []SampleLogGenerationSubscriptionRequestType{ + SAMPLELOGGENERATIONSUBSCRIPTIONREQUESTTYPE_SUBSCRIPTION_REQUESTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationSubscriptionRequestType) GetAllowedValues() []SampleLogGenerationSubscriptionRequestType { + return allowedSampleLogGenerationSubscriptionRequestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationSubscriptionRequestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationSubscriptionRequestType(value) + return nil +} + +// NewSampleLogGenerationSubscriptionRequestTypeFromValue returns a pointer to a valid SampleLogGenerationSubscriptionRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationSubscriptionRequestTypeFromValue(v string) (*SampleLogGenerationSubscriptionRequestType, error) { + ev := SampleLogGenerationSubscriptionRequestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationSubscriptionRequestType: valid values are %v", v, allowedSampleLogGenerationSubscriptionRequestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationSubscriptionRequestType) IsValid() bool { + for _, existing := range allowedSampleLogGenerationSubscriptionRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationSubscriptionRequestType value. +func (v SampleLogGenerationSubscriptionRequestType) Ptr() *SampleLogGenerationSubscriptionRequestType { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_resource_type.go b/api/datadogV2/model_sample_log_generation_subscription_resource_type.go new file mode 100644 index 00000000000..5ae4df9f97c --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionResourceType The type of the resource. The value should always be `subscriptions`. +type SampleLogGenerationSubscriptionResourceType string + +// List of SampleLogGenerationSubscriptionResourceType. +const ( + SAMPLELOGGENERATIONSUBSCRIPTIONRESOURCETYPE_SUBSCRIPTIONS SampleLogGenerationSubscriptionResourceType = "subscriptions" +) + +var allowedSampleLogGenerationSubscriptionResourceTypeEnumValues = []SampleLogGenerationSubscriptionResourceType{ + SAMPLELOGGENERATIONSUBSCRIPTIONRESOURCETYPE_SUBSCRIPTIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationSubscriptionResourceType) GetAllowedValues() []SampleLogGenerationSubscriptionResourceType { + return allowedSampleLogGenerationSubscriptionResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationSubscriptionResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationSubscriptionResourceType(value) + return nil +} + +// NewSampleLogGenerationSubscriptionResourceTypeFromValue returns a pointer to a valid SampleLogGenerationSubscriptionResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationSubscriptionResourceTypeFromValue(v string) (*SampleLogGenerationSubscriptionResourceType, error) { + ev := SampleLogGenerationSubscriptionResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationSubscriptionResourceType: valid values are %v", v, allowedSampleLogGenerationSubscriptionResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationSubscriptionResourceType) IsValid() bool { + for _, existing := range allowedSampleLogGenerationSubscriptionResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationSubscriptionResourceType value. +func (v SampleLogGenerationSubscriptionResourceType) Ptr() *SampleLogGenerationSubscriptionResourceType { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_response.go b/api/datadogV2/model_sample_log_generation_subscription_response.go new file mode 100644 index 00000000000..229c3824d5d --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionResponse Response containing a single sample log generation subscription. +type SampleLogGenerationSubscriptionResponse struct { + // A sample log generation subscription. + Data SampleLogGenerationSubscriptionData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionResponse instantiates a new SampleLogGenerationSubscriptionResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionResponse(data SampleLogGenerationSubscriptionData) *SampleLogGenerationSubscriptionResponse { + this := SampleLogGenerationSubscriptionResponse{} + this.Data = data + return &this +} + +// NewSampleLogGenerationSubscriptionResponseWithDefaults instantiates a new SampleLogGenerationSubscriptionResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionResponseWithDefaults() *SampleLogGenerationSubscriptionResponse { + this := SampleLogGenerationSubscriptionResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SampleLogGenerationSubscriptionResponse) GetData() SampleLogGenerationSubscriptionData { + if o == nil { + var ret SampleLogGenerationSubscriptionData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionResponse) GetDataOk() (*SampleLogGenerationSubscriptionData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SampleLogGenerationSubscriptionResponse) SetData(v SampleLogGenerationSubscriptionData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SampleLogGenerationSubscriptionData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscription_status.go b/api/datadogV2/model_sample_log_generation_subscription_status.go new file mode 100644 index 00000000000..95211cd1478 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscription_status.go @@ -0,0 +1,76 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionStatus The status of the subscription. +type SampleLogGenerationSubscriptionStatus string + +// List of SampleLogGenerationSubscriptionStatus. +const ( + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_SUBSCRIBED SampleLogGenerationSubscriptionStatus = "subscribed" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_RENEWED SampleLogGenerationSubscriptionStatus = "renewed" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_UNSUBSCRIBED SampleLogGenerationSubscriptionStatus = "unsubscribed" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_NO_ACTIVE_SUBSCRIPTION SampleLogGenerationSubscriptionStatus = "no_active_subscription" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_NOT_AVAILABLE SampleLogGenerationSubscriptionStatus = "not_available" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_ACTIVE SampleLogGenerationSubscriptionStatus = "active" + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_EXPIRED SampleLogGenerationSubscriptionStatus = "expired" +) + +var allowedSampleLogGenerationSubscriptionStatusEnumValues = []SampleLogGenerationSubscriptionStatus{ + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_SUBSCRIBED, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_RENEWED, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_UNSUBSCRIBED, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_NO_ACTIVE_SUBSCRIPTION, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_NOT_AVAILABLE, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_ACTIVE, + SAMPLELOGGENERATIONSUBSCRIPTIONSTATUS_EXPIRED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationSubscriptionStatus) GetAllowedValues() []SampleLogGenerationSubscriptionStatus { + return allowedSampleLogGenerationSubscriptionStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationSubscriptionStatus) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationSubscriptionStatus(value) + return nil +} + +// NewSampleLogGenerationSubscriptionStatusFromValue returns a pointer to a valid SampleLogGenerationSubscriptionStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationSubscriptionStatusFromValue(v string) (*SampleLogGenerationSubscriptionStatus, error) { + ev := SampleLogGenerationSubscriptionStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationSubscriptionStatus: valid values are %v", v, allowedSampleLogGenerationSubscriptionStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationSubscriptionStatus) IsValid() bool { + for _, existing := range allowedSampleLogGenerationSubscriptionStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationSubscriptionStatus value. +func (v SampleLogGenerationSubscriptionStatus) Ptr() *SampleLogGenerationSubscriptionStatus { + return &v +} diff --git a/api/datadogV2/model_sample_log_generation_subscriptions_response.go b/api/datadogV2/model_sample_log_generation_subscriptions_response.go new file mode 100644 index 00000000000..ce158d6f54b --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscriptions_response.go @@ -0,0 +1,142 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionsResponse Response containing a list of sample log generation subscriptions. +type SampleLogGenerationSubscriptionsResponse struct { + // The list of sample log generation subscriptions. + Data []SampleLogGenerationSubscriptionData `json:"data"` + // Metadata returned alongside a list of sample log generation subscriptions. + Meta SampleLogGenerationSubscriptionsResponseMeta `json:"meta"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionsResponse instantiates a new SampleLogGenerationSubscriptionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionsResponse(data []SampleLogGenerationSubscriptionData, meta SampleLogGenerationSubscriptionsResponseMeta) *SampleLogGenerationSubscriptionsResponse { + this := SampleLogGenerationSubscriptionsResponse{} + this.Data = data + this.Meta = meta + return &this +} + +// NewSampleLogGenerationSubscriptionsResponseWithDefaults instantiates a new SampleLogGenerationSubscriptionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionsResponseWithDefaults() *SampleLogGenerationSubscriptionsResponse { + this := SampleLogGenerationSubscriptionsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SampleLogGenerationSubscriptionsResponse) GetData() []SampleLogGenerationSubscriptionData { + if o == nil { + var ret []SampleLogGenerationSubscriptionData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionsResponse) GetDataOk() (*[]SampleLogGenerationSubscriptionData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SampleLogGenerationSubscriptionsResponse) SetData(v []SampleLogGenerationSubscriptionData) { + o.Data = v +} + +// GetMeta returns the Meta field value. +func (o *SampleLogGenerationSubscriptionsResponse) GetMeta() SampleLogGenerationSubscriptionsResponseMeta { + if o == nil { + var ret SampleLogGenerationSubscriptionsResponseMeta + return ret + } + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionsResponse) GetMetaOk() (*SampleLogGenerationSubscriptionsResponseMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value. +func (o *SampleLogGenerationSubscriptionsResponse) SetMeta(v SampleLogGenerationSubscriptionsResponseMeta) { + o.Meta = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]SampleLogGenerationSubscriptionData `json:"data"` + Meta *SampleLogGenerationSubscriptionsResponseMeta `json:"meta"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + if all.Meta == nil { + return fmt.Errorf("required field meta missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = *all.Data + if all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = *all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscriptions_response_meta.go b/api/datadogV2/model_sample_log_generation_subscriptions_response_meta.go new file mode 100644 index 00000000000..4c176943e70 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscriptions_response_meta.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionsResponseMeta Metadata returned alongside a list of sample log generation subscriptions. +type SampleLogGenerationSubscriptionsResponseMeta struct { + // The total number of subscriptions matching the request, irrespective of pagination. + TotalSubscriptions int32 `json:"total_subscriptions"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSampleLogGenerationSubscriptionsResponseMeta instantiates a new SampleLogGenerationSubscriptionsResponseMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSampleLogGenerationSubscriptionsResponseMeta(totalSubscriptions int32) *SampleLogGenerationSubscriptionsResponseMeta { + this := SampleLogGenerationSubscriptionsResponseMeta{} + this.TotalSubscriptions = totalSubscriptions + return &this +} + +// NewSampleLogGenerationSubscriptionsResponseMetaWithDefaults instantiates a new SampleLogGenerationSubscriptionsResponseMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSampleLogGenerationSubscriptionsResponseMetaWithDefaults() *SampleLogGenerationSubscriptionsResponseMeta { + this := SampleLogGenerationSubscriptionsResponseMeta{} + return &this +} + +// GetTotalSubscriptions returns the TotalSubscriptions field value. +func (o *SampleLogGenerationSubscriptionsResponseMeta) GetTotalSubscriptions() int32 { + if o == nil { + var ret int32 + return ret + } + return o.TotalSubscriptions +} + +// GetTotalSubscriptionsOk returns a tuple with the TotalSubscriptions field value +// and a boolean to check if the value has been set. +func (o *SampleLogGenerationSubscriptionsResponseMeta) GetTotalSubscriptionsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalSubscriptions, true +} + +// SetTotalSubscriptions sets field value. +func (o *SampleLogGenerationSubscriptionsResponseMeta) SetTotalSubscriptions(v int32) { + o.TotalSubscriptions = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SampleLogGenerationSubscriptionsResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["total_subscriptions"] = o.TotalSubscriptions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SampleLogGenerationSubscriptionsResponseMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + TotalSubscriptions *int32 `json:"total_subscriptions"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.TotalSubscriptions == nil { + return fmt.Errorf("required field total_subscriptions missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"total_subscriptions"}) + } else { + return err + } + o.TotalSubscriptions = *all.TotalSubscriptions + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_sample_log_generation_subscriptions_status_filter.go b/api/datadogV2/model_sample_log_generation_subscriptions_status_filter.go new file mode 100644 index 00000000000..0f040b1c4a3 --- /dev/null +++ b/api/datadogV2/model_sample_log_generation_subscriptions_status_filter.go @@ -0,0 +1,66 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SampleLogGenerationSubscriptionsStatusFilter Filter that controls whether to return only active subscriptions or every subscription on record. +type SampleLogGenerationSubscriptionsStatusFilter string + +// List of SampleLogGenerationSubscriptionsStatusFilter. +const ( + SAMPLELOGGENERATIONSUBSCRIPTIONSSTATUSFILTER_ACTIVE SampleLogGenerationSubscriptionsStatusFilter = "active" + SAMPLELOGGENERATIONSUBSCRIPTIONSSTATUSFILTER_ALL SampleLogGenerationSubscriptionsStatusFilter = "all" +) + +var allowedSampleLogGenerationSubscriptionsStatusFilterEnumValues = []SampleLogGenerationSubscriptionsStatusFilter{ + SAMPLELOGGENERATIONSUBSCRIPTIONSSTATUSFILTER_ACTIVE, + SAMPLELOGGENERATIONSUBSCRIPTIONSSTATUSFILTER_ALL, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SampleLogGenerationSubscriptionsStatusFilter) GetAllowedValues() []SampleLogGenerationSubscriptionsStatusFilter { + return allowedSampleLogGenerationSubscriptionsStatusFilterEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SampleLogGenerationSubscriptionsStatusFilter) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SampleLogGenerationSubscriptionsStatusFilter(value) + return nil +} + +// NewSampleLogGenerationSubscriptionsStatusFilterFromValue returns a pointer to a valid SampleLogGenerationSubscriptionsStatusFilter +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSampleLogGenerationSubscriptionsStatusFilterFromValue(v string) (*SampleLogGenerationSubscriptionsStatusFilter, error) { + ev := SampleLogGenerationSubscriptionsStatusFilter(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SampleLogGenerationSubscriptionsStatusFilter: valid values are %v", v, allowedSampleLogGenerationSubscriptionsStatusFilterEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SampleLogGenerationSubscriptionsStatusFilter) IsValid() bool { + for _, existing := range allowedSampleLogGenerationSubscriptionsStatusFilterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SampleLogGenerationSubscriptionsStatusFilter value. +func (v SampleLogGenerationSubscriptionsStatusFilter) Ptr() *SampleLogGenerationSubscriptionsStatusFilter { + return &v +} diff --git a/api/datadogV2/model_scorecard_score_attributes.go b/api/datadogV2/model_scorecard_score_attributes.go new file mode 100644 index 00000000000..d08f76a2478 --- /dev/null +++ b/api/datadogV2/model_scorecard_score_attributes.go @@ -0,0 +1,427 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreAttributes Attributes of a scorecard score. +type ScorecardScoreAttributes struct { + // Dimension to group scores by. + Aggregation *ScorecardScoresAggregation `json:"aggregation,omitempty"` + // The denominator used to compute the score ratio. + Denominator *int64 `json:"denominator,omitempty"` + // The maturity level of the associated rule. + Level *int64 `json:"level,omitempty"` + // The numerator used to compute the score ratio. + Numerator *int64 `json:"numerator,omitempty"` + // The computed score ratio (numerator/denominator), from 0 to 1. + Score *float64 `json:"score,omitempty"` + // The total number of entities evaluated. + TotalEntities *int64 `json:"total_entities,omitempty"` + // The number of rules that failed. + TotalFail *int64 `json:"total_fail,omitempty"` + // The number of rules with no data. + TotalNoData *int64 `json:"total_no_data,omitempty"` + // The number of rules that passed. + TotalPass *int64 `json:"total_pass,omitempty"` + // The number of rules that were skipped. + TotalSkip *int64 `json:"total_skip,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScorecardScoreAttributes instantiates a new ScorecardScoreAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScorecardScoreAttributes() *ScorecardScoreAttributes { + this := ScorecardScoreAttributes{} + return &this +} + +// NewScorecardScoreAttributesWithDefaults instantiates a new ScorecardScoreAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScorecardScoreAttributesWithDefaults() *ScorecardScoreAttributes { + this := ScorecardScoreAttributes{} + return &this +} + +// GetAggregation returns the Aggregation field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetAggregation() ScorecardScoresAggregation { + if o == nil || o.Aggregation == nil { + var ret ScorecardScoresAggregation + return ret + } + return *o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetAggregationOk() (*ScorecardScoresAggregation, bool) { + if o == nil || o.Aggregation == nil { + return nil, false + } + return o.Aggregation, true +} + +// HasAggregation returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasAggregation() bool { + return o != nil && o.Aggregation != nil +} + +// SetAggregation gets a reference to the given ScorecardScoresAggregation and assigns it to the Aggregation field. +func (o *ScorecardScoreAttributes) SetAggregation(v ScorecardScoresAggregation) { + o.Aggregation = &v +} + +// GetDenominator returns the Denominator field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetDenominator() int64 { + if o == nil || o.Denominator == nil { + var ret int64 + return ret + } + return *o.Denominator +} + +// GetDenominatorOk returns a tuple with the Denominator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetDenominatorOk() (*int64, bool) { + if o == nil || o.Denominator == nil { + return nil, false + } + return o.Denominator, true +} + +// HasDenominator returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasDenominator() bool { + return o != nil && o.Denominator != nil +} + +// SetDenominator gets a reference to the given int64 and assigns it to the Denominator field. +func (o *ScorecardScoreAttributes) SetDenominator(v int64) { + o.Denominator = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetLevel() int64 { + if o == nil || o.Level == nil { + var ret int64 + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetLevelOk() (*int64, bool) { + if o == nil || o.Level == nil { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasLevel() bool { + return o != nil && o.Level != nil +} + +// SetLevel gets a reference to the given int64 and assigns it to the Level field. +func (o *ScorecardScoreAttributes) SetLevel(v int64) { + o.Level = &v +} + +// GetNumerator returns the Numerator field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetNumerator() int64 { + if o == nil || o.Numerator == nil { + var ret int64 + return ret + } + return *o.Numerator +} + +// GetNumeratorOk returns a tuple with the Numerator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetNumeratorOk() (*int64, bool) { + if o == nil || o.Numerator == nil { + return nil, false + } + return o.Numerator, true +} + +// HasNumerator returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasNumerator() bool { + return o != nil && o.Numerator != nil +} + +// SetNumerator gets a reference to the given int64 and assigns it to the Numerator field. +func (o *ScorecardScoreAttributes) SetNumerator(v int64) { + o.Numerator = &v +} + +// GetScore returns the Score field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetScore() float64 { + if o == nil || o.Score == nil { + var ret float64 + return ret + } + return *o.Score +} + +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetScoreOk() (*float64, bool) { + if o == nil || o.Score == nil { + return nil, false + } + return o.Score, true +} + +// HasScore returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasScore() bool { + return o != nil && o.Score != nil +} + +// SetScore gets a reference to the given float64 and assigns it to the Score field. +func (o *ScorecardScoreAttributes) SetScore(v float64) { + o.Score = &v +} + +// GetTotalEntities returns the TotalEntities field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetTotalEntities() int64 { + if o == nil || o.TotalEntities == nil { + var ret int64 + return ret + } + return *o.TotalEntities +} + +// GetTotalEntitiesOk returns a tuple with the TotalEntities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetTotalEntitiesOk() (*int64, bool) { + if o == nil || o.TotalEntities == nil { + return nil, false + } + return o.TotalEntities, true +} + +// HasTotalEntities returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasTotalEntities() bool { + return o != nil && o.TotalEntities != nil +} + +// SetTotalEntities gets a reference to the given int64 and assigns it to the TotalEntities field. +func (o *ScorecardScoreAttributes) SetTotalEntities(v int64) { + o.TotalEntities = &v +} + +// GetTotalFail returns the TotalFail field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetTotalFail() int64 { + if o == nil || o.TotalFail == nil { + var ret int64 + return ret + } + return *o.TotalFail +} + +// GetTotalFailOk returns a tuple with the TotalFail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetTotalFailOk() (*int64, bool) { + if o == nil || o.TotalFail == nil { + return nil, false + } + return o.TotalFail, true +} + +// HasTotalFail returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasTotalFail() bool { + return o != nil && o.TotalFail != nil +} + +// SetTotalFail gets a reference to the given int64 and assigns it to the TotalFail field. +func (o *ScorecardScoreAttributes) SetTotalFail(v int64) { + o.TotalFail = &v +} + +// GetTotalNoData returns the TotalNoData field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetTotalNoData() int64 { + if o == nil || o.TotalNoData == nil { + var ret int64 + return ret + } + return *o.TotalNoData +} + +// GetTotalNoDataOk returns a tuple with the TotalNoData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetTotalNoDataOk() (*int64, bool) { + if o == nil || o.TotalNoData == nil { + return nil, false + } + return o.TotalNoData, true +} + +// HasTotalNoData returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasTotalNoData() bool { + return o != nil && o.TotalNoData != nil +} + +// SetTotalNoData gets a reference to the given int64 and assigns it to the TotalNoData field. +func (o *ScorecardScoreAttributes) SetTotalNoData(v int64) { + o.TotalNoData = &v +} + +// GetTotalPass returns the TotalPass field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetTotalPass() int64 { + if o == nil || o.TotalPass == nil { + var ret int64 + return ret + } + return *o.TotalPass +} + +// GetTotalPassOk returns a tuple with the TotalPass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetTotalPassOk() (*int64, bool) { + if o == nil || o.TotalPass == nil { + return nil, false + } + return o.TotalPass, true +} + +// HasTotalPass returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasTotalPass() bool { + return o != nil && o.TotalPass != nil +} + +// SetTotalPass gets a reference to the given int64 and assigns it to the TotalPass field. +func (o *ScorecardScoreAttributes) SetTotalPass(v int64) { + o.TotalPass = &v +} + +// GetTotalSkip returns the TotalSkip field value if set, zero value otherwise. +func (o *ScorecardScoreAttributes) GetTotalSkip() int64 { + if o == nil || o.TotalSkip == nil { + var ret int64 + return ret + } + return *o.TotalSkip +} + +// GetTotalSkipOk returns a tuple with the TotalSkip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreAttributes) GetTotalSkipOk() (*int64, bool) { + if o == nil || o.TotalSkip == nil { + return nil, false + } + return o.TotalSkip, true +} + +// HasTotalSkip returns a boolean if a field has been set. +func (o *ScorecardScoreAttributes) HasTotalSkip() bool { + return o != nil && o.TotalSkip != nil +} + +// SetTotalSkip gets a reference to the given int64 and assigns it to the TotalSkip field. +func (o *ScorecardScoreAttributes) SetTotalSkip(v int64) { + o.TotalSkip = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScorecardScoreAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Aggregation != nil { + toSerialize["aggregation"] = o.Aggregation + } + if o.Denominator != nil { + toSerialize["denominator"] = o.Denominator + } + if o.Level != nil { + toSerialize["level"] = o.Level + } + if o.Numerator != nil { + toSerialize["numerator"] = o.Numerator + } + if o.Score != nil { + toSerialize["score"] = o.Score + } + if o.TotalEntities != nil { + toSerialize["total_entities"] = o.TotalEntities + } + if o.TotalFail != nil { + toSerialize["total_fail"] = o.TotalFail + } + if o.TotalNoData != nil { + toSerialize["total_no_data"] = o.TotalNoData + } + if o.TotalPass != nil { + toSerialize["total_pass"] = o.TotalPass + } + if o.TotalSkip != nil { + toSerialize["total_skip"] = o.TotalSkip + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScorecardScoreAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Aggregation *ScorecardScoresAggregation `json:"aggregation,omitempty"` + Denominator *int64 `json:"denominator,omitempty"` + Level *int64 `json:"level,omitempty"` + Numerator *int64 `json:"numerator,omitempty"` + Score *float64 `json:"score,omitempty"` + TotalEntities *int64 `json:"total_entities,omitempty"` + TotalFail *int64 `json:"total_fail,omitempty"` + TotalNoData *int64 `json:"total_no_data,omitempty"` + TotalPass *int64 `json:"total_pass,omitempty"` + TotalSkip *int64 `json:"total_skip,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"aggregation", "denominator", "level", "numerator", "score", "total_entities", "total_fail", "total_no_data", "total_pass", "total_skip"}) + } else { + return err + } + + hasInvalidField := false + if all.Aggregation != nil && !all.Aggregation.IsValid() { + hasInvalidField = true + } else { + o.Aggregation = all.Aggregation + } + o.Denominator = all.Denominator + o.Level = all.Level + o.Numerator = all.Numerator + o.Score = all.Score + o.TotalEntities = all.TotalEntities + o.TotalFail = all.TotalFail + o.TotalNoData = all.TotalNoData + o.TotalPass = all.TotalPass + o.TotalSkip = all.TotalSkip + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_scorecard_score_data.go b/api/datadogV2/model_scorecard_score_data.go new file mode 100644 index 00000000000..33d2d17edd5 --- /dev/null +++ b/api/datadogV2/model_scorecard_score_data.go @@ -0,0 +1,221 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreData A scorecard score object for a single entity, rule, scorecard, service, or team. +type ScorecardScoreData struct { + // Attributes of a scorecard score. + Attributes *ScorecardScoreAttributes `json:"attributes,omitempty"` + // The ID of the entity or resource being scored. + Id string `json:"id"` + // Relationships for a scorecard score, depending on the aggregation type. + Relationships *ScorecardScoreRelationships `json:"relationships,omitempty"` + // The JSON:API resource type. + Type ScorecardScoreDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScorecardScoreData instantiates a new ScorecardScoreData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScorecardScoreData(id string, typeVar ScorecardScoreDataType) *ScorecardScoreData { + this := ScorecardScoreData{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewScorecardScoreDataWithDefaults instantiates a new ScorecardScoreData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScorecardScoreDataWithDefaults() *ScorecardScoreData { + this := ScorecardScoreData{} + var typeVar ScorecardScoreDataType = SCORECARDSCOREDATATYPE_SCORE + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *ScorecardScoreData) GetAttributes() ScorecardScoreAttributes { + if o == nil || o.Attributes == nil { + var ret ScorecardScoreAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreData) GetAttributesOk() (*ScorecardScoreAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *ScorecardScoreData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given ScorecardScoreAttributes and assigns it to the Attributes field. +func (o *ScorecardScoreData) SetAttributes(v ScorecardScoreAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value. +func (o *ScorecardScoreData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScorecardScoreData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ScorecardScoreData) SetId(v string) { + o.Id = v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *ScorecardScoreData) GetRelationships() ScorecardScoreRelationships { + if o == nil || o.Relationships == nil { + var ret ScorecardScoreRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreData) GetRelationshipsOk() (*ScorecardScoreRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *ScorecardScoreData) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given ScorecardScoreRelationships and assigns it to the Relationships field. +func (o *ScorecardScoreData) SetRelationships(v ScorecardScoreRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value. +func (o *ScorecardScoreData) GetType() ScorecardScoreDataType { + if o == nil { + var ret ScorecardScoreDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ScorecardScoreData) GetTypeOk() (*ScorecardScoreDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ScorecardScoreData) SetType(v ScorecardScoreDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScorecardScoreData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["id"] = o.Id + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScorecardScoreData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ScorecardScoreAttributes `json:"attributes,omitempty"` + Id *string `json:"id"` + Relationships *ScorecardScoreRelationships `json:"relationships,omitempty"` + Type *ScorecardScoreDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = *all.Id + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_scorecard_score_data_type.go b/api/datadogV2/model_scorecard_score_data_type.go new file mode 100644 index 00000000000..f26fd6b7bda --- /dev/null +++ b/api/datadogV2/model_scorecard_score_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreDataType The JSON:API resource type. +type ScorecardScoreDataType string + +// List of ScorecardScoreDataType. +const ( + SCORECARDSCOREDATATYPE_SCORE ScorecardScoreDataType = "score" +) + +var allowedScorecardScoreDataTypeEnumValues = []ScorecardScoreDataType{ + SCORECARDSCOREDATATYPE_SCORE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ScorecardScoreDataType) GetAllowedValues() []ScorecardScoreDataType { + return allowedScorecardScoreDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ScorecardScoreDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ScorecardScoreDataType(value) + return nil +} + +// NewScorecardScoreDataTypeFromValue returns a pointer to a valid ScorecardScoreDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewScorecardScoreDataTypeFromValue(v string) (*ScorecardScoreDataType, error) { + ev := ScorecardScoreDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ScorecardScoreDataType: valid values are %v", v, allowedScorecardScoreDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ScorecardScoreDataType) IsValid() bool { + for _, existing := range allowedScorecardScoreDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ScorecardScoreDataType value. +func (v ScorecardScoreDataType) Ptr() *ScorecardScoreDataType { + return &v +} diff --git a/api/datadogV2/model_scorecard_score_relationship_data.go b/api/datadogV2/model_scorecard_score_relationship_data.go new file mode 100644 index 00000000000..71f28a8b7e8 --- /dev/null +++ b/api/datadogV2/model_scorecard_score_relationship_data.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreRelationshipData A relationship data object for a score. +type ScorecardScoreRelationshipData struct { + // The ID of the related resource. + Id string `json:"id"` + // The type of the related resource. + Type string `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScorecardScoreRelationshipData instantiates a new ScorecardScoreRelationshipData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScorecardScoreRelationshipData(id string, typeVar string) *ScorecardScoreRelationshipData { + this := ScorecardScoreRelationshipData{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewScorecardScoreRelationshipDataWithDefaults instantiates a new ScorecardScoreRelationshipData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScorecardScoreRelationshipDataWithDefaults() *ScorecardScoreRelationshipData { + this := ScorecardScoreRelationshipData{} + return &this +} + +// GetId returns the Id field value. +func (o *ScorecardScoreRelationshipData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationshipData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ScorecardScoreRelationshipData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *ScorecardScoreRelationshipData) GetType() string { + if o == nil { + var ret string + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationshipData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ScorecardScoreRelationshipData) SetType(v string) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScorecardScoreRelationshipData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScorecardScoreRelationshipData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *string `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + o.Id = *all.Id + o.Type = *all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_scorecard_score_relationship_item.go b/api/datadogV2/model_scorecard_score_relationship_item.go new file mode 100644 index 00000000000..00f5cbf7ceb --- /dev/null +++ b/api/datadogV2/model_scorecard_score_relationship_item.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreRelationshipItem A relationship item for a score. +type ScorecardScoreRelationshipItem struct { + // A relationship data object for a score. + Data *ScorecardScoreRelationshipData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScorecardScoreRelationshipItem instantiates a new ScorecardScoreRelationshipItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScorecardScoreRelationshipItem() *ScorecardScoreRelationshipItem { + this := ScorecardScoreRelationshipItem{} + return &this +} + +// NewScorecardScoreRelationshipItemWithDefaults instantiates a new ScorecardScoreRelationshipItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScorecardScoreRelationshipItemWithDefaults() *ScorecardScoreRelationshipItem { + this := ScorecardScoreRelationshipItem{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ScorecardScoreRelationshipItem) GetData() ScorecardScoreRelationshipData { + if o == nil || o.Data == nil { + var ret ScorecardScoreRelationshipData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationshipItem) GetDataOk() (*ScorecardScoreRelationshipData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ScorecardScoreRelationshipItem) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given ScorecardScoreRelationshipData and assigns it to the Data field. +func (o *ScorecardScoreRelationshipItem) SetData(v ScorecardScoreRelationshipData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScorecardScoreRelationshipItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScorecardScoreRelationshipItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ScorecardScoreRelationshipData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_scorecard_score_relationships.go b/api/datadogV2/model_scorecard_score_relationships.go new file mode 100644 index 00000000000..be836ae60ac --- /dev/null +++ b/api/datadogV2/model_scorecard_score_relationships.go @@ -0,0 +1,263 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoreRelationships Relationships for a scorecard score, depending on the aggregation type. +type ScorecardScoreRelationships struct { + // A relationship item for a score. + Entity *ScorecardScoreRelationshipItem `json:"entity,omitempty"` + // A relationship item for a score. + Rule *ScorecardScoreRelationshipItem `json:"rule,omitempty"` + // A relationship item for a score. + Scorecard *ScorecardScoreRelationshipItem `json:"scorecard,omitempty"` + // A relationship item for a score. + Service *ScorecardScoreRelationshipItem `json:"service,omitempty"` + // A relationship item for a score. + Team *ScorecardScoreRelationshipItem `json:"team,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScorecardScoreRelationships instantiates a new ScorecardScoreRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScorecardScoreRelationships() *ScorecardScoreRelationships { + this := ScorecardScoreRelationships{} + return &this +} + +// NewScorecardScoreRelationshipsWithDefaults instantiates a new ScorecardScoreRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScorecardScoreRelationshipsWithDefaults() *ScorecardScoreRelationships { + this := ScorecardScoreRelationships{} + return &this +} + +// GetEntity returns the Entity field value if set, zero value otherwise. +func (o *ScorecardScoreRelationships) GetEntity() ScorecardScoreRelationshipItem { + if o == nil || o.Entity == nil { + var ret ScorecardScoreRelationshipItem + return ret + } + return *o.Entity +} + +// GetEntityOk returns a tuple with the Entity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationships) GetEntityOk() (*ScorecardScoreRelationshipItem, bool) { + if o == nil || o.Entity == nil { + return nil, false + } + return o.Entity, true +} + +// HasEntity returns a boolean if a field has been set. +func (o *ScorecardScoreRelationships) HasEntity() bool { + return o != nil && o.Entity != nil +} + +// SetEntity gets a reference to the given ScorecardScoreRelationshipItem and assigns it to the Entity field. +func (o *ScorecardScoreRelationships) SetEntity(v ScorecardScoreRelationshipItem) { + o.Entity = &v +} + +// GetRule returns the Rule field value if set, zero value otherwise. +func (o *ScorecardScoreRelationships) GetRule() ScorecardScoreRelationshipItem { + if o == nil || o.Rule == nil { + var ret ScorecardScoreRelationshipItem + return ret + } + return *o.Rule +} + +// GetRuleOk returns a tuple with the Rule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationships) GetRuleOk() (*ScorecardScoreRelationshipItem, bool) { + if o == nil || o.Rule == nil { + return nil, false + } + return o.Rule, true +} + +// HasRule returns a boolean if a field has been set. +func (o *ScorecardScoreRelationships) HasRule() bool { + return o != nil && o.Rule != nil +} + +// SetRule gets a reference to the given ScorecardScoreRelationshipItem and assigns it to the Rule field. +func (o *ScorecardScoreRelationships) SetRule(v ScorecardScoreRelationshipItem) { + o.Rule = &v +} + +// GetScorecard returns the Scorecard field value if set, zero value otherwise. +func (o *ScorecardScoreRelationships) GetScorecard() ScorecardScoreRelationshipItem { + if o == nil || o.Scorecard == nil { + var ret ScorecardScoreRelationshipItem + return ret + } + return *o.Scorecard +} + +// GetScorecardOk returns a tuple with the Scorecard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationships) GetScorecardOk() (*ScorecardScoreRelationshipItem, bool) { + if o == nil || o.Scorecard == nil { + return nil, false + } + return o.Scorecard, true +} + +// HasScorecard returns a boolean if a field has been set. +func (o *ScorecardScoreRelationships) HasScorecard() bool { + return o != nil && o.Scorecard != nil +} + +// SetScorecard gets a reference to the given ScorecardScoreRelationshipItem and assigns it to the Scorecard field. +func (o *ScorecardScoreRelationships) SetScorecard(v ScorecardScoreRelationshipItem) { + o.Scorecard = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *ScorecardScoreRelationships) GetService() ScorecardScoreRelationshipItem { + if o == nil || o.Service == nil { + var ret ScorecardScoreRelationshipItem + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationships) GetServiceOk() (*ScorecardScoreRelationshipItem, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *ScorecardScoreRelationships) HasService() bool { + return o != nil && o.Service != nil +} + +// SetService gets a reference to the given ScorecardScoreRelationshipItem and assigns it to the Service field. +func (o *ScorecardScoreRelationships) SetService(v ScorecardScoreRelationshipItem) { + o.Service = &v +} + +// GetTeam returns the Team field value if set, zero value otherwise. +func (o *ScorecardScoreRelationships) GetTeam() ScorecardScoreRelationshipItem { + if o == nil || o.Team == nil { + var ret ScorecardScoreRelationshipItem + return ret + } + return *o.Team +} + +// GetTeamOk returns a tuple with the Team field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScorecardScoreRelationships) GetTeamOk() (*ScorecardScoreRelationshipItem, bool) { + if o == nil || o.Team == nil { + return nil, false + } + return o.Team, true +} + +// HasTeam returns a boolean if a field has been set. +func (o *ScorecardScoreRelationships) HasTeam() bool { + return o != nil && o.Team != nil +} + +// SetTeam gets a reference to the given ScorecardScoreRelationshipItem and assigns it to the Team field. +func (o *ScorecardScoreRelationships) SetTeam(v ScorecardScoreRelationshipItem) { + o.Team = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScorecardScoreRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Entity != nil { + toSerialize["entity"] = o.Entity + } + if o.Rule != nil { + toSerialize["rule"] = o.Rule + } + if o.Scorecard != nil { + toSerialize["scorecard"] = o.Scorecard + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.Team != nil { + toSerialize["team"] = o.Team + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScorecardScoreRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Entity *ScorecardScoreRelationshipItem `json:"entity,omitempty"` + Rule *ScorecardScoreRelationshipItem `json:"rule,omitempty"` + Scorecard *ScorecardScoreRelationshipItem `json:"scorecard,omitempty"` + Service *ScorecardScoreRelationshipItem `json:"service,omitempty"` + Team *ScorecardScoreRelationshipItem `json:"team,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"entity", "rule", "scorecard", "service", "team"}) + } else { + return err + } + + hasInvalidField := false + if all.Entity != nil && all.Entity.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Entity = all.Entity + if all.Rule != nil && all.Rule.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Rule = all.Rule + if all.Scorecard != nil && all.Scorecard.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Scorecard = all.Scorecard + if all.Service != nil && all.Service.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Service = all.Service + if all.Team != nil && all.Team.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Team = all.Team + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_scorecard_scores_aggregation.go b/api/datadogV2/model_scorecard_scores_aggregation.go new file mode 100644 index 00000000000..dfae457e701 --- /dev/null +++ b/api/datadogV2/model_scorecard_scores_aggregation.go @@ -0,0 +1,72 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScorecardScoresAggregation Dimension to group scores by. +type ScorecardScoresAggregation string + +// List of ScorecardScoresAggregation. +const ( + SCORECARDSCORESAGGREGATION_BY_ENTITY ScorecardScoresAggregation = "by-entity" + SCORECARDSCORESAGGREGATION_BY_RULE ScorecardScoresAggregation = "by-rule" + SCORECARDSCORESAGGREGATION_BY_SCORECARD ScorecardScoresAggregation = "by-scorecard" + SCORECARDSCORESAGGREGATION_BY_TEAM ScorecardScoresAggregation = "by-team" + SCORECARDSCORESAGGREGATION_BY_KIND ScorecardScoresAggregation = "by-kind" +) + +var allowedScorecardScoresAggregationEnumValues = []ScorecardScoresAggregation{ + SCORECARDSCORESAGGREGATION_BY_ENTITY, + SCORECARDSCORESAGGREGATION_BY_RULE, + SCORECARDSCORESAGGREGATION_BY_SCORECARD, + SCORECARDSCORESAGGREGATION_BY_TEAM, + SCORECARDSCORESAGGREGATION_BY_KIND, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ScorecardScoresAggregation) GetAllowedValues() []ScorecardScoresAggregation { + return allowedScorecardScoresAggregationEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ScorecardScoresAggregation) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ScorecardScoresAggregation(value) + return nil +} + +// NewScorecardScoresAggregationFromValue returns a pointer to a valid ScorecardScoresAggregation +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewScorecardScoresAggregationFromValue(v string) (*ScorecardScoresAggregation, error) { + ev := ScorecardScoresAggregation(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ScorecardScoresAggregation: valid values are %v", v, allowedScorecardScoresAggregationEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ScorecardScoresAggregation) IsValid() bool { + for _, existing := range allowedScorecardScoresAggregationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ScorecardScoresAggregation value. +func (v ScorecardScoresAggregation) Ptr() *ScorecardScoresAggregation { + return &v +} diff --git a/api/datadogV2/model_security_filter_version.go b/api/datadogV2/model_security_filter_version.go new file mode 100644 index 00000000000..da66e2f2309 --- /dev/null +++ b/api/datadogV2/model_security_filter_version.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityFilterVersion A snapshot of all security filters at a specific configuration version. +type SecurityFilterVersion struct { + // The attributes describing a single security filter configuration version. + Attributes SecurityFilterVersionAttributes `json:"attributes"` + // The identifier of the configuration version. + Id string `json:"id"` + // The type of the resource. The value should always be `security_filters_configuration`. + Type SecurityFilterVersionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityFilterVersion instantiates a new SecurityFilterVersion object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityFilterVersion(attributes SecurityFilterVersionAttributes, id string, typeVar SecurityFilterVersionType) *SecurityFilterVersion { + this := SecurityFilterVersion{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewSecurityFilterVersionWithDefaults instantiates a new SecurityFilterVersion object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityFilterVersionWithDefaults() *SecurityFilterVersion { + this := SecurityFilterVersion{} + var typeVar SecurityFilterVersionType = SECURITYFILTERVERSIONTYPE_SECURITY_FILTERS_CONFIGURATION + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SecurityFilterVersion) GetAttributes() SecurityFilterVersionAttributes { + if o == nil { + var ret SecurityFilterVersionAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersion) GetAttributesOk() (*SecurityFilterVersionAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SecurityFilterVersion) SetAttributes(v SecurityFilterVersionAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *SecurityFilterVersion) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersion) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SecurityFilterVersion) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *SecurityFilterVersion) GetType() SecurityFilterVersionType { + if o == nil { + var ret SecurityFilterVersionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersion) GetTypeOk() (*SecurityFilterVersionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SecurityFilterVersion) SetType(v SecurityFilterVersionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityFilterVersion) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityFilterVersion) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SecurityFilterVersionAttributes `json:"attributes"` + Id *string `json:"id"` + Type *SecurityFilterVersionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_filter_version_attributes.go b/api/datadogV2/model_security_filter_version_attributes.go new file mode 100644 index 00000000000..db7514d935d --- /dev/null +++ b/api/datadogV2/model_security_filter_version_attributes.go @@ -0,0 +1,165 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityFilterVersionAttributes The attributes describing a single security filter configuration version. +type SecurityFilterVersionAttributes struct { + // The Unix timestamp in milliseconds at which this configuration version was applied. + Date int64 `json:"date"` + // The set of security filters at this configuration version. + Filters []SecurityFilterVersionEntry `json:"filters"` + // The configuration version number. + Version int32 `json:"version"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityFilterVersionAttributes instantiates a new SecurityFilterVersionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityFilterVersionAttributes(date int64, filters []SecurityFilterVersionEntry, version int32) *SecurityFilterVersionAttributes { + this := SecurityFilterVersionAttributes{} + this.Date = date + this.Filters = filters + this.Version = version + return &this +} + +// NewSecurityFilterVersionAttributesWithDefaults instantiates a new SecurityFilterVersionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityFilterVersionAttributesWithDefaults() *SecurityFilterVersionAttributes { + this := SecurityFilterVersionAttributes{} + return &this +} + +// GetDate returns the Date field value. +func (o *SecurityFilterVersionAttributes) GetDate() int64 { + if o == nil { + var ret int64 + return ret + } + return o.Date +} + +// GetDateOk returns a tuple with the Date field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionAttributes) GetDateOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Date, true +} + +// SetDate sets field value. +func (o *SecurityFilterVersionAttributes) SetDate(v int64) { + o.Date = v +} + +// GetFilters returns the Filters field value. +func (o *SecurityFilterVersionAttributes) GetFilters() []SecurityFilterVersionEntry { + if o == nil { + var ret []SecurityFilterVersionEntry + return ret + } + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionAttributes) GetFiltersOk() (*[]SecurityFilterVersionEntry, bool) { + if o == nil { + return nil, false + } + return &o.Filters, true +} + +// SetFilters sets field value. +func (o *SecurityFilterVersionAttributes) SetFilters(v []SecurityFilterVersionEntry) { + o.Filters = v +} + +// GetVersion returns the Version field value. +func (o *SecurityFilterVersionAttributes) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionAttributes) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value. +func (o *SecurityFilterVersionAttributes) SetVersion(v int32) { + o.Version = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityFilterVersionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["date"] = o.Date + toSerialize["filters"] = o.Filters + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityFilterVersionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Date *int64 `json:"date"` + Filters *[]SecurityFilterVersionEntry `json:"filters"` + Version *int32 `json:"version"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Date == nil { + return fmt.Errorf("required field date missing") + } + if all.Filters == nil { + return fmt.Errorf("required field filters missing") + } + if all.Version == nil { + return fmt.Errorf("required field version missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"date", "filters", "version"}) + } else { + return err + } + o.Date = *all.Date + o.Filters = *all.Filters + o.Version = *all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_security_filter_version_entry.go b/api/datadogV2/model_security_filter_version_entry.go new file mode 100644 index 00000000000..cb8929f0287 --- /dev/null +++ b/api/datadogV2/model_security_filter_version_entry.go @@ -0,0 +1,335 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityFilterVersionEntry A single security filter as it existed at a given configuration version. +type SecurityFilterVersionEntry struct { + // The list of exclusion filters applied in this security filter. + ExclusionFilters []SecurityFilterExclusionFilterResponse `json:"exclusion_filters"` + // The filtered data type. + FilteredDataType SecurityFilterFilteredDataType `json:"filtered_data_type"` + // The ID of the security filter. + Id string `json:"id"` + // Whether the security filter is the built-in filter. + IsBuiltin bool `json:"is_builtin"` + // Whether the security filter is enabled. + IsEnabled bool `json:"is_enabled"` + // The name of the security filter. + Name string `json:"name"` + // The query of the security filter. + Query string `json:"query"` + // The version of this security filter. + Version int32 `json:"version"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityFilterVersionEntry instantiates a new SecurityFilterVersionEntry object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityFilterVersionEntry(exclusionFilters []SecurityFilterExclusionFilterResponse, filteredDataType SecurityFilterFilteredDataType, id string, isBuiltin bool, isEnabled bool, name string, query string, version int32) *SecurityFilterVersionEntry { + this := SecurityFilterVersionEntry{} + this.ExclusionFilters = exclusionFilters + this.FilteredDataType = filteredDataType + this.Id = id + this.IsBuiltin = isBuiltin + this.IsEnabled = isEnabled + this.Name = name + this.Query = query + this.Version = version + return &this +} + +// NewSecurityFilterVersionEntryWithDefaults instantiates a new SecurityFilterVersionEntry object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityFilterVersionEntryWithDefaults() *SecurityFilterVersionEntry { + this := SecurityFilterVersionEntry{} + return &this +} + +// GetExclusionFilters returns the ExclusionFilters field value. +func (o *SecurityFilterVersionEntry) GetExclusionFilters() []SecurityFilterExclusionFilterResponse { + if o == nil { + var ret []SecurityFilterExclusionFilterResponse + return ret + } + return o.ExclusionFilters +} + +// GetExclusionFiltersOk returns a tuple with the ExclusionFilters field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetExclusionFiltersOk() (*[]SecurityFilterExclusionFilterResponse, bool) { + if o == nil { + return nil, false + } + return &o.ExclusionFilters, true +} + +// SetExclusionFilters sets field value. +func (o *SecurityFilterVersionEntry) SetExclusionFilters(v []SecurityFilterExclusionFilterResponse) { + o.ExclusionFilters = v +} + +// GetFilteredDataType returns the FilteredDataType field value. +func (o *SecurityFilterVersionEntry) GetFilteredDataType() SecurityFilterFilteredDataType { + if o == nil { + var ret SecurityFilterFilteredDataType + return ret + } + return o.FilteredDataType +} + +// GetFilteredDataTypeOk returns a tuple with the FilteredDataType field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetFilteredDataTypeOk() (*SecurityFilterFilteredDataType, bool) { + if o == nil { + return nil, false + } + return &o.FilteredDataType, true +} + +// SetFilteredDataType sets field value. +func (o *SecurityFilterVersionEntry) SetFilteredDataType(v SecurityFilterFilteredDataType) { + o.FilteredDataType = v +} + +// GetId returns the Id field value. +func (o *SecurityFilterVersionEntry) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SecurityFilterVersionEntry) SetId(v string) { + o.Id = v +} + +// GetIsBuiltin returns the IsBuiltin field value. +func (o *SecurityFilterVersionEntry) GetIsBuiltin() bool { + if o == nil { + var ret bool + return ret + } + return o.IsBuiltin +} + +// GetIsBuiltinOk returns a tuple with the IsBuiltin field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetIsBuiltinOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsBuiltin, true +} + +// SetIsBuiltin sets field value. +func (o *SecurityFilterVersionEntry) SetIsBuiltin(v bool) { + o.IsBuiltin = v +} + +// GetIsEnabled returns the IsEnabled field value. +func (o *SecurityFilterVersionEntry) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value. +func (o *SecurityFilterVersionEntry) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetName returns the Name field value. +func (o *SecurityFilterVersionEntry) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *SecurityFilterVersionEntry) SetName(v string) { + o.Name = v +} + +// GetQuery returns the Query field value. +func (o *SecurityFilterVersionEntry) GetQuery() string { + if o == nil { + var ret string + return ret + } + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value. +func (o *SecurityFilterVersionEntry) SetQuery(v string) { + o.Query = v +} + +// GetVersion returns the Version field value. +func (o *SecurityFilterVersionEntry) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionEntry) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value. +func (o *SecurityFilterVersionEntry) SetVersion(v int32) { + o.Version = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityFilterVersionEntry) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["exclusion_filters"] = o.ExclusionFilters + toSerialize["filtered_data_type"] = o.FilteredDataType + toSerialize["id"] = o.Id + toSerialize["is_builtin"] = o.IsBuiltin + toSerialize["is_enabled"] = o.IsEnabled + toSerialize["name"] = o.Name + toSerialize["query"] = o.Query + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityFilterVersionEntry) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ExclusionFilters *[]SecurityFilterExclusionFilterResponse `json:"exclusion_filters"` + FilteredDataType *SecurityFilterFilteredDataType `json:"filtered_data_type"` + Id *string `json:"id"` + IsBuiltin *bool `json:"is_builtin"` + IsEnabled *bool `json:"is_enabled"` + Name *string `json:"name"` + Query *string `json:"query"` + Version *int32 `json:"version"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ExclusionFilters == nil { + return fmt.Errorf("required field exclusion_filters missing") + } + if all.FilteredDataType == nil { + return fmt.Errorf("required field filtered_data_type missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.IsBuiltin == nil { + return fmt.Errorf("required field is_builtin missing") + } + if all.IsEnabled == nil { + return fmt.Errorf("required field is_enabled missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Query == nil { + return fmt.Errorf("required field query missing") + } + if all.Version == nil { + return fmt.Errorf("required field version missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"exclusion_filters", "filtered_data_type", "id", "is_builtin", "is_enabled", "name", "query", "version"}) + } else { + return err + } + + hasInvalidField := false + o.ExclusionFilters = *all.ExclusionFilters + if !all.FilteredDataType.IsValid() { + hasInvalidField = true + } else { + o.FilteredDataType = *all.FilteredDataType + } + o.Id = *all.Id + o.IsBuiltin = *all.IsBuiltin + o.IsEnabled = *all.IsEnabled + o.Name = *all.Name + o.Query = *all.Query + o.Version = *all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_filter_version_type.go b/api/datadogV2/model_security_filter_version_type.go new file mode 100644 index 00000000000..5252bf25bc9 --- /dev/null +++ b/api/datadogV2/model_security_filter_version_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityFilterVersionType The type of the resource. The value should always be `security_filters_configuration`. +type SecurityFilterVersionType string + +// List of SecurityFilterVersionType. +const ( + SECURITYFILTERVERSIONTYPE_SECURITY_FILTERS_CONFIGURATION SecurityFilterVersionType = "security_filters_configuration" +) + +var allowedSecurityFilterVersionTypeEnumValues = []SecurityFilterVersionType{ + SECURITYFILTERVERSIONTYPE_SECURITY_FILTERS_CONFIGURATION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SecurityFilterVersionType) GetAllowedValues() []SecurityFilterVersionType { + return allowedSecurityFilterVersionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SecurityFilterVersionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SecurityFilterVersionType(value) + return nil +} + +// NewSecurityFilterVersionTypeFromValue returns a pointer to a valid SecurityFilterVersionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSecurityFilterVersionTypeFromValue(v string) (*SecurityFilterVersionType, error) { + ev := SecurityFilterVersionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SecurityFilterVersionType: valid values are %v", v, allowedSecurityFilterVersionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SecurityFilterVersionType) IsValid() bool { + for _, existing := range allowedSecurityFilterVersionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SecurityFilterVersionType value. +func (v SecurityFilterVersionType) Ptr() *SecurityFilterVersionType { + return &v +} diff --git a/api/datadogV2/model_security_filter_versions_response.go b/api/datadogV2/model_security_filter_versions_response.go new file mode 100644 index 00000000000..4de837845c5 --- /dev/null +++ b/api/datadogV2/model_security_filter_versions_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityFilterVersionsResponse Response containing the version history of security filters. +type SecurityFilterVersionsResponse struct { + // A list of historical security filter configurations, ordered from the most recent to the oldest. + Data []SecurityFilterVersion `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityFilterVersionsResponse instantiates a new SecurityFilterVersionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityFilterVersionsResponse(data []SecurityFilterVersion) *SecurityFilterVersionsResponse { + this := SecurityFilterVersionsResponse{} + this.Data = data + return &this +} + +// NewSecurityFilterVersionsResponseWithDefaults instantiates a new SecurityFilterVersionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityFilterVersionsResponseWithDefaults() *SecurityFilterVersionsResponse { + this := SecurityFilterVersionsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityFilterVersionsResponse) GetData() []SecurityFilterVersion { + if o == nil { + var ret []SecurityFilterVersion + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityFilterVersionsResponse) GetDataOk() (*[]SecurityFilterVersion, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityFilterVersionsResponse) SetData(v []SecurityFilterVersion) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityFilterVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityFilterVersionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]SecurityFilterVersion `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_attributes.go b/api/datadogV2/model_security_monitoring_integration_config_attributes.go new file mode 100644 index 00000000000..8001d620d9b --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_attributes.go @@ -0,0 +1,363 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigAttributes The attributes of an entity context sync configuration as returned by the API. +type SecurityMonitoringIntegrationConfigAttributes struct { + // The time at which the entity context sync configuration was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The domain associated with the external entity source (for example, the customer's identity provider domain). + Domain string `json:"domain"` + // Whether the sync is enabled and actively ingesting entities into Cloud SIEM. + Enabled bool `json:"enabled"` + // The type of external source that provides entities to Cloud SIEM. + IntegrationType SecurityMonitoringIntegrationType `json:"integration_type"` + // The time at which the entity context sync configuration was last modified. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The display name of the entity context sync configuration. + Name *string `json:"name,omitempty"` + // Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + Settings map[string]interface{} `json:"settings,omitempty"` + // The state of the credentials configured on the entity context sync. + State *SecurityMonitoringIntegrationConfigState `json:"state,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigAttributes instantiates a new SecurityMonitoringIntegrationConfigAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigAttributes(domain string, enabled bool, integrationType SecurityMonitoringIntegrationType) *SecurityMonitoringIntegrationConfigAttributes { + this := SecurityMonitoringIntegrationConfigAttributes{} + this.Domain = domain + this.Enabled = enabled + this.IntegrationType = integrationType + return &this +} + +// NewSecurityMonitoringIntegrationConfigAttributesWithDefaults instantiates a new SecurityMonitoringIntegrationConfigAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigAttributesWithDefaults() *SecurityMonitoringIntegrationConfigAttributes { + this := SecurityMonitoringIntegrationConfigAttributes{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDomain returns the Domain field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetDomain() string { + if o == nil { + var ret string + return ret + } + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetDomain(v string) { + o.Domain = v +} + +// GetEnabled returns the Enabled field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetEnabled(v bool) { + o.Enabled = v +} + +// GetIntegrationType returns the IntegrationType field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetIntegrationType() SecurityMonitoringIntegrationType { + if o == nil { + var ret SecurityMonitoringIntegrationType + return ret + } + return o.IntegrationType +} + +// GetIntegrationTypeOk returns a tuple with the IntegrationType field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetIntegrationTypeOk() (*SecurityMonitoringIntegrationType, bool) { + if o == nil { + return nil, false + } + return &o.IntegrationType, true +} + +// SetIntegrationType sets field value. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetIntegrationType(v SecurityMonitoringIntegrationType) { + o.IntegrationType = v +} + +// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetModifiedAt() time.Time { + if o == nil || o.ModifiedAt == nil { + var ret time.Time + return ret + } + return *o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetModifiedAtOk() (*time.Time, bool) { + if o == nil || o.ModifiedAt == nil { + return nil, false + } + return o.ModifiedAt, true +} + +// HasModifiedAt returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) HasModifiedAt() bool { + return o != nil && o.ModifiedAt != nil +} + +// SetModifiedAt gets a reference to the given time.Time and assigns it to the ModifiedAt field. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetModifiedAt(v time.Time) { + o.ModifiedAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetName(v string) { + o.Name = &v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetSettings() map[string]interface{} { + if o == nil || o.Settings == nil { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetSettingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Settings == nil { + return nil, false + } + return &o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) HasSettings() bool { + return o != nil && o.Settings != nil +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetState() SecurityMonitoringIntegrationConfigState { + if o == nil || o.State == nil { + var ret SecurityMonitoringIntegrationConfigState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) GetStateOk() (*SecurityMonitoringIntegrationConfigState, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigAttributes) HasState() bool { + return o != nil && o.State != nil +} + +// SetState gets a reference to the given SecurityMonitoringIntegrationConfigState and assigns it to the State field. +func (o *SecurityMonitoringIntegrationConfigAttributes) SetState(v SecurityMonitoringIntegrationConfigState) { + o.State = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + toSerialize["domain"] = o.Domain + toSerialize["enabled"] = o.Enabled + toSerialize["integration_type"] = o.IntegrationType + if o.ModifiedAt != nil { + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Settings != nil { + toSerialize["settings"] = o.Settings + } + if o.State != nil { + toSerialize["state"] = o.State + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Domain *string `json:"domain"` + Enabled *bool `json:"enabled"` + IntegrationType *SecurityMonitoringIntegrationType `json:"integration_type"` + ModifiedAt *time.Time `json:"modified_at,omitempty"` + Name *string `json:"name,omitempty"` + Settings map[string]interface{} `json:"settings,omitempty"` + State *SecurityMonitoringIntegrationConfigState `json:"state,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Domain == nil { + return fmt.Errorf("required field domain missing") + } + if all.Enabled == nil { + return fmt.Errorf("required field enabled missing") + } + if all.IntegrationType == nil { + return fmt.Errorf("required field integration_type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "domain", "enabled", "integration_type", "modified_at", "name", "settings", "state"}) + } else { + return err + } + + hasInvalidField := false + o.CreatedAt = all.CreatedAt + o.Domain = *all.Domain + o.Enabled = *all.Enabled + if !all.IntegrationType.IsValid() { + hasInvalidField = true + } else { + o.IntegrationType = *all.IntegrationType + } + o.ModifiedAt = all.ModifiedAt + o.Name = all.Name + o.Settings = all.Settings + if all.State != nil && !all.State.IsValid() { + hasInvalidField = true + } else { + o.State = all.State + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_create_attributes.go b/api/datadogV2/model_security_monitoring_integration_config_create_attributes.go new file mode 100644 index 00000000000..c7ffae7f7fc --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_create_attributes.go @@ -0,0 +1,242 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigCreateAttributes The attributes of the entity context sync configuration to create. +type SecurityMonitoringIntegrationConfigCreateAttributes struct { + // The domain associated with the external entity source. + Domain string `json:"domain"` + // The type of external source that provides entities to Cloud SIEM. + IntegrationType SecurityMonitoringIntegrationType `json:"integration_type"` + // The display name for the entity context sync configuration. + Name string `json:"name"` + // The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + Secrets map[string]interface{} `json:"secrets"` + // Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + Settings map[string]interface{} `json:"settings,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigCreateAttributes instantiates a new SecurityMonitoringIntegrationConfigCreateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigCreateAttributes(domain string, integrationType SecurityMonitoringIntegrationType, name string, secrets map[string]interface{}) *SecurityMonitoringIntegrationConfigCreateAttributes { + this := SecurityMonitoringIntegrationConfigCreateAttributes{} + this.Domain = domain + this.IntegrationType = integrationType + this.Name = name + this.Secrets = secrets + return &this +} + +// NewSecurityMonitoringIntegrationConfigCreateAttributesWithDefaults instantiates a new SecurityMonitoringIntegrationConfigCreateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigCreateAttributesWithDefaults() *SecurityMonitoringIntegrationConfigCreateAttributes { + this := SecurityMonitoringIntegrationConfigCreateAttributes{} + return &this +} + +// GetDomain returns the Domain field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetDomain() string { + if o == nil { + var ret string + return ret + } + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) SetDomain(v string) { + o.Domain = v +} + +// GetIntegrationType returns the IntegrationType field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetIntegrationType() SecurityMonitoringIntegrationType { + if o == nil { + var ret SecurityMonitoringIntegrationType + return ret + } + return o.IntegrationType +} + +// GetIntegrationTypeOk returns a tuple with the IntegrationType field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetIntegrationTypeOk() (*SecurityMonitoringIntegrationType, bool) { + if o == nil { + return nil, false + } + return &o.IntegrationType, true +} + +// SetIntegrationType sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) SetIntegrationType(v SecurityMonitoringIntegrationType) { + o.IntegrationType = v +} + +// GetName returns the Name field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) SetName(v string) { + o.Name = v +} + +// GetSecrets returns the Secrets field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetSecrets() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetSecretsOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Secrets, true +} + +// SetSecrets sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) SetSecrets(v map[string]interface{}) { + o.Secrets = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetSettings() map[string]interface{} { + if o == nil || o.Settings == nil { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) GetSettingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Settings == nil { + return nil, false + } + return &o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) HasSettings() bool { + return o != nil && o.Settings != nil +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigCreateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["domain"] = o.Domain + toSerialize["integration_type"] = o.IntegrationType + toSerialize["name"] = o.Name + toSerialize["secrets"] = o.Secrets + if o.Settings != nil { + toSerialize["settings"] = o.Settings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Domain *string `json:"domain"` + IntegrationType *SecurityMonitoringIntegrationType `json:"integration_type"` + Name *string `json:"name"` + Secrets *map[string]interface{} `json:"secrets"` + Settings map[string]interface{} `json:"settings,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Domain == nil { + return fmt.Errorf("required field domain missing") + } + if all.IntegrationType == nil { + return fmt.Errorf("required field integration_type missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Secrets == nil { + return fmt.Errorf("required field secrets missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"domain", "integration_type", "name", "secrets", "settings"}) + } else { + return err + } + + hasInvalidField := false + o.Domain = *all.Domain + if !all.IntegrationType.IsValid() { + hasInvalidField = true + } else { + o.IntegrationType = *all.IntegrationType + } + o.Name = *all.Name + o.Secrets = *all.Secrets + o.Settings = all.Settings + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_create_data.go b/api/datadogV2/model_security_monitoring_integration_config_create_data.go new file mode 100644 index 00000000000..acce10df0cb --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_create_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigCreateData The entity context sync configuration to create. +type SecurityMonitoringIntegrationConfigCreateData struct { + // The attributes of the entity context sync configuration to create. + Attributes SecurityMonitoringIntegrationConfigCreateAttributes `json:"attributes"` + // The type of the resource. The value should always be `integration_config`. + Type SecurityMonitoringIntegrationConfigResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigCreateData instantiates a new SecurityMonitoringIntegrationConfigCreateData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigCreateData(attributes SecurityMonitoringIntegrationConfigCreateAttributes, typeVar SecurityMonitoringIntegrationConfigResourceType) *SecurityMonitoringIntegrationConfigCreateData { + this := SecurityMonitoringIntegrationConfigCreateData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewSecurityMonitoringIntegrationConfigCreateDataWithDefaults instantiates a new SecurityMonitoringIntegrationConfigCreateData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigCreateDataWithDefaults() *SecurityMonitoringIntegrationConfigCreateData { + this := SecurityMonitoringIntegrationConfigCreateData{} + var typeVar SecurityMonitoringIntegrationConfigResourceType = SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SecurityMonitoringIntegrationConfigCreateData) GetAttributes() SecurityMonitoringIntegrationConfigCreateAttributes { + if o == nil { + var ret SecurityMonitoringIntegrationConfigCreateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateData) GetAttributesOk() (*SecurityMonitoringIntegrationConfigCreateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateData) SetAttributes(v SecurityMonitoringIntegrationConfigCreateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *SecurityMonitoringIntegrationConfigCreateData) GetType() SecurityMonitoringIntegrationConfigResourceType { + if o == nil { + var ret SecurityMonitoringIntegrationConfigResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateData) GetTypeOk() (*SecurityMonitoringIntegrationConfigResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateData) SetType(v SecurityMonitoringIntegrationConfigResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigCreateData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigCreateData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SecurityMonitoringIntegrationConfigCreateAttributes `json:"attributes"` + Type *SecurityMonitoringIntegrationConfigResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_create_request.go b/api/datadogV2/model_security_monitoring_integration_config_create_request.go new file mode 100644 index 00000000000..b1406e25db3 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_create_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigCreateRequest Request body to create an entity context sync configuration. +type SecurityMonitoringIntegrationConfigCreateRequest struct { + // The entity context sync configuration to create. + Data SecurityMonitoringIntegrationConfigCreateData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigCreateRequest instantiates a new SecurityMonitoringIntegrationConfigCreateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigCreateRequest(data SecurityMonitoringIntegrationConfigCreateData) *SecurityMonitoringIntegrationConfigCreateRequest { + this := SecurityMonitoringIntegrationConfigCreateRequest{} + this.Data = data + return &this +} + +// NewSecurityMonitoringIntegrationConfigCreateRequestWithDefaults instantiates a new SecurityMonitoringIntegrationConfigCreateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigCreateRequestWithDefaults() *SecurityMonitoringIntegrationConfigCreateRequest { + this := SecurityMonitoringIntegrationConfigCreateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityMonitoringIntegrationConfigCreateRequest) GetData() SecurityMonitoringIntegrationConfigCreateData { + if o == nil { + var ret SecurityMonitoringIntegrationConfigCreateData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigCreateRequest) GetDataOk() (*SecurityMonitoringIntegrationConfigCreateData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityMonitoringIntegrationConfigCreateRequest) SetData(v SecurityMonitoringIntegrationConfigCreateData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SecurityMonitoringIntegrationConfigCreateData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_data.go b/api/datadogV2/model_security_monitoring_integration_config_data.go new file mode 100644 index 00000000000..30975e78d6f --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigData An entity context sync configuration. +type SecurityMonitoringIntegrationConfigData struct { + // The attributes of an entity context sync configuration as returned by the API. + Attributes SecurityMonitoringIntegrationConfigAttributes `json:"attributes"` + // The unique identifier of the integration configuration. + Id string `json:"id"` + // The type of the resource. The value should always be `integration_config`. + Type SecurityMonitoringIntegrationConfigResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigData instantiates a new SecurityMonitoringIntegrationConfigData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigData(attributes SecurityMonitoringIntegrationConfigAttributes, id string, typeVar SecurityMonitoringIntegrationConfigResourceType) *SecurityMonitoringIntegrationConfigData { + this := SecurityMonitoringIntegrationConfigData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewSecurityMonitoringIntegrationConfigDataWithDefaults instantiates a new SecurityMonitoringIntegrationConfigData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigDataWithDefaults() *SecurityMonitoringIntegrationConfigData { + this := SecurityMonitoringIntegrationConfigData{} + var typeVar SecurityMonitoringIntegrationConfigResourceType = SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SecurityMonitoringIntegrationConfigData) GetAttributes() SecurityMonitoringIntegrationConfigAttributes { + if o == nil { + var ret SecurityMonitoringIntegrationConfigAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigData) GetAttributesOk() (*SecurityMonitoringIntegrationConfigAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SecurityMonitoringIntegrationConfigData) SetAttributes(v SecurityMonitoringIntegrationConfigAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *SecurityMonitoringIntegrationConfigData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SecurityMonitoringIntegrationConfigData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *SecurityMonitoringIntegrationConfigData) GetType() SecurityMonitoringIntegrationConfigResourceType { + if o == nil { + var ret SecurityMonitoringIntegrationConfigResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigData) GetTypeOk() (*SecurityMonitoringIntegrationConfigResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SecurityMonitoringIntegrationConfigData) SetType(v SecurityMonitoringIntegrationConfigResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SecurityMonitoringIntegrationConfigAttributes `json:"attributes"` + Id *string `json:"id"` + Type *SecurityMonitoringIntegrationConfigResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_resource_type.go b/api/datadogV2/model_security_monitoring_integration_config_resource_type.go new file mode 100644 index 00000000000..faab465286d --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_resource_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigResourceType The type of the resource. The value should always be `integration_config`. +type SecurityMonitoringIntegrationConfigResourceType string + +// List of SecurityMonitoringIntegrationConfigResourceType. +const ( + SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG SecurityMonitoringIntegrationConfigResourceType = "integration_config" +) + +var allowedSecurityMonitoringIntegrationConfigResourceTypeEnumValues = []SecurityMonitoringIntegrationConfigResourceType{ + SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SecurityMonitoringIntegrationConfigResourceType) GetAllowedValues() []SecurityMonitoringIntegrationConfigResourceType { + return allowedSecurityMonitoringIntegrationConfigResourceTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SecurityMonitoringIntegrationConfigResourceType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SecurityMonitoringIntegrationConfigResourceType(value) + return nil +} + +// NewSecurityMonitoringIntegrationConfigResourceTypeFromValue returns a pointer to a valid SecurityMonitoringIntegrationConfigResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSecurityMonitoringIntegrationConfigResourceTypeFromValue(v string) (*SecurityMonitoringIntegrationConfigResourceType, error) { + ev := SecurityMonitoringIntegrationConfigResourceType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SecurityMonitoringIntegrationConfigResourceType: valid values are %v", v, allowedSecurityMonitoringIntegrationConfigResourceTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SecurityMonitoringIntegrationConfigResourceType) IsValid() bool { + for _, existing := range allowedSecurityMonitoringIntegrationConfigResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SecurityMonitoringIntegrationConfigResourceType value. +func (v SecurityMonitoringIntegrationConfigResourceType) Ptr() *SecurityMonitoringIntegrationConfigResourceType { + return &v +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_response.go b/api/datadogV2/model_security_monitoring_integration_config_response.go new file mode 100644 index 00000000000..7e6a147c796 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigResponse Response containing a single entity context sync configuration. +type SecurityMonitoringIntegrationConfigResponse struct { + // An entity context sync configuration. + Data SecurityMonitoringIntegrationConfigData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigResponse instantiates a new SecurityMonitoringIntegrationConfigResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigResponse(data SecurityMonitoringIntegrationConfigData) *SecurityMonitoringIntegrationConfigResponse { + this := SecurityMonitoringIntegrationConfigResponse{} + this.Data = data + return &this +} + +// NewSecurityMonitoringIntegrationConfigResponseWithDefaults instantiates a new SecurityMonitoringIntegrationConfigResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigResponseWithDefaults() *SecurityMonitoringIntegrationConfigResponse { + this := SecurityMonitoringIntegrationConfigResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityMonitoringIntegrationConfigResponse) GetData() SecurityMonitoringIntegrationConfigData { + if o == nil { + var ret SecurityMonitoringIntegrationConfigData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigResponse) GetDataOk() (*SecurityMonitoringIntegrationConfigData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityMonitoringIntegrationConfigResponse) SetData(v SecurityMonitoringIntegrationConfigData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SecurityMonitoringIntegrationConfigData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_state.go b/api/datadogV2/model_security_monitoring_integration_config_state.go new file mode 100644 index 00000000000..97caa31071d --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_state.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigState The state of the credentials configured on the entity context sync. +type SecurityMonitoringIntegrationConfigState string + +// List of SecurityMonitoringIntegrationConfigState. +const ( + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_VALID SecurityMonitoringIntegrationConfigState = "valid" + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_INVALID SecurityMonitoringIntegrationConfigState = "invalid" + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_INITIALIZING SecurityMonitoringIntegrationConfigState = "initializing" +) + +var allowedSecurityMonitoringIntegrationConfigStateEnumValues = []SecurityMonitoringIntegrationConfigState{ + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_VALID, + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_INVALID, + SECURITYMONITORINGINTEGRATIONCONFIGSTATE_INITIALIZING, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SecurityMonitoringIntegrationConfigState) GetAllowedValues() []SecurityMonitoringIntegrationConfigState { + return allowedSecurityMonitoringIntegrationConfigStateEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SecurityMonitoringIntegrationConfigState) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SecurityMonitoringIntegrationConfigState(value) + return nil +} + +// NewSecurityMonitoringIntegrationConfigStateFromValue returns a pointer to a valid SecurityMonitoringIntegrationConfigState +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSecurityMonitoringIntegrationConfigStateFromValue(v string) (*SecurityMonitoringIntegrationConfigState, error) { + ev := SecurityMonitoringIntegrationConfigState(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SecurityMonitoringIntegrationConfigState: valid values are %v", v, allowedSecurityMonitoringIntegrationConfigStateEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SecurityMonitoringIntegrationConfigState) IsValid() bool { + for _, existing := range allowedSecurityMonitoringIntegrationConfigStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SecurityMonitoringIntegrationConfigState value. +func (v SecurityMonitoringIntegrationConfigState) Ptr() *SecurityMonitoringIntegrationConfigState { + return &v +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_update_attributes.go b/api/datadogV2/model_security_monitoring_integration_config_update_attributes.go new file mode 100644 index 00000000000..bf472197299 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_update_attributes.go @@ -0,0 +1,287 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigUpdateAttributes Fields to update on the entity context sync configuration. All fields are optional. +type SecurityMonitoringIntegrationConfigUpdateAttributes struct { + // The new domain associated with the external entity source. + Domain *string `json:"domain,omitempty"` + // Whether the entity context sync should be enabled. + Enabled *bool `json:"enabled,omitempty"` + // The type of external source that provides entities to Cloud SIEM. + IntegrationType *SecurityMonitoringIntegrationType `json:"integration_type,omitempty"` + // The new display name for the entity context sync configuration. + Name *string `json:"name,omitempty"` + // The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + Secrets map[string]interface{} `json:"secrets,omitempty"` + // Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + Settings map[string]interface{} `json:"settings,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigUpdateAttributes instantiates a new SecurityMonitoringIntegrationConfigUpdateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigUpdateAttributes() *SecurityMonitoringIntegrationConfigUpdateAttributes { + this := SecurityMonitoringIntegrationConfigUpdateAttributes{} + return &this +} + +// NewSecurityMonitoringIntegrationConfigUpdateAttributesWithDefaults instantiates a new SecurityMonitoringIntegrationConfigUpdateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigUpdateAttributesWithDefaults() *SecurityMonitoringIntegrationConfigUpdateAttributes { + this := SecurityMonitoringIntegrationConfigUpdateAttributes{} + return &this +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetDomain() string { + if o == nil || o.Domain == nil { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetDomainOk() (*string, bool) { + if o == nil || o.Domain == nil { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasDomain() bool { + return o != nil && o.Domain != nil +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetDomain(v string) { + o.Domain = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasEnabled() bool { + return o != nil && o.Enabled != nil +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetIntegrationType returns the IntegrationType field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetIntegrationType() SecurityMonitoringIntegrationType { + if o == nil || o.IntegrationType == nil { + var ret SecurityMonitoringIntegrationType + return ret + } + return *o.IntegrationType +} + +// GetIntegrationTypeOk returns a tuple with the IntegrationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetIntegrationTypeOk() (*SecurityMonitoringIntegrationType, bool) { + if o == nil || o.IntegrationType == nil { + return nil, false + } + return o.IntegrationType, true +} + +// HasIntegrationType returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasIntegrationType() bool { + return o != nil && o.IntegrationType != nil +} + +// SetIntegrationType gets a reference to the given SecurityMonitoringIntegrationType and assigns it to the IntegrationType field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetIntegrationType(v SecurityMonitoringIntegrationType) { + o.IntegrationType = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetName(v string) { + o.Name = &v +} + +// GetSecrets returns the Secrets field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetSecrets() map[string]interface{} { + if o == nil || o.Secrets == nil { + var ret map[string]interface{} + return ret + } + return o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetSecretsOk() (*map[string]interface{}, bool) { + if o == nil || o.Secrets == nil { + return nil, false + } + return &o.Secrets, true +} + +// HasSecrets returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasSecrets() bool { + return o != nil && o.Secrets != nil +} + +// SetSecrets gets a reference to the given map[string]interface{} and assigns it to the Secrets field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetSecrets(v map[string]interface{}) { + o.Secrets = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetSettings() map[string]interface{} { + if o == nil || o.Settings == nil { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) GetSettingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Settings == nil { + return nil, false + } + return &o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) HasSettings() bool { + return o != nil && o.Settings != nil +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigUpdateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Domain != nil { + toSerialize["domain"] = o.Domain + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + if o.IntegrationType != nil { + toSerialize["integration_type"] = o.IntegrationType + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Secrets != nil { + toSerialize["secrets"] = o.Secrets + } + if o.Settings != nil { + toSerialize["settings"] = o.Settings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Domain *string `json:"domain,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + IntegrationType *SecurityMonitoringIntegrationType `json:"integration_type,omitempty"` + Name *string `json:"name,omitempty"` + Secrets map[string]interface{} `json:"secrets,omitempty"` + Settings map[string]interface{} `json:"settings,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"domain", "enabled", "integration_type", "name", "secrets", "settings"}) + } else { + return err + } + + hasInvalidField := false + o.Domain = all.Domain + o.Enabled = all.Enabled + if all.IntegrationType != nil && !all.IntegrationType.IsValid() { + hasInvalidField = true + } else { + o.IntegrationType = all.IntegrationType + } + o.Name = all.Name + o.Secrets = all.Secrets + o.Settings = all.Settings + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_update_data.go b/api/datadogV2/model_security_monitoring_integration_config_update_data.go new file mode 100644 index 00000000000..4ded4c00c7a --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_update_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigUpdateData The entity context sync configuration fields to update. +type SecurityMonitoringIntegrationConfigUpdateData struct { + // Fields to update on the entity context sync configuration. All fields are optional. + Attributes SecurityMonitoringIntegrationConfigUpdateAttributes `json:"attributes"` + // The type of the resource. The value should always be `integration_config`. + Type SecurityMonitoringIntegrationConfigResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigUpdateData instantiates a new SecurityMonitoringIntegrationConfigUpdateData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigUpdateData(attributes SecurityMonitoringIntegrationConfigUpdateAttributes, typeVar SecurityMonitoringIntegrationConfigResourceType) *SecurityMonitoringIntegrationConfigUpdateData { + this := SecurityMonitoringIntegrationConfigUpdateData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewSecurityMonitoringIntegrationConfigUpdateDataWithDefaults instantiates a new SecurityMonitoringIntegrationConfigUpdateData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigUpdateDataWithDefaults() *SecurityMonitoringIntegrationConfigUpdateData { + this := SecurityMonitoringIntegrationConfigUpdateData{} + var typeVar SecurityMonitoringIntegrationConfigResourceType = SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SecurityMonitoringIntegrationConfigUpdateData) GetAttributes() SecurityMonitoringIntegrationConfigUpdateAttributes { + if o == nil { + var ret SecurityMonitoringIntegrationConfigUpdateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateData) GetAttributesOk() (*SecurityMonitoringIntegrationConfigUpdateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SecurityMonitoringIntegrationConfigUpdateData) SetAttributes(v SecurityMonitoringIntegrationConfigUpdateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *SecurityMonitoringIntegrationConfigUpdateData) GetType() SecurityMonitoringIntegrationConfigResourceType { + if o == nil { + var ret SecurityMonitoringIntegrationConfigResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateData) GetTypeOk() (*SecurityMonitoringIntegrationConfigResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SecurityMonitoringIntegrationConfigUpdateData) SetType(v SecurityMonitoringIntegrationConfigResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigUpdateData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigUpdateData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SecurityMonitoringIntegrationConfigUpdateAttributes `json:"attributes"` + Type *SecurityMonitoringIntegrationConfigResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_config_update_request.go b/api/datadogV2/model_security_monitoring_integration_config_update_request.go new file mode 100644 index 00000000000..0487ba16e11 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_config_update_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigUpdateRequest Request body to update an entity context sync configuration. Supports partial updates. +type SecurityMonitoringIntegrationConfigUpdateRequest struct { + // The entity context sync configuration fields to update. + Data SecurityMonitoringIntegrationConfigUpdateData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigUpdateRequest instantiates a new SecurityMonitoringIntegrationConfigUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigUpdateRequest(data SecurityMonitoringIntegrationConfigUpdateData) *SecurityMonitoringIntegrationConfigUpdateRequest { + this := SecurityMonitoringIntegrationConfigUpdateRequest{} + this.Data = data + return &this +} + +// NewSecurityMonitoringIntegrationConfigUpdateRequestWithDefaults instantiates a new SecurityMonitoringIntegrationConfigUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigUpdateRequestWithDefaults() *SecurityMonitoringIntegrationConfigUpdateRequest { + this := SecurityMonitoringIntegrationConfigUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityMonitoringIntegrationConfigUpdateRequest) GetData() SecurityMonitoringIntegrationConfigUpdateData { + if o == nil { + var ret SecurityMonitoringIntegrationConfigUpdateData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigUpdateRequest) GetDataOk() (*SecurityMonitoringIntegrationConfigUpdateData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityMonitoringIntegrationConfigUpdateRequest) SetData(v SecurityMonitoringIntegrationConfigUpdateData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SecurityMonitoringIntegrationConfigUpdateData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_configs_response.go b/api/datadogV2/model_security_monitoring_integration_configs_response.go new file mode 100644 index 00000000000..a4326f835f2 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_configs_response.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationConfigsResponse Response containing a list of entity context sync configurations. +type SecurityMonitoringIntegrationConfigsResponse struct { + // The list of integration configurations. + Data []SecurityMonitoringIntegrationConfigData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationConfigsResponse instantiates a new SecurityMonitoringIntegrationConfigsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationConfigsResponse(data []SecurityMonitoringIntegrationConfigData) *SecurityMonitoringIntegrationConfigsResponse { + this := SecurityMonitoringIntegrationConfigsResponse{} + this.Data = data + return &this +} + +// NewSecurityMonitoringIntegrationConfigsResponseWithDefaults instantiates a new SecurityMonitoringIntegrationConfigsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationConfigsResponseWithDefaults() *SecurityMonitoringIntegrationConfigsResponse { + this := SecurityMonitoringIntegrationConfigsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityMonitoringIntegrationConfigsResponse) GetData() []SecurityMonitoringIntegrationConfigData { + if o == nil { + var ret []SecurityMonitoringIntegrationConfigData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationConfigsResponse) GetDataOk() (*[]SecurityMonitoringIntegrationConfigData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityMonitoringIntegrationConfigsResponse) SetData(v []SecurityMonitoringIntegrationConfigData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationConfigsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationConfigsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]SecurityMonitoringIntegrationConfigData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_credentials_validate_attributes.go b/api/datadogV2/model_security_monitoring_integration_credentials_validate_attributes.go new file mode 100644 index 00000000000..8164118f3e8 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_credentials_validate_attributes.go @@ -0,0 +1,175 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationCredentialsValidateAttributes The credentials to validate against the external entity source. +type SecurityMonitoringIntegrationCredentialsValidateAttributes struct { + // The domain associated with the external entity source. + Domain string `json:"domain"` + // The type of external source that provides entities to Cloud SIEM. + IntegrationType SecurityMonitoringIntegrationType `json:"integration_type"` + // The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + Secrets map[string]interface{} `json:"secrets"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationCredentialsValidateAttributes instantiates a new SecurityMonitoringIntegrationCredentialsValidateAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationCredentialsValidateAttributes(domain string, integrationType SecurityMonitoringIntegrationType, secrets map[string]interface{}) *SecurityMonitoringIntegrationCredentialsValidateAttributes { + this := SecurityMonitoringIntegrationCredentialsValidateAttributes{} + this.Domain = domain + this.IntegrationType = integrationType + this.Secrets = secrets + return &this +} + +// NewSecurityMonitoringIntegrationCredentialsValidateAttributesWithDefaults instantiates a new SecurityMonitoringIntegrationCredentialsValidateAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationCredentialsValidateAttributesWithDefaults() *SecurityMonitoringIntegrationCredentialsValidateAttributes { + this := SecurityMonitoringIntegrationCredentialsValidateAttributes{} + return &this +} + +// GetDomain returns the Domain field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetDomain() string { + if o == nil { + var ret string + return ret + } + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) SetDomain(v string) { + o.Domain = v +} + +// GetIntegrationType returns the IntegrationType field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetIntegrationType() SecurityMonitoringIntegrationType { + if o == nil { + var ret SecurityMonitoringIntegrationType + return ret + } + return o.IntegrationType +} + +// GetIntegrationTypeOk returns a tuple with the IntegrationType field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetIntegrationTypeOk() (*SecurityMonitoringIntegrationType, bool) { + if o == nil { + return nil, false + } + return &o.IntegrationType, true +} + +// SetIntegrationType sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) SetIntegrationType(v SecurityMonitoringIntegrationType) { + o.IntegrationType = v +} + +// GetSecrets returns the Secrets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetSecrets() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) GetSecretsOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Secrets, true +} + +// SetSecrets sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) SetSecrets(v map[string]interface{}) { + o.Secrets = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationCredentialsValidateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["domain"] = o.Domain + toSerialize["integration_type"] = o.IntegrationType + toSerialize["secrets"] = o.Secrets + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationCredentialsValidateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Domain *string `json:"domain"` + IntegrationType *SecurityMonitoringIntegrationType `json:"integration_type"` + Secrets *map[string]interface{} `json:"secrets"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Domain == nil { + return fmt.Errorf("required field domain missing") + } + if all.IntegrationType == nil { + return fmt.Errorf("required field integration_type missing") + } + if all.Secrets == nil { + return fmt.Errorf("required field secrets missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"domain", "integration_type", "secrets"}) + } else { + return err + } + + hasInvalidField := false + o.Domain = *all.Domain + if !all.IntegrationType.IsValid() { + hasInvalidField = true + } else { + o.IntegrationType = *all.IntegrationType + } + o.Secrets = *all.Secrets + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_credentials_validate_data.go b/api/datadogV2/model_security_monitoring_integration_credentials_validate_data.go new file mode 100644 index 00000000000..5d34282516e --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_credentials_validate_data.go @@ -0,0 +1,148 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationCredentialsValidateData The credentials to validate. +type SecurityMonitoringIntegrationCredentialsValidateData struct { + // The credentials to validate against the external entity source. + Attributes SecurityMonitoringIntegrationCredentialsValidateAttributes `json:"attributes"` + // The type of the resource. The value should always be `integration_config`. + Type SecurityMonitoringIntegrationConfigResourceType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationCredentialsValidateData instantiates a new SecurityMonitoringIntegrationCredentialsValidateData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationCredentialsValidateData(attributes SecurityMonitoringIntegrationCredentialsValidateAttributes, typeVar SecurityMonitoringIntegrationConfigResourceType) *SecurityMonitoringIntegrationCredentialsValidateData { + this := SecurityMonitoringIntegrationCredentialsValidateData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewSecurityMonitoringIntegrationCredentialsValidateDataWithDefaults instantiates a new SecurityMonitoringIntegrationCredentialsValidateData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationCredentialsValidateDataWithDefaults() *SecurityMonitoringIntegrationCredentialsValidateData { + this := SecurityMonitoringIntegrationCredentialsValidateData{} + var typeVar SecurityMonitoringIntegrationConfigResourceType = SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) GetAttributes() SecurityMonitoringIntegrationCredentialsValidateAttributes { + if o == nil { + var ret SecurityMonitoringIntegrationCredentialsValidateAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) GetAttributesOk() (*SecurityMonitoringIntegrationCredentialsValidateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) SetAttributes(v SecurityMonitoringIntegrationCredentialsValidateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) GetType() SecurityMonitoringIntegrationConfigResourceType { + if o == nil { + var ret SecurityMonitoringIntegrationConfigResourceType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) GetTypeOk() (*SecurityMonitoringIntegrationConfigResourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) SetType(v SecurityMonitoringIntegrationConfigResourceType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationCredentialsValidateData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationCredentialsValidateData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SecurityMonitoringIntegrationCredentialsValidateAttributes `json:"attributes"` + Type *SecurityMonitoringIntegrationConfigResourceType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_credentials_validate_request.go b/api/datadogV2/model_security_monitoring_integration_credentials_validate_request.go new file mode 100644 index 00000000000..7bc7588b900 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_credentials_validate_request.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationCredentialsValidateRequest Request body to validate credentials against an external entity source before creating a sync configuration. +type SecurityMonitoringIntegrationCredentialsValidateRequest struct { + // The credentials to validate. + Data SecurityMonitoringIntegrationCredentialsValidateData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSecurityMonitoringIntegrationCredentialsValidateRequest instantiates a new SecurityMonitoringIntegrationCredentialsValidateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSecurityMonitoringIntegrationCredentialsValidateRequest(data SecurityMonitoringIntegrationCredentialsValidateData) *SecurityMonitoringIntegrationCredentialsValidateRequest { + this := SecurityMonitoringIntegrationCredentialsValidateRequest{} + this.Data = data + return &this +} + +// NewSecurityMonitoringIntegrationCredentialsValidateRequestWithDefaults instantiates a new SecurityMonitoringIntegrationCredentialsValidateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSecurityMonitoringIntegrationCredentialsValidateRequestWithDefaults() *SecurityMonitoringIntegrationCredentialsValidateRequest { + this := SecurityMonitoringIntegrationCredentialsValidateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateRequest) GetData() SecurityMonitoringIntegrationCredentialsValidateData { + if o == nil { + var ret SecurityMonitoringIntegrationCredentialsValidateData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SecurityMonitoringIntegrationCredentialsValidateRequest) GetDataOk() (*SecurityMonitoringIntegrationCredentialsValidateData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SecurityMonitoringIntegrationCredentialsValidateRequest) SetData(v SecurityMonitoringIntegrationCredentialsValidateData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SecurityMonitoringIntegrationCredentialsValidateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SecurityMonitoringIntegrationCredentialsValidateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SecurityMonitoringIntegrationCredentialsValidateData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_security_monitoring_integration_type.go b/api/datadogV2/model_security_monitoring_integration_type.go new file mode 100644 index 00000000000..143755cca60 --- /dev/null +++ b/api/datadogV2/model_security_monitoring_integration_type.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SecurityMonitoringIntegrationType The type of external source that provides entities to Cloud SIEM. +type SecurityMonitoringIntegrationType string + +// List of SecurityMonitoringIntegrationType. +const ( + SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE SecurityMonitoringIntegrationType = "GOOGLE_WORKSPACE" + SECURITYMONITORINGINTEGRATIONTYPE_OKTA SecurityMonitoringIntegrationType = "OKTA" + SECURITYMONITORINGINTEGRATIONTYPE_ENTRA_ID SecurityMonitoringIntegrationType = "ENTRA_ID" +) + +var allowedSecurityMonitoringIntegrationTypeEnumValues = []SecurityMonitoringIntegrationType{ + SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE, + SECURITYMONITORINGINTEGRATIONTYPE_OKTA, + SECURITYMONITORINGINTEGRATIONTYPE_ENTRA_ID, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SecurityMonitoringIntegrationType) GetAllowedValues() []SecurityMonitoringIntegrationType { + return allowedSecurityMonitoringIntegrationTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SecurityMonitoringIntegrationType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SecurityMonitoringIntegrationType(value) + return nil +} + +// NewSecurityMonitoringIntegrationTypeFromValue returns a pointer to a valid SecurityMonitoringIntegrationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSecurityMonitoringIntegrationTypeFromValue(v string) (*SecurityMonitoringIntegrationType, error) { + ev := SecurityMonitoringIntegrationType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SecurityMonitoringIntegrationType: valid values are %v", v, allowedSecurityMonitoringIntegrationTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SecurityMonitoringIntegrationType) IsValid() bool { + for _, existing := range allowedSecurityMonitoringIntegrationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SecurityMonitoringIntegrationType value. +func (v SecurityMonitoringIntegrationType) Ptr() *SecurityMonitoringIntegrationType { + return &v +} diff --git a/api/datadogV2/model_security_monitoring_rule_impossible_travel_options.go b/api/datadogV2/model_security_monitoring_rule_impossible_travel_options.go index 1fcd002a910..3ae314f5811 100644 --- a/api/datadogV2/model_security_monitoring_rule_impossible_travel_options.go +++ b/api/datadogV2/model_security_monitoring_rule_impossible_travel_options.go @@ -13,6 +13,8 @@ type SecurityMonitoringRuleImpossibleTravelOptions struct { // If true, signals are suppressed for the first 24 hours. In that time, Datadog learns the user's regular // access locations. This can be helpful to reduce noise and infer VPN usage or credentialed API access. BaselineUserLocations *bool `json:"baselineUserLocations,omitempty"` + // The duration in days during which Datadog learns the user's regular access locations. After this period, signals are generated for accesses from unknown locations. + BaselineUserLocationsDuration datadog.NullableInt32 `json:"baselineUserLocationsDuration,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -63,6 +65,45 @@ func (o *SecurityMonitoringRuleImpossibleTravelOptions) SetBaselineUserLocations o.BaselineUserLocations = &v } +// GetBaselineUserLocationsDuration returns the BaselineUserLocationsDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SecurityMonitoringRuleImpossibleTravelOptions) GetBaselineUserLocationsDuration() int32 { + if o == nil || o.BaselineUserLocationsDuration.Get() == nil { + var ret int32 + return ret + } + return *o.BaselineUserLocationsDuration.Get() +} + +// GetBaselineUserLocationsDurationOk returns a tuple with the BaselineUserLocationsDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *SecurityMonitoringRuleImpossibleTravelOptions) GetBaselineUserLocationsDurationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.BaselineUserLocationsDuration.Get(), o.BaselineUserLocationsDuration.IsSet() +} + +// HasBaselineUserLocationsDuration returns a boolean if a field has been set. +func (o *SecurityMonitoringRuleImpossibleTravelOptions) HasBaselineUserLocationsDuration() bool { + return o != nil && o.BaselineUserLocationsDuration.IsSet() +} + +// SetBaselineUserLocationsDuration gets a reference to the given datadog.NullableInt32 and assigns it to the BaselineUserLocationsDuration field. +func (o *SecurityMonitoringRuleImpossibleTravelOptions) SetBaselineUserLocationsDuration(v int32) { + o.BaselineUserLocationsDuration.Set(&v) +} + +// SetBaselineUserLocationsDurationNil sets the value for BaselineUserLocationsDuration to be an explicit nil. +func (o *SecurityMonitoringRuleImpossibleTravelOptions) SetBaselineUserLocationsDurationNil() { + o.BaselineUserLocationsDuration.Set(nil) +} + +// UnsetBaselineUserLocationsDuration ensures that no value is present for BaselineUserLocationsDuration, not even an explicit nil. +func (o *SecurityMonitoringRuleImpossibleTravelOptions) UnsetBaselineUserLocationsDuration() { + o.BaselineUserLocationsDuration.Unset() +} + // MarshalJSON serializes the struct using spec logic. func (o SecurityMonitoringRuleImpossibleTravelOptions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -72,6 +113,9 @@ func (o SecurityMonitoringRuleImpossibleTravelOptions) MarshalJSON() ([]byte, er if o.BaselineUserLocations != nil { toSerialize["baselineUserLocations"] = o.BaselineUserLocations } + if o.BaselineUserLocationsDuration.IsSet() { + toSerialize["baselineUserLocationsDuration"] = o.BaselineUserLocationsDuration.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -82,18 +126,20 @@ func (o SecurityMonitoringRuleImpossibleTravelOptions) MarshalJSON() ([]byte, er // UnmarshalJSON deserializes the given payload. func (o *SecurityMonitoringRuleImpossibleTravelOptions) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BaselineUserLocations *bool `json:"baselineUserLocations,omitempty"` + BaselineUserLocations *bool `json:"baselineUserLocations,omitempty"` + BaselineUserLocationsDuration datadog.NullableInt32 `json:"baselineUserLocationsDuration,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"baselineUserLocations"}) + datadog.DeleteKeys(additionalProperties, &[]string{"baselineUserLocations", "baselineUserLocationsDuration"}) } else { return err } o.BaselineUserLocations = all.BaselineUserLocations + o.BaselineUserLocationsDuration = all.BaselineUserLocationsDuration if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_signal_entities_attributes.go b/api/datadogV2/model_signal_entities_attributes.go new file mode 100644 index 00000000000..dba790cbed3 --- /dev/null +++ b/api/datadogV2/model_signal_entities_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SignalEntitiesAttributes Attributes containing the entities related to the signal. +type SignalEntitiesAttributes struct { + // The identity entities related to the signal. Each item is a free-form object describing an identity (for example, a user or principal). + Identities []map[string]interface{} `json:"identities"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSignalEntitiesAttributes instantiates a new SignalEntitiesAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSignalEntitiesAttributes(identities []map[string]interface{}) *SignalEntitiesAttributes { + this := SignalEntitiesAttributes{} + this.Identities = identities + return &this +} + +// NewSignalEntitiesAttributesWithDefaults instantiates a new SignalEntitiesAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSignalEntitiesAttributesWithDefaults() *SignalEntitiesAttributes { + this := SignalEntitiesAttributes{} + return &this +} + +// GetIdentities returns the Identities field value. +func (o *SignalEntitiesAttributes) GetIdentities() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + return o.Identities +} + +// GetIdentitiesOk returns a tuple with the Identities field value +// and a boolean to check if the value has been set. +func (o *SignalEntitiesAttributes) GetIdentitiesOk() (*[]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.Identities, true +} + +// SetIdentities sets field value. +func (o *SignalEntitiesAttributes) SetIdentities(v []map[string]interface{}) { + o.Identities = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SignalEntitiesAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["identities"] = o.Identities + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SignalEntitiesAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Identities *[]map[string]interface{} `json:"identities"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Identities == nil { + return fmt.Errorf("required field identities missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"identities"}) + } else { + return err + } + o.Identities = *all.Identities + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_signal_entities_data.go b/api/datadogV2/model_signal_entities_data.go new file mode 100644 index 00000000000..bdcaeb63272 --- /dev/null +++ b/api/datadogV2/model_signal_entities_data.go @@ -0,0 +1,180 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SignalEntitiesData Entities related to a security signal. +type SignalEntitiesData struct { + // Attributes containing the entities related to the signal. + Attributes SignalEntitiesAttributes `json:"attributes"` + // The signal ID the entities are associated with. + Id string `json:"id"` + // The type of the resource. The value should always be `entities`. + Type SignalEntitiesType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSignalEntitiesData instantiates a new SignalEntitiesData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSignalEntitiesData(attributes SignalEntitiesAttributes, id string, typeVar SignalEntitiesType) *SignalEntitiesData { + this := SignalEntitiesData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewSignalEntitiesDataWithDefaults instantiates a new SignalEntitiesData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSignalEntitiesDataWithDefaults() *SignalEntitiesData { + this := SignalEntitiesData{} + var typeVar SignalEntitiesType = SIGNALENTITIESTYPE_ENTITIES + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *SignalEntitiesData) GetAttributes() SignalEntitiesAttributes { + if o == nil { + var ret SignalEntitiesAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SignalEntitiesData) GetAttributesOk() (*SignalEntitiesAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *SignalEntitiesData) SetAttributes(v SignalEntitiesAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *SignalEntitiesData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SignalEntitiesData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *SignalEntitiesData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *SignalEntitiesData) GetType() SignalEntitiesType { + if o == nil { + var ret SignalEntitiesType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SignalEntitiesData) GetTypeOk() (*SignalEntitiesType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *SignalEntitiesData) SetType(v SignalEntitiesType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SignalEntitiesData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SignalEntitiesData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SignalEntitiesAttributes `json:"attributes"` + Id *string `json:"id"` + Type *SignalEntitiesType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_signal_entities_response.go b/api/datadogV2/model_signal_entities_response.go new file mode 100644 index 00000000000..b65073732eb --- /dev/null +++ b/api/datadogV2/model_signal_entities_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SignalEntitiesResponse Response containing entities related to a security signal. +type SignalEntitiesResponse struct { + // Entities related to a security signal. + Data SignalEntitiesData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSignalEntitiesResponse instantiates a new SignalEntitiesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSignalEntitiesResponse(data SignalEntitiesData) *SignalEntitiesResponse { + this := SignalEntitiesResponse{} + this.Data = data + return &this +} + +// NewSignalEntitiesResponseWithDefaults instantiates a new SignalEntitiesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSignalEntitiesResponseWithDefaults() *SignalEntitiesResponse { + this := SignalEntitiesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *SignalEntitiesResponse) GetData() SignalEntitiesData { + if o == nil { + var ret SignalEntitiesData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SignalEntitiesResponse) GetDataOk() (*SignalEntitiesData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *SignalEntitiesResponse) SetData(v SignalEntitiesData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SignalEntitiesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SignalEntitiesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SignalEntitiesData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_signal_entities_type.go b/api/datadogV2/model_signal_entities_type.go new file mode 100644 index 00000000000..36a688bc11e --- /dev/null +++ b/api/datadogV2/model_signal_entities_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SignalEntitiesType The type of the resource. The value should always be `entities`. +type SignalEntitiesType string + +// List of SignalEntitiesType. +const ( + SIGNALENTITIESTYPE_ENTITIES SignalEntitiesType = "entities" +) + +var allowedSignalEntitiesTypeEnumValues = []SignalEntitiesType{ + SIGNALENTITIESTYPE_ENTITIES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SignalEntitiesType) GetAllowedValues() []SignalEntitiesType { + return allowedSignalEntitiesTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SignalEntitiesType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SignalEntitiesType(value) + return nil +} + +// NewSignalEntitiesTypeFromValue returns a pointer to a valid SignalEntitiesType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSignalEntitiesTypeFromValue(v string) (*SignalEntitiesType, error) { + ev := SignalEntitiesType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SignalEntitiesType: valid values are %v", v, allowedSignalEntitiesTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SignalEntitiesType) IsValid() bool { + for _, existing := range allowedSignalEntitiesTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SignalEntitiesType value. +func (v SignalEntitiesType) Ptr() *SignalEntitiesType { + return &v +} diff --git a/api/datadogV2/model_single_aggregated_connection_response_data_attributes.go b/api/datadogV2/model_single_aggregated_connection_response_data_attributes.go index 2d223ff3576..94652b4ad98 100644 --- a/api/datadogV2/model_single_aggregated_connection_response_data_attributes.go +++ b/api/datadogV2/model_single_aggregated_connection_response_data_attributes.go @@ -24,14 +24,26 @@ type SingleAggregatedConnectionResponseDataAttributes struct { RttMicroSeconds *int64 `json:"rtt_micro_seconds,omitempty"` // The number of TCP connections in a closed state. Measured in connections per second from the client. TcpClosedConnections *int64 `json:"tcp_closed_connections,omitempty"` + // The number of TCP segments acknowledged with the ECN Congestion Experienced (CE) mark, indicating that an upstream router marked packets as experiencing congestion. + TcpDeliveredCe *int64 `json:"tcp_delivered_ce,omitempty"` // The number of TCP connections in an established state. Measured in connections per second from the client. TcpEstablishedConnections *int64 `json:"tcp_established_connections,omitempty"` + // The number of TCP zero-window probes sent. These probes are sent when the receiver advertises a zero receive window, indicating it cannot accept more data. + TcpProbe0Count *int64 `json:"tcp_probe0_count,omitempty"` + // The number of TCP packets received out of order. This indicates network-level packet reordering, which can degrade TCP performance by triggering spurious retransmissions and reducing throughput. + TcpRcvOooPack *int64 `json:"tcp_rcv_ooo_pack,omitempty"` + // The number of TCP fast recovery events. Fast recovery retransmits lost segments detected through duplicate ACKs or selective acknowledgment (SACK) without waiting for a retransmission timeout. + TcpRecoveryCount *int64 `json:"tcp_recovery_count,omitempty"` // The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration. TcpRefusals *int64 `json:"tcp_refusals,omitempty"` + // The number of times reordering of sent packets was detected. Reordering detection adjusts the duplicate ACK threshold, preventing spurious retransmissions caused by out-of-order delivery. + TcpReordSeen *int64 `json:"tcp_reord_seen,omitempty"` // The number of TCP connections that were reset by the server. TcpResets *int64 `json:"tcp_resets,omitempty"` // TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client. TcpRetransmits *int64 `json:"tcp_retransmits,omitempty"` + // The number of TCP retransmission timeouts (RTOs). An RTO occurs when an ACK is not received within the estimated round-trip time, forcing the sender to retransmit and halve its congestion window. + TcpRtoCount *int64 `json:"tcp_rto_count,omitempty"` // The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues. TcpTimeouts *int64 `json:"tcp_timeouts,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -252,6 +264,34 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpClosedConnectio o.TcpClosedConnections = &v } +// GetTcpDeliveredCe returns the TcpDeliveredCe field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpDeliveredCe() int64 { + if o == nil || o.TcpDeliveredCe == nil { + var ret int64 + return ret + } + return *o.TcpDeliveredCe +} + +// GetTcpDeliveredCeOk returns a tuple with the TcpDeliveredCe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpDeliveredCeOk() (*int64, bool) { + if o == nil || o.TcpDeliveredCe == nil { + return nil, false + } + return o.TcpDeliveredCe, true +} + +// HasTcpDeliveredCe returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpDeliveredCe() bool { + return o != nil && o.TcpDeliveredCe != nil +} + +// SetTcpDeliveredCe gets a reference to the given int64 and assigns it to the TcpDeliveredCe field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpDeliveredCe(v int64) { + o.TcpDeliveredCe = &v +} + // GetTcpEstablishedConnections returns the TcpEstablishedConnections field value if set, zero value otherwise. func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpEstablishedConnections() int64 { if o == nil || o.TcpEstablishedConnections == nil { @@ -280,6 +320,90 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpEstablishedConn o.TcpEstablishedConnections = &v } +// GetTcpProbe0Count returns the TcpProbe0Count field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpProbe0Count() int64 { + if o == nil || o.TcpProbe0Count == nil { + var ret int64 + return ret + } + return *o.TcpProbe0Count +} + +// GetTcpProbe0CountOk returns a tuple with the TcpProbe0Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpProbe0CountOk() (*int64, bool) { + if o == nil || o.TcpProbe0Count == nil { + return nil, false + } + return o.TcpProbe0Count, true +} + +// HasTcpProbe0Count returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpProbe0Count() bool { + return o != nil && o.TcpProbe0Count != nil +} + +// SetTcpProbe0Count gets a reference to the given int64 and assigns it to the TcpProbe0Count field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpProbe0Count(v int64) { + o.TcpProbe0Count = &v +} + +// GetTcpRcvOooPack returns the TcpRcvOooPack field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRcvOooPack() int64 { + if o == nil || o.TcpRcvOooPack == nil { + var ret int64 + return ret + } + return *o.TcpRcvOooPack +} + +// GetTcpRcvOooPackOk returns a tuple with the TcpRcvOooPack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRcvOooPackOk() (*int64, bool) { + if o == nil || o.TcpRcvOooPack == nil { + return nil, false + } + return o.TcpRcvOooPack, true +} + +// HasTcpRcvOooPack returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpRcvOooPack() bool { + return o != nil && o.TcpRcvOooPack != nil +} + +// SetTcpRcvOooPack gets a reference to the given int64 and assigns it to the TcpRcvOooPack field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpRcvOooPack(v int64) { + o.TcpRcvOooPack = &v +} + +// GetTcpRecoveryCount returns the TcpRecoveryCount field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRecoveryCount() int64 { + if o == nil || o.TcpRecoveryCount == nil { + var ret int64 + return ret + } + return *o.TcpRecoveryCount +} + +// GetTcpRecoveryCountOk returns a tuple with the TcpRecoveryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRecoveryCountOk() (*int64, bool) { + if o == nil || o.TcpRecoveryCount == nil { + return nil, false + } + return o.TcpRecoveryCount, true +} + +// HasTcpRecoveryCount returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpRecoveryCount() bool { + return o != nil && o.TcpRecoveryCount != nil +} + +// SetTcpRecoveryCount gets a reference to the given int64 and assigns it to the TcpRecoveryCount field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpRecoveryCount(v int64) { + o.TcpRecoveryCount = &v +} + // GetTcpRefusals returns the TcpRefusals field value if set, zero value otherwise. func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRefusals() int64 { if o == nil || o.TcpRefusals == nil { @@ -308,6 +432,34 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpRefusals(v int6 o.TcpRefusals = &v } +// GetTcpReordSeen returns the TcpReordSeen field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpReordSeen() int64 { + if o == nil || o.TcpReordSeen == nil { + var ret int64 + return ret + } + return *o.TcpReordSeen +} + +// GetTcpReordSeenOk returns a tuple with the TcpReordSeen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpReordSeenOk() (*int64, bool) { + if o == nil || o.TcpReordSeen == nil { + return nil, false + } + return o.TcpReordSeen, true +} + +// HasTcpReordSeen returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpReordSeen() bool { + return o != nil && o.TcpReordSeen != nil +} + +// SetTcpReordSeen gets a reference to the given int64 and assigns it to the TcpReordSeen field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpReordSeen(v int64) { + o.TcpReordSeen = &v +} + // GetTcpResets returns the TcpResets field value if set, zero value otherwise. func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpResets() int64 { if o == nil || o.TcpResets == nil { @@ -364,6 +516,34 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpRetransmits(v i o.TcpRetransmits = &v } +// GetTcpRtoCount returns the TcpRtoCount field value if set, zero value otherwise. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRtoCount() int64 { + if o == nil || o.TcpRtoCount == nil { + var ret int64 + return ret + } + return *o.TcpRtoCount +} + +// GetTcpRtoCountOk returns a tuple with the TcpRtoCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpRtoCountOk() (*int64, bool) { + if o == nil || o.TcpRtoCount == nil { + return nil, false + } + return o.TcpRtoCount, true +} + +// HasTcpRtoCount returns a boolean if a field has been set. +func (o *SingleAggregatedConnectionResponseDataAttributes) HasTcpRtoCount() bool { + return o != nil && o.TcpRtoCount != nil +} + +// SetTcpRtoCount gets a reference to the given int64 and assigns it to the TcpRtoCount field. +func (o *SingleAggregatedConnectionResponseDataAttributes) SetTcpRtoCount(v int64) { + o.TcpRtoCount = &v +} + // GetTcpTimeouts returns the TcpTimeouts field value if set, zero value otherwise. func (o *SingleAggregatedConnectionResponseDataAttributes) GetTcpTimeouts() int64 { if o == nil || o.TcpTimeouts == nil { @@ -419,18 +599,36 @@ func (o SingleAggregatedConnectionResponseDataAttributes) MarshalJSON() ([]byte, if o.TcpClosedConnections != nil { toSerialize["tcp_closed_connections"] = o.TcpClosedConnections } + if o.TcpDeliveredCe != nil { + toSerialize["tcp_delivered_ce"] = o.TcpDeliveredCe + } if o.TcpEstablishedConnections != nil { toSerialize["tcp_established_connections"] = o.TcpEstablishedConnections } + if o.TcpProbe0Count != nil { + toSerialize["tcp_probe0_count"] = o.TcpProbe0Count + } + if o.TcpRcvOooPack != nil { + toSerialize["tcp_rcv_ooo_pack"] = o.TcpRcvOooPack + } + if o.TcpRecoveryCount != nil { + toSerialize["tcp_recovery_count"] = o.TcpRecoveryCount + } if o.TcpRefusals != nil { toSerialize["tcp_refusals"] = o.TcpRefusals } + if o.TcpReordSeen != nil { + toSerialize["tcp_reord_seen"] = o.TcpReordSeen + } if o.TcpResets != nil { toSerialize["tcp_resets"] = o.TcpResets } if o.TcpRetransmits != nil { toSerialize["tcp_retransmits"] = o.TcpRetransmits } + if o.TcpRtoCount != nil { + toSerialize["tcp_rto_count"] = o.TcpRtoCount + } if o.TcpTimeouts != nil { toSerialize["tcp_timeouts"] = o.TcpTimeouts } @@ -451,10 +649,16 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) UnmarshalJSON(bytes [ PacketsSentByServer *int64 `json:"packets_sent_by_server,omitempty"` RttMicroSeconds *int64 `json:"rtt_micro_seconds,omitempty"` TcpClosedConnections *int64 `json:"tcp_closed_connections,omitempty"` + TcpDeliveredCe *int64 `json:"tcp_delivered_ce,omitempty"` TcpEstablishedConnections *int64 `json:"tcp_established_connections,omitempty"` + TcpProbe0Count *int64 `json:"tcp_probe0_count,omitempty"` + TcpRcvOooPack *int64 `json:"tcp_rcv_ooo_pack,omitempty"` + TcpRecoveryCount *int64 `json:"tcp_recovery_count,omitempty"` TcpRefusals *int64 `json:"tcp_refusals,omitempty"` + TcpReordSeen *int64 `json:"tcp_reord_seen,omitempty"` TcpResets *int64 `json:"tcp_resets,omitempty"` TcpRetransmits *int64 `json:"tcp_retransmits,omitempty"` + TcpRtoCount *int64 `json:"tcp_rto_count,omitempty"` TcpTimeouts *int64 `json:"tcp_timeouts,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -462,7 +666,7 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) UnmarshalJSON(bytes [ } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"bytes_sent_by_client", "bytes_sent_by_server", "group_bys", "packets_sent_by_client", "packets_sent_by_server", "rtt_micro_seconds", "tcp_closed_connections", "tcp_established_connections", "tcp_refusals", "tcp_resets", "tcp_retransmits", "tcp_timeouts"}) + datadog.DeleteKeys(additionalProperties, &[]string{"bytes_sent_by_client", "bytes_sent_by_server", "group_bys", "packets_sent_by_client", "packets_sent_by_server", "rtt_micro_seconds", "tcp_closed_connections", "tcp_delivered_ce", "tcp_established_connections", "tcp_probe0_count", "tcp_rcv_ooo_pack", "tcp_recovery_count", "tcp_refusals", "tcp_reord_seen", "tcp_resets", "tcp_retransmits", "tcp_rto_count", "tcp_timeouts"}) } else { return err } @@ -473,10 +677,16 @@ func (o *SingleAggregatedConnectionResponseDataAttributes) UnmarshalJSON(bytes [ o.PacketsSentByServer = all.PacketsSentByServer o.RttMicroSeconds = all.RttMicroSeconds o.TcpClosedConnections = all.TcpClosedConnections + o.TcpDeliveredCe = all.TcpDeliveredCe o.TcpEstablishedConnections = all.TcpEstablishedConnections + o.TcpProbe0Count = all.TcpProbe0Count + o.TcpRcvOooPack = all.TcpRcvOooPack + o.TcpRecoveryCount = all.TcpRecoveryCount o.TcpRefusals = all.TcpRefusals + o.TcpReordSeen = all.TcpReordSeen o.TcpResets = all.TcpResets o.TcpRetransmits = all.TcpRetransmits + o.TcpRtoCount = all.TcpRtoCount o.TcpTimeouts = all.TcpTimeouts if len(additionalProperties) > 0 { diff --git a/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_request.go b/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_request.go index 35c7fe61d46..436f481cc18 100644 --- a/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_request.go +++ b/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_request.go @@ -18,6 +18,8 @@ type SyntheticsDowntimeTimeSlotRecurrenceRequest struct { Frequency SyntheticsDowntimeFrequency `json:"frequency"` // The interval between recurrences, relative to the frequency. Interval *int64 `json:"interval,omitempty"` + // Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month". + WeekdayPositions []SyntheticsDowntimeWeekdayPosition `json:"weekdayPositions,omitempty"` // Days of the week for a Synthetics downtime recurrence schedule. Weekdays []SyntheticsDowntimeWeekday `json:"weekdays,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -122,6 +124,34 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) SetInterval(v int64) { o.Interval = &v } +// GetWeekdayPositions returns the WeekdayPositions field value if set, zero value otherwise. +func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) GetWeekdayPositions() []SyntheticsDowntimeWeekdayPosition { + if o == nil || o.WeekdayPositions == nil { + var ret []SyntheticsDowntimeWeekdayPosition + return ret + } + return o.WeekdayPositions +} + +// GetWeekdayPositionsOk returns a tuple with the WeekdayPositions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) GetWeekdayPositionsOk() (*[]SyntheticsDowntimeWeekdayPosition, bool) { + if o == nil || o.WeekdayPositions == nil { + return nil, false + } + return &o.WeekdayPositions, true +} + +// HasWeekdayPositions returns a boolean if a field has been set. +func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) HasWeekdayPositions() bool { + return o != nil && o.WeekdayPositions != nil +} + +// SetWeekdayPositions gets a reference to the given []SyntheticsDowntimeWeekdayPosition and assigns it to the WeekdayPositions field. +func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) SetWeekdayPositions(v []SyntheticsDowntimeWeekdayPosition) { + o.WeekdayPositions = v +} + // GetWeekdays returns the Weekdays field value if set, zero value otherwise. func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) GetWeekdays() []SyntheticsDowntimeWeekday { if o == nil || o.Weekdays == nil { @@ -163,6 +193,9 @@ func (o SyntheticsDowntimeTimeSlotRecurrenceRequest) MarshalJSON() ([]byte, erro if o.Interval != nil { toSerialize["interval"] = o.Interval } + if o.WeekdayPositions != nil { + toSerialize["weekdayPositions"] = o.WeekdayPositions + } if o.Weekdays != nil { toSerialize["weekdays"] = o.Weekdays } @@ -176,10 +209,11 @@ func (o SyntheticsDowntimeTimeSlotRecurrenceRequest) MarshalJSON() ([]byte, erro // UnmarshalJSON deserializes the given payload. func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) UnmarshalJSON(bytes []byte) (err error) { all := struct { - End *SyntheticsDowntimeTimeSlotDate `json:"end,omitempty"` - Frequency *SyntheticsDowntimeFrequency `json:"frequency"` - Interval *int64 `json:"interval,omitempty"` - Weekdays []SyntheticsDowntimeWeekday `json:"weekdays,omitempty"` + End *SyntheticsDowntimeTimeSlotDate `json:"end,omitempty"` + Frequency *SyntheticsDowntimeFrequency `json:"frequency"` + Interval *int64 `json:"interval,omitempty"` + WeekdayPositions []SyntheticsDowntimeWeekdayPosition `json:"weekdayPositions,omitempty"` + Weekdays []SyntheticsDowntimeWeekday `json:"weekdays,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -189,7 +223,7 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) UnmarshalJSON(bytes []byte } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"end", "frequency", "interval", "weekdays"}) + datadog.DeleteKeys(additionalProperties, &[]string{"end", "frequency", "interval", "weekdayPositions", "weekdays"}) } else { return err } @@ -205,6 +239,7 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceRequest) UnmarshalJSON(bytes []byte o.Frequency = *all.Frequency } o.Interval = all.Interval + o.WeekdayPositions = all.WeekdayPositions o.Weekdays = all.Weekdays if len(additionalProperties) > 0 { diff --git a/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_response.go b/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_response.go index 10f2d557172..158c257fe86 100644 --- a/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_response.go +++ b/api/datadogV2/model_synthetics_downtime_time_slot_recurrence_response.go @@ -18,6 +18,8 @@ type SyntheticsDowntimeTimeSlotRecurrenceResponse struct { Interval int64 `json:"interval"` // A specific date and time used to define the start or end of a Synthetics downtime time slot. Until *SyntheticsDowntimeTimeSlotDate `json:"until,omitempty"` + // Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month". + WeekdayPositions []SyntheticsDowntimeWeekdayPosition `json:"weekdayPositions,omitempty"` // Days of the week for a Synthetics downtime recurrence schedule. Weekdays []SyntheticsDowntimeWeekday `json:"weekdays"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -119,6 +121,34 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) SetUntil(v SyntheticsDown o.Until = &v } +// GetWeekdayPositions returns the WeekdayPositions field value if set, zero value otherwise. +func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) GetWeekdayPositions() []SyntheticsDowntimeWeekdayPosition { + if o == nil || o.WeekdayPositions == nil { + var ret []SyntheticsDowntimeWeekdayPosition + return ret + } + return o.WeekdayPositions +} + +// GetWeekdayPositionsOk returns a tuple with the WeekdayPositions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) GetWeekdayPositionsOk() (*[]SyntheticsDowntimeWeekdayPosition, bool) { + if o == nil || o.WeekdayPositions == nil { + return nil, false + } + return &o.WeekdayPositions, true +} + +// HasWeekdayPositions returns a boolean if a field has been set. +func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) HasWeekdayPositions() bool { + return o != nil && o.WeekdayPositions != nil +} + +// SetWeekdayPositions gets a reference to the given []SyntheticsDowntimeWeekdayPosition and assigns it to the WeekdayPositions field. +func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) SetWeekdayPositions(v []SyntheticsDowntimeWeekdayPosition) { + o.WeekdayPositions = v +} + // GetWeekdays returns the Weekdays field value. func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) GetWeekdays() []SyntheticsDowntimeWeekday { if o == nil { @@ -153,6 +183,9 @@ func (o SyntheticsDowntimeTimeSlotRecurrenceResponse) MarshalJSON() ([]byte, err if o.Until != nil { toSerialize["until"] = o.Until } + if o.WeekdayPositions != nil { + toSerialize["weekdayPositions"] = o.WeekdayPositions + } toSerialize["weekdays"] = o.Weekdays for key, value := range o.AdditionalProperties { @@ -164,10 +197,11 @@ func (o SyntheticsDowntimeTimeSlotRecurrenceResponse) MarshalJSON() ([]byte, err // UnmarshalJSON deserializes the given payload. func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Frequency *SyntheticsDowntimeFrequency `json:"frequency"` - Interval *int64 `json:"interval"` - Until *SyntheticsDowntimeTimeSlotDate `json:"until,omitempty"` - Weekdays *[]SyntheticsDowntimeWeekday `json:"weekdays"` + Frequency *SyntheticsDowntimeFrequency `json:"frequency"` + Interval *int64 `json:"interval"` + Until *SyntheticsDowntimeTimeSlotDate `json:"until,omitempty"` + WeekdayPositions []SyntheticsDowntimeWeekdayPosition `json:"weekdayPositions,omitempty"` + Weekdays *[]SyntheticsDowntimeWeekday `json:"weekdays"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -183,7 +217,7 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) UnmarshalJSON(bytes []byt } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"frequency", "interval", "until", "weekdays"}) + datadog.DeleteKeys(additionalProperties, &[]string{"frequency", "interval", "until", "weekdayPositions", "weekdays"}) } else { return err } @@ -199,6 +233,7 @@ func (o *SyntheticsDowntimeTimeSlotRecurrenceResponse) UnmarshalJSON(bytes []byt hasInvalidField = true } o.Until = all.Until + o.WeekdayPositions = all.WeekdayPositions o.Weekdays = *all.Weekdays if len(additionalProperties) > 0 { diff --git a/api/datadogV2/model_synthetics_downtime_weekday_position.go b/api/datadogV2/model_synthetics_downtime_weekday_position.go new file mode 100644 index 00000000000..9bf39c82337 --- /dev/null +++ b/api/datadogV2/model_synthetics_downtime_weekday_position.go @@ -0,0 +1,72 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsDowntimeWeekdayPosition The position of a weekday within a month for a monthly Synthetics downtime recurrence. `1` through `4` select the first through fourth occurrence of the weekday in the month, and `-1` selects the last occurrence. +type SyntheticsDowntimeWeekdayPosition int64 + +// List of SyntheticsDowntimeWeekdayPosition. +const ( + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_FIRST SyntheticsDowntimeWeekdayPosition = 1 + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_SECOND SyntheticsDowntimeWeekdayPosition = 2 + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_THIRD SyntheticsDowntimeWeekdayPosition = 3 + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_FOURTH SyntheticsDowntimeWeekdayPosition = 4 + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_LAST SyntheticsDowntimeWeekdayPosition = -1 +) + +var allowedSyntheticsDowntimeWeekdayPositionEnumValues = []SyntheticsDowntimeWeekdayPosition{ + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_FIRST, + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_SECOND, + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_THIRD, + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_FOURTH, + SYNTHETICSDOWNTIMEWEEKDAYPOSITION_LAST, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsDowntimeWeekdayPosition) GetAllowedValues() []SyntheticsDowntimeWeekdayPosition { + return allowedSyntheticsDowntimeWeekdayPositionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsDowntimeWeekdayPosition) UnmarshalJSON(src []byte) error { + var value int64 + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsDowntimeWeekdayPosition(value) + return nil +} + +// NewSyntheticsDowntimeWeekdayPositionFromValue returns a pointer to a valid SyntheticsDowntimeWeekdayPosition +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsDowntimeWeekdayPositionFromValue(v int64) (*SyntheticsDowntimeWeekdayPosition, error) { + ev := SyntheticsDowntimeWeekdayPosition(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsDowntimeWeekdayPosition: valid values are %v", v, allowedSyntheticsDowntimeWeekdayPositionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsDowntimeWeekdayPosition) IsValid() bool { + for _, existing := range allowedSyntheticsDowntimeWeekdayPositionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsDowntimeWeekdayPosition value. +func (v SyntheticsDowntimeWeekdayPosition) Ptr() *SyntheticsDowntimeWeekdayPosition { + return &v +} diff --git a/api/datadogV2/model_tag_data.go b/api/datadogV2/model_tag_data.go new file mode 100644 index 00000000000..3b48568634c --- /dev/null +++ b/api/datadogV2/model_tag_data.go @@ -0,0 +1,143 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// TagData A tag resource associated with an app. +type TagData struct { + // The name of the tag. + Id string `json:"id"` + // The resource type for a tag. + Type TagDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewTagData instantiates a new TagData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewTagData(id string, typeVar TagDataType) *TagData { + this := TagData{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewTagDataWithDefaults instantiates a new TagData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewTagDataWithDefaults() *TagData { + this := TagData{} + return &this +} + +// GetId returns the Id field value. +func (o *TagData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TagData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *TagData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *TagData) GetType() TagDataType { + if o == nil { + var ret TagDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TagData) GetTypeOk() (*TagDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *TagData) SetType(v TagDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o TagData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *TagData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *TagDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_tag_data_type.go b/api/datadogV2/model_tag_data_type.go new file mode 100644 index 00000000000..4af780eb049 --- /dev/null +++ b/api/datadogV2/model_tag_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// TagDataType The resource type for a tag. +type TagDataType string + +// List of TagDataType. +const ( + TAGDATATYPE_TAG TagDataType = "tag" +) + +var allowedTagDataTypeEnumValues = []TagDataType{ + TAGDATATYPE_TAG, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *TagDataType) GetAllowedValues() []TagDataType { + return allowedTagDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *TagDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = TagDataType(value) + return nil +} + +// NewTagDataTypeFromValue returns a pointer to a valid TagDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewTagDataTypeFromValue(v string) (*TagDataType, error) { + ev := TagDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for TagDataType: valid values are %v", v, allowedTagDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v TagDataType) IsValid() bool { + for _, existing := range allowedTagDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TagDataType value. +func (v TagDataType) Ptr() *TagDataType { + return &v +} diff --git a/api/datadogV2/model_team_routing_rules_request_rule.go b/api/datadogV2/model_team_routing_rules_request_rule.go index 6b86f9d8aa9..ec6f02afdee 100644 --- a/api/datadogV2/model_team_routing_rules_request_rule.go +++ b/api/datadogV2/model_team_routing_rules_request_rule.go @@ -16,7 +16,7 @@ type TeamRoutingRulesRequestRule struct { PolicyId *string `json:"policy_id,omitempty"` // Defines the query or condition that triggers this routing rule. Query *string `json:"query,omitempty"` - // Holds time zone information and a list of time restrictions for a routing rule. + // Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field. TimeRestriction *TimeRestrictions `json:"time_restriction,omitempty"` // Specifies the level of urgency for a routing rule (low, high, or dynamic). Urgency *Urgency `json:"urgency,omitempty"` diff --git a/api/datadogV2/model_test_example.go b/api/datadogV2/model_test_example.go new file mode 100644 index 00000000000..bb341430f69 --- /dev/null +++ b/api/datadogV2/model_test_example.go @@ -0,0 +1,173 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// TestExample A test example resource. +type TestExample struct { + // Creation time of the test example. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The ID of the test example. + Id string `json:"id"` + // The name of the test example. + Name string `json:"name"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewTestExample instantiates a new TestExample object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewTestExample(id string, name string) *TestExample { + this := TestExample{} + this.Id = id + this.Name = name + return &this +} + +// NewTestExampleWithDefaults instantiates a new TestExample object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewTestExampleWithDefaults() *TestExample { + this := TestExample{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *TestExample) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestExample) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *TestExample) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *TestExample) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value. +func (o *TestExample) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TestExample) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *TestExample) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *TestExample) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TestExample) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *TestExample) SetName(v string) { + o.Name = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o TestExample) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *TestExample) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Id *string `json:"id"` + Name *string `json:"name"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "id", "name"}) + } else { + return err + } + o.CreatedAt = all.CreatedAt + o.Id = *all.Id + o.Name = *all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_test_examples_response.go b/api/datadogV2/model_test_examples_response.go new file mode 100644 index 00000000000..e8a05430349 --- /dev/null +++ b/api/datadogV2/model_test_examples_response.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// TestExamplesResponse Response containing a list of test examples. +type TestExamplesResponse struct { + // + Data []TestExample `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewTestExamplesResponse instantiates a new TestExamplesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewTestExamplesResponse() *TestExamplesResponse { + this := TestExamplesResponse{} + return &this +} + +// NewTestExamplesResponseWithDefaults instantiates a new TestExamplesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewTestExamplesResponseWithDefaults() *TestExamplesResponse { + this := TestExamplesResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *TestExamplesResponse) GetData() []TestExample { + if o == nil || o.Data == nil { + var ret []TestExample + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestExamplesResponse) GetDataOk() (*[]TestExample, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *TestExamplesResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []TestExample and assigns it to the Data field. +func (o *TestExamplesResponse) SetData(v []TestExample) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o TestExamplesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *TestExamplesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []TestExample `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_time_restrictions.go b/api/datadogV2/model_time_restrictions.go index 991cdc64982..104fe456b82 100644 --- a/api/datadogV2/model_time_restrictions.go +++ b/api/datadogV2/model_time_restrictions.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimeRestrictions Holds time zone information and a list of time restrictions for a routing rule. +// TimeRestrictions Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field. type TimeRestrictions struct { // Defines the list of time-based restrictions. Restrictions []TimeRestriction `json:"restrictions"` diff --git a/api/datadogV2/model_timeline_cell.go b/api/datadogV2/model_timeline_cell.go index e8786fe2bd7..bc6a10a654b 100644 --- a/api/datadogV2/model_timeline_cell.go +++ b/api/datadogV2/model_timeline_cell.go @@ -10,11 +10,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCell timeline cell +// TimelineCell Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update). type TimelineCell struct { - // author of the timeline cell + // The author of the timeline cell. Currently only user authors are supported. Author *TimelineCellAuthor `json:"author,omitempty"` - // timeline cell content + // The content payload of a timeline cell, varying by cell type. CellContent *TimelineCellContent `json:"cell_content,omitempty"` // Timestamp of when the cell was created CreatedAt *time.Time `json:"created_at,omitempty"` @@ -22,7 +22,7 @@ type TimelineCell struct { DeletedAt *time.Time `json:"deleted_at,omitempty"` // Timestamp of when the cell was last modified ModifiedAt *time.Time `json:"modified_at,omitempty"` - // Timeline cell content type + // The type of content in the timeline cell. Currently only `COMMENT` is supported in this endpoint. Type *TimelineCellType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_timeline_cell_author.go b/api/datadogV2/model_timeline_cell_author.go index 6b8b6519b44..a2b30d99e46 100644 --- a/api/datadogV2/model_timeline_cell_author.go +++ b/api/datadogV2/model_timeline_cell_author.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellAuthor - author of the timeline cell +// TimelineCellAuthor - The author of the timeline cell. Currently only user authors are supported. type TimelineCellAuthor struct { TimelineCellAuthorUser *TimelineCellAuthorUser diff --git a/api/datadogV2/model_timeline_cell_author_user.go b/api/datadogV2/model_timeline_cell_author_user.go index 5e72edd729e..0a2acc99dc6 100644 --- a/api/datadogV2/model_timeline_cell_author_user.go +++ b/api/datadogV2/model_timeline_cell_author_user.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellAuthorUser timeline cell user author +// TimelineCellAuthorUser A user who authored a timeline cell. type TimelineCellAuthorUser struct { - // user author content. + // Profile information for the user who authored the timeline cell. Content *TimelineCellAuthorUserContent `json:"content,omitempty"` - // user author type. + // The type of timeline cell author. Currently only `USER` is supported. Type *TimelineCellAuthorUserType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_timeline_cell_author_user_content.go b/api/datadogV2/model_timeline_cell_author_user_content.go index 50daff10599..95562b2f800 100644 --- a/api/datadogV2/model_timeline_cell_author_user_content.go +++ b/api/datadogV2/model_timeline_cell_author_user_content.go @@ -8,15 +8,15 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellAuthorUserContent user author content. +// TimelineCellAuthorUserContent Profile information for the user who authored the timeline cell. type TimelineCellAuthorUserContent struct { - // user email + // The email address of the user. Email *string `json:"email,omitempty"` - // user handle + // The Datadog handle of the user. Handle *string `json:"handle,omitempty"` - // user UUID + // The UUID of the user. Id *string `json:"id,omitempty"` - // user name + // The display name of the user. Name *string `json:"name,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_timeline_cell_author_user_type.go b/api/datadogV2/model_timeline_cell_author_user_type.go index f4a9aa8a864..cedcaa3ddad 100644 --- a/api/datadogV2/model_timeline_cell_author_user_type.go +++ b/api/datadogV2/model_timeline_cell_author_user_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellAuthorUserType user author type. +// TimelineCellAuthorUserType The type of timeline cell author. Currently only `USER` is supported. type TimelineCellAuthorUserType string // List of TimelineCellAuthorUserType. diff --git a/api/datadogV2/model_timeline_cell_content.go b/api/datadogV2/model_timeline_cell_content.go index c1d17e6acbb..26d12041609 100644 --- a/api/datadogV2/model_timeline_cell_content.go +++ b/api/datadogV2/model_timeline_cell_content.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellContent - timeline cell content +// TimelineCellContent - The content payload of a timeline cell, varying by cell type. type TimelineCellContent struct { TimelineCellContentComment *TimelineCellContentComment diff --git a/api/datadogV2/model_timeline_cell_content_comment.go b/api/datadogV2/model_timeline_cell_content_comment.go index 2e97da9c9e3..b6e316a25a5 100644 --- a/api/datadogV2/model_timeline_cell_content_comment.go +++ b/api/datadogV2/model_timeline_cell_content_comment.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellContentComment comment content +// TimelineCellContentComment The content of a comment timeline cell. type TimelineCellContentComment struct { - // comment message + // The text content of the comment. Supports Markdown formatting. Message *string `json:"message,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_timeline_cell_resource.go b/api/datadogV2/model_timeline_cell_resource.go index 6ebb74e0d5f..696f84a08c8 100644 --- a/api/datadogV2/model_timeline_cell_resource.go +++ b/api/datadogV2/model_timeline_cell_resource.go @@ -10,13 +10,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellResource Timeline cell JSON:API resource +// TimelineCellResource A timeline cell resource representing a single entry in a case's activity timeline. type TimelineCellResource struct { - // timeline cell + // Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update). Attributes TimelineCell `json:"attributes"` // Timeline cell's identifier Id string `json:"id"` - // Timeline cell JSON:API resource type + // JSON:API resource type for timeline cells. Type TimelineCellResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_timeline_cell_resource_type.go b/api/datadogV2/model_timeline_cell_resource_type.go index be2b529f618..7835e1291fd 100644 --- a/api/datadogV2/model_timeline_cell_resource_type.go +++ b/api/datadogV2/model_timeline_cell_resource_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellResourceType Timeline cell JSON:API resource type +// TimelineCellResourceType JSON:API resource type for timeline cells. type TimelineCellResourceType string // List of TimelineCellResourceType. diff --git a/api/datadogV2/model_timeline_cell_type.go b/api/datadogV2/model_timeline_cell_type.go index 3040c7698db..15728151ac9 100644 --- a/api/datadogV2/model_timeline_cell_type.go +++ b/api/datadogV2/model_timeline_cell_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineCellType Timeline cell content type +// TimelineCellType The type of content in the timeline cell. Currently only `COMMENT` is supported in this endpoint. type TimelineCellType string // List of TimelineCellType. diff --git a/api/datadogV2/model_timeline_response.go b/api/datadogV2/model_timeline_response.go index 7719c4a9442..4273c523d28 100644 --- a/api/datadogV2/model_timeline_response.go +++ b/api/datadogV2/model_timeline_response.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// TimelineResponse Timeline response +// TimelineResponse Response containing the chronological list of timeline cells for a case. type TimelineResponse struct { // The `TimelineResponse` `data`. Data []TimelineCellResource `json:"data,omitempty"` diff --git a/api/datadogV2/model_transport_webhook_log.go b/api/datadogV2/model_transport_webhook_log.go deleted file mode 100644 index 7342e148703..00000000000 --- a/api/datadogV2/model_transport_webhook_log.go +++ /dev/null @@ -1,275 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - "time" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLog A single email transport webhook log event. -type TransportWebhookLog struct { - // Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. - Attributes TransportWebhookLogAttributes `json:"attributes"` - // The ISO 8601 timestamp of the event. - Date time.Time `json:"date"` - // The unique log event identifier. - LogId string `json:"log_id"` - // The email transport provider. - Source string `json:"source"` - // The log status level. - Status string `json:"status"` - // A list of tags associated with the event. - Tags []string `json:"tags"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLog instantiates a new TransportWebhookLog object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLog(attributes TransportWebhookLogAttributes, date time.Time, logId string, source string, status string, tags []string) *TransportWebhookLog { - this := TransportWebhookLog{} - this.Attributes = attributes - this.Date = date - this.LogId = logId - this.Source = source - this.Status = status - this.Tags = tags - return &this -} - -// NewTransportWebhookLogWithDefaults instantiates a new TransportWebhookLog object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogWithDefaults() *TransportWebhookLog { - this := TransportWebhookLog{} - return &this -} - -// GetAttributes returns the Attributes field value. -func (o *TransportWebhookLog) GetAttributes() TransportWebhookLogAttributes { - if o == nil { - var ret TransportWebhookLogAttributes - return ret - } - return o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetAttributesOk() (*TransportWebhookLogAttributes, bool) { - if o == nil { - return nil, false - } - return &o.Attributes, true -} - -// SetAttributes sets field value. -func (o *TransportWebhookLog) SetAttributes(v TransportWebhookLogAttributes) { - o.Attributes = v -} - -// GetDate returns the Date field value. -func (o *TransportWebhookLog) GetDate() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.Date -} - -// GetDateOk returns a tuple with the Date field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Date, true -} - -// SetDate sets field value. -func (o *TransportWebhookLog) SetDate(v time.Time) { - o.Date = v -} - -// GetLogId returns the LogId field value. -func (o *TransportWebhookLog) GetLogId() string { - if o == nil { - var ret string - return ret - } - return o.LogId -} - -// GetLogIdOk returns a tuple with the LogId field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetLogIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LogId, true -} - -// SetLogId sets field value. -func (o *TransportWebhookLog) SetLogId(v string) { - o.LogId = v -} - -// GetSource returns the Source field value. -func (o *TransportWebhookLog) GetSource() string { - if o == nil { - var ret string - return ret - } - return o.Source -} - -// GetSourceOk returns a tuple with the Source field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetSourceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Source, true -} - -// SetSource sets field value. -func (o *TransportWebhookLog) SetSource(v string) { - o.Source = v -} - -// GetStatus returns the Status field value. -func (o *TransportWebhookLog) GetStatus() string { - if o == nil { - var ret string - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *TransportWebhookLog) SetStatus(v string) { - o.Status = v -} - -// GetTags returns the Tags field value. -func (o *TransportWebhookLog) GetTags() []string { - if o == nil { - var ret []string - return ret - } - return o.Tags -} - -// GetTagsOk returns a tuple with the Tags field value -// and a boolean to check if the value has been set. -func (o *TransportWebhookLog) GetTagsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return &o.Tags, true -} - -// SetTags sets field value. -func (o *TransportWebhookLog) SetTags(v []string) { - o.Tags = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLog) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["attributes"] = o.Attributes - if o.Date.Nanosecond() == 0 { - toSerialize["date"] = o.Date.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["date"] = o.Date.Format("2006-01-02T15:04:05.000Z07:00") - } - toSerialize["log_id"] = o.LogId - toSerialize["source"] = o.Source - toSerialize["status"] = o.Status - toSerialize["tags"] = o.Tags - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLog) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *TransportWebhookLogAttributes `json:"attributes"` - Date *time.Time `json:"date"` - LogId *string `json:"log_id"` - Source *string `json:"source"` - Status *string `json:"status"` - Tags *[]string `json:"tags"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Attributes == nil { - return fmt.Errorf("required field attributes missing") - } - if all.Date == nil { - return fmt.Errorf("required field date missing") - } - if all.LogId == nil { - return fmt.Errorf("required field log_id missing") - } - if all.Source == nil { - return fmt.Errorf("required field source missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - if all.Tags == nil { - return fmt.Errorf("required field tags missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "date", "log_id", "source", "status", "tags"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = *all.Attributes - o.Date = *all.Date - o.LogId = *all.LogId - o.Source = *all.Source - o.Status = *all.Status - o.Tags = *all.Tags - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_attributes.go b/api/datadogV2/model_transport_webhook_log_attributes.go deleted file mode 100644 index 6aa7d8295d7..00000000000 --- a/api/datadogV2/model_transport_webhook_log_attributes.go +++ /dev/null @@ -1,540 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogAttributes Top-level attributes for the webhook log event, including delivery status, recipient details, and provider metadata. -type TransportWebhookLogAttributes struct { - // The event categories. - Category []string `json:"category,omitempty"` - // The email address details. - Email *TransportWebhookLogEmail `json:"email,omitempty"` - // The unique email identifier. - EmailId *string `json:"email_id,omitempty"` - // The human-readable email type name. - EmailTypeDisplayName *string `json:"email_type_display_name,omitempty"` - // The message delivery event details. - Message *TransportWebhookLogMessage `json:"message,omitempty"` - // The network information for the event. - Network *TransportWebhookLogNetwork `json:"network,omitempty"` - // The numeric organization identifier. - Org *int64 `json:"org,omitempty"` - // Metadata about the organization that sent the email. - OrgMetadata *TransportWebhookLogOrgMetadata `json:"org_metadata,omitempty"` - // The organization UUID. - OrgUuid *string `json:"org_uuid,omitempty"` - // The timestamp when the email was queued. - QueueTime *string `json:"queue_time,omitempty"` - // Indicates whether the open event was triggered by automated machine activity rather than a human recipient (SendGrid-specific). - SgMachineOpen *bool `json:"sg_machine_open,omitempty"` - // The email subject line. - Subject *string `json:"subject,omitempty"` - // The user agent string for open events. - Useragent *string `json:"useragent,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogAttributes instantiates a new TransportWebhookLogAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogAttributes() *TransportWebhookLogAttributes { - this := TransportWebhookLogAttributes{} - return &this -} - -// NewTransportWebhookLogAttributesWithDefaults instantiates a new TransportWebhookLogAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogAttributesWithDefaults() *TransportWebhookLogAttributes { - this := TransportWebhookLogAttributes{} - return &this -} - -// GetCategory returns the Category field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetCategory() []string { - if o == nil || o.Category == nil { - var ret []string - return ret - } - return o.Category -} - -// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetCategoryOk() (*[]string, bool) { - if o == nil || o.Category == nil { - return nil, false - } - return &o.Category, true -} - -// HasCategory returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasCategory() bool { - return o != nil && o.Category != nil -} - -// SetCategory gets a reference to the given []string and assigns it to the Category field. -func (o *TransportWebhookLogAttributes) SetCategory(v []string) { - o.Category = v -} - -// GetEmail returns the Email field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetEmail() TransportWebhookLogEmail { - if o == nil || o.Email == nil { - var ret TransportWebhookLogEmail - return ret - } - return *o.Email -} - -// GetEmailOk returns a tuple with the Email field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetEmailOk() (*TransportWebhookLogEmail, bool) { - if o == nil || o.Email == nil { - return nil, false - } - return o.Email, true -} - -// HasEmail returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasEmail() bool { - return o != nil && o.Email != nil -} - -// SetEmail gets a reference to the given TransportWebhookLogEmail and assigns it to the Email field. -func (o *TransportWebhookLogAttributes) SetEmail(v TransportWebhookLogEmail) { - o.Email = &v -} - -// GetEmailId returns the EmailId field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetEmailId() string { - if o == nil || o.EmailId == nil { - var ret string - return ret - } - return *o.EmailId -} - -// GetEmailIdOk returns a tuple with the EmailId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetEmailIdOk() (*string, bool) { - if o == nil || o.EmailId == nil { - return nil, false - } - return o.EmailId, true -} - -// HasEmailId returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasEmailId() bool { - return o != nil && o.EmailId != nil -} - -// SetEmailId gets a reference to the given string and assigns it to the EmailId field. -func (o *TransportWebhookLogAttributes) SetEmailId(v string) { - o.EmailId = &v -} - -// GetEmailTypeDisplayName returns the EmailTypeDisplayName field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetEmailTypeDisplayName() string { - if o == nil || o.EmailTypeDisplayName == nil { - var ret string - return ret - } - return *o.EmailTypeDisplayName -} - -// GetEmailTypeDisplayNameOk returns a tuple with the EmailTypeDisplayName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetEmailTypeDisplayNameOk() (*string, bool) { - if o == nil || o.EmailTypeDisplayName == nil { - return nil, false - } - return o.EmailTypeDisplayName, true -} - -// HasEmailTypeDisplayName returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasEmailTypeDisplayName() bool { - return o != nil && o.EmailTypeDisplayName != nil -} - -// SetEmailTypeDisplayName gets a reference to the given string and assigns it to the EmailTypeDisplayName field. -func (o *TransportWebhookLogAttributes) SetEmailTypeDisplayName(v string) { - o.EmailTypeDisplayName = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetMessage() TransportWebhookLogMessage { - if o == nil || o.Message == nil { - var ret TransportWebhookLogMessage - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetMessageOk() (*TransportWebhookLogMessage, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasMessage() bool { - return o != nil && o.Message != nil -} - -// SetMessage gets a reference to the given TransportWebhookLogMessage and assigns it to the Message field. -func (o *TransportWebhookLogAttributes) SetMessage(v TransportWebhookLogMessage) { - o.Message = &v -} - -// GetNetwork returns the Network field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetNetwork() TransportWebhookLogNetwork { - if o == nil || o.Network == nil { - var ret TransportWebhookLogNetwork - return ret - } - return *o.Network -} - -// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetNetworkOk() (*TransportWebhookLogNetwork, bool) { - if o == nil || o.Network == nil { - return nil, false - } - return o.Network, true -} - -// HasNetwork returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasNetwork() bool { - return o != nil && o.Network != nil -} - -// SetNetwork gets a reference to the given TransportWebhookLogNetwork and assigns it to the Network field. -func (o *TransportWebhookLogAttributes) SetNetwork(v TransportWebhookLogNetwork) { - o.Network = &v -} - -// GetOrg returns the Org field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetOrg() int64 { - if o == nil || o.Org == nil { - var ret int64 - return ret - } - return *o.Org -} - -// GetOrgOk returns a tuple with the Org field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetOrgOk() (*int64, bool) { - if o == nil || o.Org == nil { - return nil, false - } - return o.Org, true -} - -// HasOrg returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasOrg() bool { - return o != nil && o.Org != nil -} - -// SetOrg gets a reference to the given int64 and assigns it to the Org field. -func (o *TransportWebhookLogAttributes) SetOrg(v int64) { - o.Org = &v -} - -// GetOrgMetadata returns the OrgMetadata field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetOrgMetadata() TransportWebhookLogOrgMetadata { - if o == nil || o.OrgMetadata == nil { - var ret TransportWebhookLogOrgMetadata - return ret - } - return *o.OrgMetadata -} - -// GetOrgMetadataOk returns a tuple with the OrgMetadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetOrgMetadataOk() (*TransportWebhookLogOrgMetadata, bool) { - if o == nil || o.OrgMetadata == nil { - return nil, false - } - return o.OrgMetadata, true -} - -// HasOrgMetadata returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasOrgMetadata() bool { - return o != nil && o.OrgMetadata != nil -} - -// SetOrgMetadata gets a reference to the given TransportWebhookLogOrgMetadata and assigns it to the OrgMetadata field. -func (o *TransportWebhookLogAttributes) SetOrgMetadata(v TransportWebhookLogOrgMetadata) { - o.OrgMetadata = &v -} - -// GetOrgUuid returns the OrgUuid field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetOrgUuid() string { - if o == nil || o.OrgUuid == nil { - var ret string - return ret - } - return *o.OrgUuid -} - -// GetOrgUuidOk returns a tuple with the OrgUuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetOrgUuidOk() (*string, bool) { - if o == nil || o.OrgUuid == nil { - return nil, false - } - return o.OrgUuid, true -} - -// HasOrgUuid returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasOrgUuid() bool { - return o != nil && o.OrgUuid != nil -} - -// SetOrgUuid gets a reference to the given string and assigns it to the OrgUuid field. -func (o *TransportWebhookLogAttributes) SetOrgUuid(v string) { - o.OrgUuid = &v -} - -// GetQueueTime returns the QueueTime field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetQueueTime() string { - if o == nil || o.QueueTime == nil { - var ret string - return ret - } - return *o.QueueTime -} - -// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetQueueTimeOk() (*string, bool) { - if o == nil || o.QueueTime == nil { - return nil, false - } - return o.QueueTime, true -} - -// HasQueueTime returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasQueueTime() bool { - return o != nil && o.QueueTime != nil -} - -// SetQueueTime gets a reference to the given string and assigns it to the QueueTime field. -func (o *TransportWebhookLogAttributes) SetQueueTime(v string) { - o.QueueTime = &v -} - -// GetSgMachineOpen returns the SgMachineOpen field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetSgMachineOpen() bool { - if o == nil || o.SgMachineOpen == nil { - var ret bool - return ret - } - return *o.SgMachineOpen -} - -// GetSgMachineOpenOk returns a tuple with the SgMachineOpen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetSgMachineOpenOk() (*bool, bool) { - if o == nil || o.SgMachineOpen == nil { - return nil, false - } - return o.SgMachineOpen, true -} - -// HasSgMachineOpen returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasSgMachineOpen() bool { - return o != nil && o.SgMachineOpen != nil -} - -// SetSgMachineOpen gets a reference to the given bool and assigns it to the SgMachineOpen field. -func (o *TransportWebhookLogAttributes) SetSgMachineOpen(v bool) { - o.SgMachineOpen = &v -} - -// GetSubject returns the Subject field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetSubject() string { - if o == nil || o.Subject == nil { - var ret string - return ret - } - return *o.Subject -} - -// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { - return nil, false - } - return o.Subject, true -} - -// HasSubject returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasSubject() bool { - return o != nil && o.Subject != nil -} - -// SetSubject gets a reference to the given string and assigns it to the Subject field. -func (o *TransportWebhookLogAttributes) SetSubject(v string) { - o.Subject = &v -} - -// GetUseragent returns the Useragent field value if set, zero value otherwise. -func (o *TransportWebhookLogAttributes) GetUseragent() string { - if o == nil || o.Useragent == nil { - var ret string - return ret - } - return *o.Useragent -} - -// GetUseragentOk returns a tuple with the Useragent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogAttributes) GetUseragentOk() (*string, bool) { - if o == nil || o.Useragent == nil { - return nil, false - } - return o.Useragent, true -} - -// HasUseragent returns a boolean if a field has been set. -func (o *TransportWebhookLogAttributes) HasUseragent() bool { - return o != nil && o.Useragent != nil -} - -// SetUseragent gets a reference to the given string and assigns it to the Useragent field. -func (o *TransportWebhookLogAttributes) SetUseragent(v string) { - o.Useragent = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Category != nil { - toSerialize["category"] = o.Category - } - if o.Email != nil { - toSerialize["email"] = o.Email - } - if o.EmailId != nil { - toSerialize["email_id"] = o.EmailId - } - if o.EmailTypeDisplayName != nil { - toSerialize["email_type_display_name"] = o.EmailTypeDisplayName - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - if o.Network != nil { - toSerialize["network"] = o.Network - } - if o.Org != nil { - toSerialize["org"] = o.Org - } - if o.OrgMetadata != nil { - toSerialize["org_metadata"] = o.OrgMetadata - } - if o.OrgUuid != nil { - toSerialize["org_uuid"] = o.OrgUuid - } - if o.QueueTime != nil { - toSerialize["queue_time"] = o.QueueTime - } - if o.SgMachineOpen != nil { - toSerialize["sg_machine_open"] = o.SgMachineOpen - } - if o.Subject != nil { - toSerialize["subject"] = o.Subject - } - if o.Useragent != nil { - toSerialize["useragent"] = o.Useragent - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Category []string `json:"category,omitempty"` - Email *TransportWebhookLogEmail `json:"email,omitempty"` - EmailId *string `json:"email_id,omitempty"` - EmailTypeDisplayName *string `json:"email_type_display_name,omitempty"` - Message *TransportWebhookLogMessage `json:"message,omitempty"` - Network *TransportWebhookLogNetwork `json:"network,omitempty"` - Org *int64 `json:"org,omitempty"` - OrgMetadata *TransportWebhookLogOrgMetadata `json:"org_metadata,omitempty"` - OrgUuid *string `json:"org_uuid,omitempty"` - QueueTime *string `json:"queue_time,omitempty"` - SgMachineOpen *bool `json:"sg_machine_open,omitempty"` - Subject *string `json:"subject,omitempty"` - Useragent *string `json:"useragent,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"category", "email", "email_id", "email_type_display_name", "message", "network", "org", "org_metadata", "org_uuid", "queue_time", "sg_machine_open", "subject", "useragent"}) - } else { - return err - } - - hasInvalidField := false - o.Category = all.Category - if all.Email != nil && all.Email.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Email = all.Email - o.EmailId = all.EmailId - o.EmailTypeDisplayName = all.EmailTypeDisplayName - if all.Message != nil && all.Message.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Message = all.Message - if all.Network != nil && all.Network.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Network = all.Network - o.Org = all.Org - if all.OrgMetadata != nil && all.OrgMetadata.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.OrgMetadata = all.OrgMetadata - o.OrgUuid = all.OrgUuid - o.QueueTime = all.QueueTime - o.SgMachineOpen = all.SgMachineOpen - o.Subject = all.Subject - o.Useragent = all.Useragent - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_email.go b/api/datadogV2/model_transport_webhook_log_email.go deleted file mode 100644 index c7540861afd..00000000000 --- a/api/datadogV2/model_transport_webhook_log_email.go +++ /dev/null @@ -1,207 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogEmail The email address details. -type TransportWebhookLogEmail struct { - // The recipient email address. - Address *string `json:"address,omitempty"` - // The recipient domain. - Domain *string `json:"domain,omitempty"` - // The email subject line. - Subject *string `json:"subject,omitempty"` - // Email categorization tags applied by the transport provider (for example, "transactional", "marketing"). - Type []string `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogEmail instantiates a new TransportWebhookLogEmail object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogEmail() *TransportWebhookLogEmail { - this := TransportWebhookLogEmail{} - return &this -} - -// NewTransportWebhookLogEmailWithDefaults instantiates a new TransportWebhookLogEmail object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogEmailWithDefaults() *TransportWebhookLogEmail { - this := TransportWebhookLogEmail{} - return &this -} - -// GetAddress returns the Address field value if set, zero value otherwise. -func (o *TransportWebhookLogEmail) GetAddress() string { - if o == nil || o.Address == nil { - var ret string - return ret - } - return *o.Address -} - -// GetAddressOk returns a tuple with the Address field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogEmail) GetAddressOk() (*string, bool) { - if o == nil || o.Address == nil { - return nil, false - } - return o.Address, true -} - -// HasAddress returns a boolean if a field has been set. -func (o *TransportWebhookLogEmail) HasAddress() bool { - return o != nil && o.Address != nil -} - -// SetAddress gets a reference to the given string and assigns it to the Address field. -func (o *TransportWebhookLogEmail) SetAddress(v string) { - o.Address = &v -} - -// GetDomain returns the Domain field value if set, zero value otherwise. -func (o *TransportWebhookLogEmail) GetDomain() string { - if o == nil || o.Domain == nil { - var ret string - return ret - } - return *o.Domain -} - -// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogEmail) GetDomainOk() (*string, bool) { - if o == nil || o.Domain == nil { - return nil, false - } - return o.Domain, true -} - -// HasDomain returns a boolean if a field has been set. -func (o *TransportWebhookLogEmail) HasDomain() bool { - return o != nil && o.Domain != nil -} - -// SetDomain gets a reference to the given string and assigns it to the Domain field. -func (o *TransportWebhookLogEmail) SetDomain(v string) { - o.Domain = &v -} - -// GetSubject returns the Subject field value if set, zero value otherwise. -func (o *TransportWebhookLogEmail) GetSubject() string { - if o == nil || o.Subject == nil { - var ret string - return ret - } - return *o.Subject -} - -// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogEmail) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { - return nil, false - } - return o.Subject, true -} - -// HasSubject returns a boolean if a field has been set. -func (o *TransportWebhookLogEmail) HasSubject() bool { - return o != nil && o.Subject != nil -} - -// SetSubject gets a reference to the given string and assigns it to the Subject field. -func (o *TransportWebhookLogEmail) SetSubject(v string) { - o.Subject = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *TransportWebhookLogEmail) GetType() []string { - if o == nil || o.Type == nil { - var ret []string - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogEmail) GetTypeOk() (*[]string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return &o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *TransportWebhookLogEmail) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given []string and assigns it to the Type field. -func (o *TransportWebhookLogEmail) SetType(v []string) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogEmail) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Address != nil { - toSerialize["address"] = o.Address - } - if o.Domain != nil { - toSerialize["domain"] = o.Domain - } - if o.Subject != nil { - toSerialize["subject"] = o.Subject - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogEmail) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Address *string `json:"address,omitempty"` - Domain *string `json:"domain,omitempty"` - Subject *string `json:"subject,omitempty"` - Type []string `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"address", "domain", "subject", "type"}) - } else { - return err - } - o.Address = all.Address - o.Domain = all.Domain - o.Subject = all.Subject - o.Type = all.Type - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_ip_attribute.go b/api/datadogV2/model_transport_webhook_log_ip_attribute.go deleted file mode 100644 index 973b5982426..00000000000 --- a/api/datadogV2/model_transport_webhook_log_ip_attribute.go +++ /dev/null @@ -1,137 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogIpAttribute An IP attribute with its sources. -type TransportWebhookLogIpAttribute struct { - // The IP address. - Ip *string `json:"ip,omitempty"` - // The transport providers or systems that reported this IP address. - Source []string `json:"source,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogIpAttribute instantiates a new TransportWebhookLogIpAttribute object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogIpAttribute() *TransportWebhookLogIpAttribute { - this := TransportWebhookLogIpAttribute{} - return &this -} - -// NewTransportWebhookLogIpAttributeWithDefaults instantiates a new TransportWebhookLogIpAttribute object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogIpAttributeWithDefaults() *TransportWebhookLogIpAttribute { - this := TransportWebhookLogIpAttribute{} - return &this -} - -// GetIp returns the Ip field value if set, zero value otherwise. -func (o *TransportWebhookLogIpAttribute) GetIp() string { - if o == nil || o.Ip == nil { - var ret string - return ret - } - return *o.Ip -} - -// GetIpOk returns a tuple with the Ip field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogIpAttribute) GetIpOk() (*string, bool) { - if o == nil || o.Ip == nil { - return nil, false - } - return o.Ip, true -} - -// HasIp returns a boolean if a field has been set. -func (o *TransportWebhookLogIpAttribute) HasIp() bool { - return o != nil && o.Ip != nil -} - -// SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *TransportWebhookLogIpAttribute) SetIp(v string) { - o.Ip = &v -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *TransportWebhookLogIpAttribute) GetSource() []string { - if o == nil || o.Source == nil { - var ret []string - return ret - } - return o.Source -} - -// GetSourceOk returns a tuple with the Source field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogIpAttribute) GetSourceOk() (*[]string, bool) { - if o == nil || o.Source == nil { - return nil, false - } - return &o.Source, true -} - -// HasSource returns a boolean if a field has been set. -func (o *TransportWebhookLogIpAttribute) HasSource() bool { - return o != nil && o.Source != nil -} - -// SetSource gets a reference to the given []string and assigns it to the Source field. -func (o *TransportWebhookLogIpAttribute) SetSource(v []string) { - o.Source = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogIpAttribute) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Ip != nil { - toSerialize["ip"] = o.Ip - } - if o.Source != nil { - toSerialize["source"] = o.Source - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogIpAttribute) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Ip *string `json:"ip,omitempty"` - Source []string `json:"source,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"ip", "source"}) - } else { - return err - } - o.Ip = all.Ip - o.Source = all.Source - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message.go b/api/datadogV2/model_transport_webhook_log_message.go deleted file mode 100644 index 28fd1fe219c..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message.go +++ /dev/null @@ -1,333 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessage The message delivery event details. -type TransportWebhookLogMessage struct { - // The message authentication details. - Auth *TransportWebhookLogMessageAuth `json:"auth,omitempty"` - // Custom arguments passed through the email transport provider for tracking. - CustomArgs *TransportWebhookLogMessageCustomArgs `json:"custom_args,omitempty"` - // The message identifiers. - Id *TransportWebhookLogMessageId `json:"id,omitempty"` - // The delivery event type emitted by the transport provider (for example, "delivered", "dropped", "bounced"). - Name *string `json:"name,omitempty"` - // The SMTP response information. - Response *TransportWebhookLogMessageResponse `json:"response,omitempty"` - // The IP address of the sending server. - SenderIp *string `json:"sender_ip,omitempty"` - // The message delivery timing information. - Timestamp *TransportWebhookLogMessageTimestamp `json:"timestamp,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessage instantiates a new TransportWebhookLogMessage object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessage() *TransportWebhookLogMessage { - this := TransportWebhookLogMessage{} - return &this -} - -// NewTransportWebhookLogMessageWithDefaults instantiates a new TransportWebhookLogMessage object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageWithDefaults() *TransportWebhookLogMessage { - this := TransportWebhookLogMessage{} - return &this -} - -// GetAuth returns the Auth field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetAuth() TransportWebhookLogMessageAuth { - if o == nil || o.Auth == nil { - var ret TransportWebhookLogMessageAuth - return ret - } - return *o.Auth -} - -// GetAuthOk returns a tuple with the Auth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetAuthOk() (*TransportWebhookLogMessageAuth, bool) { - if o == nil || o.Auth == nil { - return nil, false - } - return o.Auth, true -} - -// HasAuth returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasAuth() bool { - return o != nil && o.Auth != nil -} - -// SetAuth gets a reference to the given TransportWebhookLogMessageAuth and assigns it to the Auth field. -func (o *TransportWebhookLogMessage) SetAuth(v TransportWebhookLogMessageAuth) { - o.Auth = &v -} - -// GetCustomArgs returns the CustomArgs field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetCustomArgs() TransportWebhookLogMessageCustomArgs { - if o == nil || o.CustomArgs == nil { - var ret TransportWebhookLogMessageCustomArgs - return ret - } - return *o.CustomArgs -} - -// GetCustomArgsOk returns a tuple with the CustomArgs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetCustomArgsOk() (*TransportWebhookLogMessageCustomArgs, bool) { - if o == nil || o.CustomArgs == nil { - return nil, false - } - return o.CustomArgs, true -} - -// HasCustomArgs returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasCustomArgs() bool { - return o != nil && o.CustomArgs != nil -} - -// SetCustomArgs gets a reference to the given TransportWebhookLogMessageCustomArgs and assigns it to the CustomArgs field. -func (o *TransportWebhookLogMessage) SetCustomArgs(v TransportWebhookLogMessageCustomArgs) { - o.CustomArgs = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetId() TransportWebhookLogMessageId { - if o == nil || o.Id == nil { - var ret TransportWebhookLogMessageId - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetIdOk() (*TransportWebhookLogMessageId, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given TransportWebhookLogMessageId and assigns it to the Id field. -func (o *TransportWebhookLogMessage) SetId(v TransportWebhookLogMessageId) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *TransportWebhookLogMessage) SetName(v string) { - o.Name = &v -} - -// GetResponse returns the Response field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetResponse() TransportWebhookLogMessageResponse { - if o == nil || o.Response == nil { - var ret TransportWebhookLogMessageResponse - return ret - } - return *o.Response -} - -// GetResponseOk returns a tuple with the Response field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetResponseOk() (*TransportWebhookLogMessageResponse, bool) { - if o == nil || o.Response == nil { - return nil, false - } - return o.Response, true -} - -// HasResponse returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasResponse() bool { - return o != nil && o.Response != nil -} - -// SetResponse gets a reference to the given TransportWebhookLogMessageResponse and assigns it to the Response field. -func (o *TransportWebhookLogMessage) SetResponse(v TransportWebhookLogMessageResponse) { - o.Response = &v -} - -// GetSenderIp returns the SenderIp field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetSenderIp() string { - if o == nil || o.SenderIp == nil { - var ret string - return ret - } - return *o.SenderIp -} - -// GetSenderIpOk returns a tuple with the SenderIp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetSenderIpOk() (*string, bool) { - if o == nil || o.SenderIp == nil { - return nil, false - } - return o.SenderIp, true -} - -// HasSenderIp returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasSenderIp() bool { - return o != nil && o.SenderIp != nil -} - -// SetSenderIp gets a reference to the given string and assigns it to the SenderIp field. -func (o *TransportWebhookLogMessage) SetSenderIp(v string) { - o.SenderIp = &v -} - -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *TransportWebhookLogMessage) GetTimestamp() TransportWebhookLogMessageTimestamp { - if o == nil || o.Timestamp == nil { - var ret TransportWebhookLogMessageTimestamp - return ret - } - return *o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessage) GetTimestampOk() (*TransportWebhookLogMessageTimestamp, bool) { - if o == nil || o.Timestamp == nil { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *TransportWebhookLogMessage) HasTimestamp() bool { - return o != nil && o.Timestamp != nil -} - -// SetTimestamp gets a reference to the given TransportWebhookLogMessageTimestamp and assigns it to the Timestamp field. -func (o *TransportWebhookLogMessage) SetTimestamp(v TransportWebhookLogMessageTimestamp) { - o.Timestamp = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessage) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Auth != nil { - toSerialize["auth"] = o.Auth - } - if o.CustomArgs != nil { - toSerialize["custom_args"] = o.CustomArgs - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Response != nil { - toSerialize["response"] = o.Response - } - if o.SenderIp != nil { - toSerialize["sender_ip"] = o.SenderIp - } - if o.Timestamp != nil { - toSerialize["timestamp"] = o.Timestamp - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessage) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Auth *TransportWebhookLogMessageAuth `json:"auth,omitempty"` - CustomArgs *TransportWebhookLogMessageCustomArgs `json:"custom_args,omitempty"` - Id *TransportWebhookLogMessageId `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Response *TransportWebhookLogMessageResponse `json:"response,omitempty"` - SenderIp *string `json:"sender_ip,omitempty"` - Timestamp *TransportWebhookLogMessageTimestamp `json:"timestamp,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "custom_args", "id", "name", "response", "sender_ip", "timestamp"}) - } else { - return err - } - - hasInvalidField := false - if all.Auth != nil && all.Auth.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Auth = all.Auth - if all.CustomArgs != nil && all.CustomArgs.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.CustomArgs = all.CustomArgs - if all.Id != nil && all.Id.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Id = all.Id - o.Name = all.Name - if all.Response != nil && all.Response.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Response = all.Response - o.SenderIp = all.SenderIp - if all.Timestamp != nil && all.Timestamp.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Timestamp = all.Timestamp - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message_auth.go b/api/datadogV2/model_transport_webhook_log_message_auth.go deleted file mode 100644 index d279f32b2b2..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message_auth.go +++ /dev/null @@ -1,102 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessageAuth The message authentication details. -type TransportWebhookLogMessageAuth struct { - // The TLS version or negotiation information. - DeliveredWithTls *string `json:"delivered_with_tls,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessageAuth instantiates a new TransportWebhookLogMessageAuth object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessageAuth() *TransportWebhookLogMessageAuth { - this := TransportWebhookLogMessageAuth{} - return &this -} - -// NewTransportWebhookLogMessageAuthWithDefaults instantiates a new TransportWebhookLogMessageAuth object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageAuthWithDefaults() *TransportWebhookLogMessageAuth { - this := TransportWebhookLogMessageAuth{} - return &this -} - -// GetDeliveredWithTls returns the DeliveredWithTls field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageAuth) GetDeliveredWithTls() string { - if o == nil || o.DeliveredWithTls == nil { - var ret string - return ret - } - return *o.DeliveredWithTls -} - -// GetDeliveredWithTlsOk returns a tuple with the DeliveredWithTls field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageAuth) GetDeliveredWithTlsOk() (*string, bool) { - if o == nil || o.DeliveredWithTls == nil { - return nil, false - } - return o.DeliveredWithTls, true -} - -// HasDeliveredWithTls returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageAuth) HasDeliveredWithTls() bool { - return o != nil && o.DeliveredWithTls != nil -} - -// SetDeliveredWithTls gets a reference to the given string and assigns it to the DeliveredWithTls field. -func (o *TransportWebhookLogMessageAuth) SetDeliveredWithTls(v string) { - o.DeliveredWithTls = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessageAuth) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.DeliveredWithTls != nil { - toSerialize["delivered_with_tls"] = o.DeliveredWithTls - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessageAuth) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - DeliveredWithTls *string `json:"delivered_with_tls,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"delivered_with_tls"}) - } else { - return err - } - o.DeliveredWithTls = all.DeliveredWithTls - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message_custom_args.go b/api/datadogV2/model_transport_webhook_log_message_custom_args.go deleted file mode 100644 index 81f7165560c..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message_custom_args.go +++ /dev/null @@ -1,242 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessageCustomArgs Custom arguments passed through the email transport provider for tracking. -type TransportWebhookLogMessageCustomArgs struct { - // The unique email identifier. - EmailId *string `json:"email_id,omitempty"` - // The human-readable email type name. - EmailTypeDisplayName *string `json:"email_type_display_name,omitempty"` - // The organization UUID. - OrgUuid *string `json:"org_uuid,omitempty"` - // The timestamp when the email was queued. - QueueTime *string `json:"queue_time,omitempty"` - // The email subject line. - Subject *string `json:"subject,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessageCustomArgs instantiates a new TransportWebhookLogMessageCustomArgs object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessageCustomArgs() *TransportWebhookLogMessageCustomArgs { - this := TransportWebhookLogMessageCustomArgs{} - return &this -} - -// NewTransportWebhookLogMessageCustomArgsWithDefaults instantiates a new TransportWebhookLogMessageCustomArgs object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageCustomArgsWithDefaults() *TransportWebhookLogMessageCustomArgs { - this := TransportWebhookLogMessageCustomArgs{} - return &this -} - -// GetEmailId returns the EmailId field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageCustomArgs) GetEmailId() string { - if o == nil || o.EmailId == nil { - var ret string - return ret - } - return *o.EmailId -} - -// GetEmailIdOk returns a tuple with the EmailId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageCustomArgs) GetEmailIdOk() (*string, bool) { - if o == nil || o.EmailId == nil { - return nil, false - } - return o.EmailId, true -} - -// HasEmailId returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageCustomArgs) HasEmailId() bool { - return o != nil && o.EmailId != nil -} - -// SetEmailId gets a reference to the given string and assigns it to the EmailId field. -func (o *TransportWebhookLogMessageCustomArgs) SetEmailId(v string) { - o.EmailId = &v -} - -// GetEmailTypeDisplayName returns the EmailTypeDisplayName field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageCustomArgs) GetEmailTypeDisplayName() string { - if o == nil || o.EmailTypeDisplayName == nil { - var ret string - return ret - } - return *o.EmailTypeDisplayName -} - -// GetEmailTypeDisplayNameOk returns a tuple with the EmailTypeDisplayName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageCustomArgs) GetEmailTypeDisplayNameOk() (*string, bool) { - if o == nil || o.EmailTypeDisplayName == nil { - return nil, false - } - return o.EmailTypeDisplayName, true -} - -// HasEmailTypeDisplayName returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageCustomArgs) HasEmailTypeDisplayName() bool { - return o != nil && o.EmailTypeDisplayName != nil -} - -// SetEmailTypeDisplayName gets a reference to the given string and assigns it to the EmailTypeDisplayName field. -func (o *TransportWebhookLogMessageCustomArgs) SetEmailTypeDisplayName(v string) { - o.EmailTypeDisplayName = &v -} - -// GetOrgUuid returns the OrgUuid field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageCustomArgs) GetOrgUuid() string { - if o == nil || o.OrgUuid == nil { - var ret string - return ret - } - return *o.OrgUuid -} - -// GetOrgUuidOk returns a tuple with the OrgUuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageCustomArgs) GetOrgUuidOk() (*string, bool) { - if o == nil || o.OrgUuid == nil { - return nil, false - } - return o.OrgUuid, true -} - -// HasOrgUuid returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageCustomArgs) HasOrgUuid() bool { - return o != nil && o.OrgUuid != nil -} - -// SetOrgUuid gets a reference to the given string and assigns it to the OrgUuid field. -func (o *TransportWebhookLogMessageCustomArgs) SetOrgUuid(v string) { - o.OrgUuid = &v -} - -// GetQueueTime returns the QueueTime field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageCustomArgs) GetQueueTime() string { - if o == nil || o.QueueTime == nil { - var ret string - return ret - } - return *o.QueueTime -} - -// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageCustomArgs) GetQueueTimeOk() (*string, bool) { - if o == nil || o.QueueTime == nil { - return nil, false - } - return o.QueueTime, true -} - -// HasQueueTime returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageCustomArgs) HasQueueTime() bool { - return o != nil && o.QueueTime != nil -} - -// SetQueueTime gets a reference to the given string and assigns it to the QueueTime field. -func (o *TransportWebhookLogMessageCustomArgs) SetQueueTime(v string) { - o.QueueTime = &v -} - -// GetSubject returns the Subject field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageCustomArgs) GetSubject() string { - if o == nil || o.Subject == nil { - var ret string - return ret - } - return *o.Subject -} - -// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageCustomArgs) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { - return nil, false - } - return o.Subject, true -} - -// HasSubject returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageCustomArgs) HasSubject() bool { - return o != nil && o.Subject != nil -} - -// SetSubject gets a reference to the given string and assigns it to the Subject field. -func (o *TransportWebhookLogMessageCustomArgs) SetSubject(v string) { - o.Subject = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessageCustomArgs) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.EmailId != nil { - toSerialize["email_id"] = o.EmailId - } - if o.EmailTypeDisplayName != nil { - toSerialize["email_type_display_name"] = o.EmailTypeDisplayName - } - if o.OrgUuid != nil { - toSerialize["org_uuid"] = o.OrgUuid - } - if o.QueueTime != nil { - toSerialize["queue_time"] = o.QueueTime - } - if o.Subject != nil { - toSerialize["subject"] = o.Subject - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessageCustomArgs) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - EmailId *string `json:"email_id,omitempty"` - EmailTypeDisplayName *string `json:"email_type_display_name,omitempty"` - OrgUuid *string `json:"org_uuid,omitempty"` - QueueTime *string `json:"queue_time,omitempty"` - Subject *string `json:"subject,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"email_id", "email_type_display_name", "org_uuid", "queue_time", "subject"}) - } else { - return err - } - o.EmailId = all.EmailId - o.EmailTypeDisplayName = all.EmailTypeDisplayName - o.OrgUuid = all.OrgUuid - o.QueueTime = all.QueueTime - o.Subject = all.Subject - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message_id.go b/api/datadogV2/model_transport_webhook_log_message_id.go deleted file mode 100644 index 93b96e385b7..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message_id.go +++ /dev/null @@ -1,172 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessageId The message identifiers. -type TransportWebhookLogMessageId struct { - // The RFC 5322 Message-ID. - MessageId *string `json:"message_id,omitempty"` - // The SMTP transaction identifier. - SmtpId *string `json:"smtp_id,omitempty"` - // The transport provider event identifier. - TransportEventId *string `json:"transport_event_id,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessageId instantiates a new TransportWebhookLogMessageId object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessageId() *TransportWebhookLogMessageId { - this := TransportWebhookLogMessageId{} - return &this -} - -// NewTransportWebhookLogMessageIdWithDefaults instantiates a new TransportWebhookLogMessageId object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageIdWithDefaults() *TransportWebhookLogMessageId { - this := TransportWebhookLogMessageId{} - return &this -} - -// GetMessageId returns the MessageId field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageId) GetMessageId() string { - if o == nil || o.MessageId == nil { - var ret string - return ret - } - return *o.MessageId -} - -// GetMessageIdOk returns a tuple with the MessageId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageId) GetMessageIdOk() (*string, bool) { - if o == nil || o.MessageId == nil { - return nil, false - } - return o.MessageId, true -} - -// HasMessageId returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageId) HasMessageId() bool { - return o != nil && o.MessageId != nil -} - -// SetMessageId gets a reference to the given string and assigns it to the MessageId field. -func (o *TransportWebhookLogMessageId) SetMessageId(v string) { - o.MessageId = &v -} - -// GetSmtpId returns the SmtpId field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageId) GetSmtpId() string { - if o == nil || o.SmtpId == nil { - var ret string - return ret - } - return *o.SmtpId -} - -// GetSmtpIdOk returns a tuple with the SmtpId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageId) GetSmtpIdOk() (*string, bool) { - if o == nil || o.SmtpId == nil { - return nil, false - } - return o.SmtpId, true -} - -// HasSmtpId returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageId) HasSmtpId() bool { - return o != nil && o.SmtpId != nil -} - -// SetSmtpId gets a reference to the given string and assigns it to the SmtpId field. -func (o *TransportWebhookLogMessageId) SetSmtpId(v string) { - o.SmtpId = &v -} - -// GetTransportEventId returns the TransportEventId field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageId) GetTransportEventId() string { - if o == nil || o.TransportEventId == nil { - var ret string - return ret - } - return *o.TransportEventId -} - -// GetTransportEventIdOk returns a tuple with the TransportEventId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageId) GetTransportEventIdOk() (*string, bool) { - if o == nil || o.TransportEventId == nil { - return nil, false - } - return o.TransportEventId, true -} - -// HasTransportEventId returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageId) HasTransportEventId() bool { - return o != nil && o.TransportEventId != nil -} - -// SetTransportEventId gets a reference to the given string and assigns it to the TransportEventId field. -func (o *TransportWebhookLogMessageId) SetTransportEventId(v string) { - o.TransportEventId = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessageId) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.MessageId != nil { - toSerialize["message_id"] = o.MessageId - } - if o.SmtpId != nil { - toSerialize["smtp_id"] = o.SmtpId - } - if o.TransportEventId != nil { - toSerialize["transport_event_id"] = o.TransportEventId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessageId) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - MessageId *string `json:"message_id,omitempty"` - SmtpId *string `json:"smtp_id,omitempty"` - TransportEventId *string `json:"transport_event_id,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"message_id", "smtp_id", "transport_event_id"}) - } else { - return err - } - o.MessageId = all.MessageId - o.SmtpId = all.SmtpId - o.TransportEventId = all.TransportEventId - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message_response.go b/api/datadogV2/model_transport_webhook_log_message_response.go deleted file mode 100644 index 97e1f71ebc9..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message_response.go +++ /dev/null @@ -1,172 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessageResponse The SMTP response information. -type TransportWebhookLogMessageResponse struct { - // The enhanced SMTP status code. - EnhancedSmtpCode *string `json:"enhanced_smtp_code,omitempty"` - // The SMTP response message. - Reason *string `json:"reason,omitempty"` - // The SMTP status code. - SmtpCode *string `json:"smtp_code,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessageResponse instantiates a new TransportWebhookLogMessageResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessageResponse() *TransportWebhookLogMessageResponse { - this := TransportWebhookLogMessageResponse{} - return &this -} - -// NewTransportWebhookLogMessageResponseWithDefaults instantiates a new TransportWebhookLogMessageResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageResponseWithDefaults() *TransportWebhookLogMessageResponse { - this := TransportWebhookLogMessageResponse{} - return &this -} - -// GetEnhancedSmtpCode returns the EnhancedSmtpCode field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageResponse) GetEnhancedSmtpCode() string { - if o == nil || o.EnhancedSmtpCode == nil { - var ret string - return ret - } - return *o.EnhancedSmtpCode -} - -// GetEnhancedSmtpCodeOk returns a tuple with the EnhancedSmtpCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageResponse) GetEnhancedSmtpCodeOk() (*string, bool) { - if o == nil || o.EnhancedSmtpCode == nil { - return nil, false - } - return o.EnhancedSmtpCode, true -} - -// HasEnhancedSmtpCode returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageResponse) HasEnhancedSmtpCode() bool { - return o != nil && o.EnhancedSmtpCode != nil -} - -// SetEnhancedSmtpCode gets a reference to the given string and assigns it to the EnhancedSmtpCode field. -func (o *TransportWebhookLogMessageResponse) SetEnhancedSmtpCode(v string) { - o.EnhancedSmtpCode = &v -} - -// GetReason returns the Reason field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageResponse) GetReason() string { - if o == nil || o.Reason == nil { - var ret string - return ret - } - return *o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageResponse) GetReasonOk() (*string, bool) { - if o == nil || o.Reason == nil { - return nil, false - } - return o.Reason, true -} - -// HasReason returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageResponse) HasReason() bool { - return o != nil && o.Reason != nil -} - -// SetReason gets a reference to the given string and assigns it to the Reason field. -func (o *TransportWebhookLogMessageResponse) SetReason(v string) { - o.Reason = &v -} - -// GetSmtpCode returns the SmtpCode field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageResponse) GetSmtpCode() string { - if o == nil || o.SmtpCode == nil { - var ret string - return ret - } - return *o.SmtpCode -} - -// GetSmtpCodeOk returns a tuple with the SmtpCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageResponse) GetSmtpCodeOk() (*string, bool) { - if o == nil || o.SmtpCode == nil { - return nil, false - } - return o.SmtpCode, true -} - -// HasSmtpCode returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageResponse) HasSmtpCode() bool { - return o != nil && o.SmtpCode != nil -} - -// SetSmtpCode gets a reference to the given string and assigns it to the SmtpCode field. -func (o *TransportWebhookLogMessageResponse) SetSmtpCode(v string) { - o.SmtpCode = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessageResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.EnhancedSmtpCode != nil { - toSerialize["enhanced_smtp_code"] = o.EnhancedSmtpCode - } - if o.Reason != nil { - toSerialize["reason"] = o.Reason - } - if o.SmtpCode != nil { - toSerialize["smtp_code"] = o.SmtpCode - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessageResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - EnhancedSmtpCode *string `json:"enhanced_smtp_code,omitempty"` - Reason *string `json:"reason,omitempty"` - SmtpCode *string `json:"smtp_code,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"enhanced_smtp_code", "reason", "smtp_code"}) - } else { - return err - } - o.EnhancedSmtpCode = all.EnhancedSmtpCode - o.Reason = all.Reason - o.SmtpCode = all.SmtpCode - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_message_timestamp.go b/api/datadogV2/model_transport_webhook_log_message_timestamp.go deleted file mode 100644 index 21ff171fb84..00000000000 --- a/api/datadogV2/model_transport_webhook_log_message_timestamp.go +++ /dev/null @@ -1,207 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogMessageTimestamp The message delivery timing information. -type TransportWebhookLogMessageTimestamp struct { - // The Unix timestamp of the event. - EventTimestamp *float64 `json:"event_timestamp,omitempty"` - // The total delivery time in seconds. - Lifetime *float64 `json:"lifetime,omitempty"` - // Number of seconds the message spent in the delivery queue. - QueueTime *float64 `json:"queue_time,omitempty"` - // The scheduled delivery time as a Unix timestamp. - ScheduledTime *float64 `json:"scheduled_time,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogMessageTimestamp instantiates a new TransportWebhookLogMessageTimestamp object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogMessageTimestamp() *TransportWebhookLogMessageTimestamp { - this := TransportWebhookLogMessageTimestamp{} - return &this -} - -// NewTransportWebhookLogMessageTimestampWithDefaults instantiates a new TransportWebhookLogMessageTimestamp object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogMessageTimestampWithDefaults() *TransportWebhookLogMessageTimestamp { - this := TransportWebhookLogMessageTimestamp{} - return &this -} - -// GetEventTimestamp returns the EventTimestamp field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageTimestamp) GetEventTimestamp() float64 { - if o == nil || o.EventTimestamp == nil { - var ret float64 - return ret - } - return *o.EventTimestamp -} - -// GetEventTimestampOk returns a tuple with the EventTimestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageTimestamp) GetEventTimestampOk() (*float64, bool) { - if o == nil || o.EventTimestamp == nil { - return nil, false - } - return o.EventTimestamp, true -} - -// HasEventTimestamp returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageTimestamp) HasEventTimestamp() bool { - return o != nil && o.EventTimestamp != nil -} - -// SetEventTimestamp gets a reference to the given float64 and assigns it to the EventTimestamp field. -func (o *TransportWebhookLogMessageTimestamp) SetEventTimestamp(v float64) { - o.EventTimestamp = &v -} - -// GetLifetime returns the Lifetime field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageTimestamp) GetLifetime() float64 { - if o == nil || o.Lifetime == nil { - var ret float64 - return ret - } - return *o.Lifetime -} - -// GetLifetimeOk returns a tuple with the Lifetime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageTimestamp) GetLifetimeOk() (*float64, bool) { - if o == nil || o.Lifetime == nil { - return nil, false - } - return o.Lifetime, true -} - -// HasLifetime returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageTimestamp) HasLifetime() bool { - return o != nil && o.Lifetime != nil -} - -// SetLifetime gets a reference to the given float64 and assigns it to the Lifetime field. -func (o *TransportWebhookLogMessageTimestamp) SetLifetime(v float64) { - o.Lifetime = &v -} - -// GetQueueTime returns the QueueTime field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageTimestamp) GetQueueTime() float64 { - if o == nil || o.QueueTime == nil { - var ret float64 - return ret - } - return *o.QueueTime -} - -// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageTimestamp) GetQueueTimeOk() (*float64, bool) { - if o == nil || o.QueueTime == nil { - return nil, false - } - return o.QueueTime, true -} - -// HasQueueTime returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageTimestamp) HasQueueTime() bool { - return o != nil && o.QueueTime != nil -} - -// SetQueueTime gets a reference to the given float64 and assigns it to the QueueTime field. -func (o *TransportWebhookLogMessageTimestamp) SetQueueTime(v float64) { - o.QueueTime = &v -} - -// GetScheduledTime returns the ScheduledTime field value if set, zero value otherwise. -func (o *TransportWebhookLogMessageTimestamp) GetScheduledTime() float64 { - if o == nil || o.ScheduledTime == nil { - var ret float64 - return ret - } - return *o.ScheduledTime -} - -// GetScheduledTimeOk returns a tuple with the ScheduledTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogMessageTimestamp) GetScheduledTimeOk() (*float64, bool) { - if o == nil || o.ScheduledTime == nil { - return nil, false - } - return o.ScheduledTime, true -} - -// HasScheduledTime returns a boolean if a field has been set. -func (o *TransportWebhookLogMessageTimestamp) HasScheduledTime() bool { - return o != nil && o.ScheduledTime != nil -} - -// SetScheduledTime gets a reference to the given float64 and assigns it to the ScheduledTime field. -func (o *TransportWebhookLogMessageTimestamp) SetScheduledTime(v float64) { - o.ScheduledTime = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogMessageTimestamp) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.EventTimestamp != nil { - toSerialize["event_timestamp"] = o.EventTimestamp - } - if o.Lifetime != nil { - toSerialize["lifetime"] = o.Lifetime - } - if o.QueueTime != nil { - toSerialize["queue_time"] = o.QueueTime - } - if o.ScheduledTime != nil { - toSerialize["scheduled_time"] = o.ScheduledTime - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogMessageTimestamp) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - EventTimestamp *float64 `json:"event_timestamp,omitempty"` - Lifetime *float64 `json:"lifetime,omitempty"` - QueueTime *float64 `json:"queue_time,omitempty"` - ScheduledTime *float64 `json:"scheduled_time,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"event_timestamp", "lifetime", "queue_time", "scheduled_time"}) - } else { - return err - } - o.EventTimestamp = all.EventTimestamp - o.Lifetime = all.Lifetime - o.QueueTime = all.QueueTime - o.ScheduledTime = all.ScheduledTime - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_transport_webhook_log_org_metadata.go b/api/datadogV2/model_transport_webhook_log_org_metadata.go deleted file mode 100644 index fd4dd171ee2..00000000000 --- a/api/datadogV2/model_transport_webhook_log_org_metadata.go +++ /dev/null @@ -1,627 +0,0 @@ -// 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 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// TransportWebhookLogOrgMetadata Metadata about the organization that sent the email. -type TransportWebhookLogOrgMetadata struct { - // Country code or name used for billing purposes. - BillingCountry *string `json:"billing_country,omitempty"` - // The Datadog billing plan for the organization (for example, "pro", "enterprise"). - BillingPlan *string `json:"billing_plan,omitempty"` - // Support or account tier assigned to the organization (for example, "tier-1"). - CustomerTier *string `json:"customer_tier,omitempty"` - // Primary email domain associated with the organization (for example, "example.com"). - Domain *string `json:"domain,omitempty"` - // Industry classification of the organization (for example, "technology", "finance"). - Industry *string `json:"industry,omitempty"` - // Whether the organization is enrolled in the Datadog bug bounty program. - IsBugbounty *string `json:"is_bugbounty,omitempty"` - // Whether the organization operates as a Managed Service Provider managing child orgs. - IsMsp *string `json:"is_msp,omitempty"` - // Display name of the organization as configured in Datadog account settings. - Name *string `json:"name,omitempty"` - // Globally unique identifier for the Datadog organization (UUID v1 format). - OrgUuid *string `json:"org_uuid,omitempty"` - // Identifier of the immediate parent organization, if this is a child org. - ParentOrgId *string `json:"parent_org_id,omitempty"` - // Whether the organization has a premium support plan with Datadog. - PremiumSupport *string `json:"premium_support,omitempty"` - // Identifier of the top-level parent organization in a multi-org account hierarchy. - RootOrgId *string `json:"root_org_id,omitempty"` - // Display name of the top-level parent organization in a multi-org account hierarchy. - RootOrgName *string `json:"root_org_name,omitempty"` - // Country code or name used for shipping or regional assignment. - ShippingCountry *string `json:"shipping_country,omitempty"` - // Website URL provided during organization registration. - Website *string `json:"website,omitempty"` - // ISO 8601 timestamp of when the Datadog organization was created. - WhenCreated *string `json:"when_created,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewTransportWebhookLogOrgMetadata instantiates a new TransportWebhookLogOrgMetadata object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewTransportWebhookLogOrgMetadata() *TransportWebhookLogOrgMetadata { - this := TransportWebhookLogOrgMetadata{} - return &this -} - -// NewTransportWebhookLogOrgMetadataWithDefaults instantiates a new TransportWebhookLogOrgMetadata object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewTransportWebhookLogOrgMetadataWithDefaults() *TransportWebhookLogOrgMetadata { - this := TransportWebhookLogOrgMetadata{} - return &this -} - -// GetBillingCountry returns the BillingCountry field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetBillingCountry() string { - if o == nil || o.BillingCountry == nil { - var ret string - return ret - } - return *o.BillingCountry -} - -// GetBillingCountryOk returns a tuple with the BillingCountry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetBillingCountryOk() (*string, bool) { - if o == nil || o.BillingCountry == nil { - return nil, false - } - return o.BillingCountry, true -} - -// HasBillingCountry returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasBillingCountry() bool { - return o != nil && o.BillingCountry != nil -} - -// SetBillingCountry gets a reference to the given string and assigns it to the BillingCountry field. -func (o *TransportWebhookLogOrgMetadata) SetBillingCountry(v string) { - o.BillingCountry = &v -} - -// GetBillingPlan returns the BillingPlan field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetBillingPlan() string { - if o == nil || o.BillingPlan == nil { - var ret string - return ret - } - return *o.BillingPlan -} - -// GetBillingPlanOk returns a tuple with the BillingPlan field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetBillingPlanOk() (*string, bool) { - if o == nil || o.BillingPlan == nil { - return nil, false - } - return o.BillingPlan, true -} - -// HasBillingPlan returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasBillingPlan() bool { - return o != nil && o.BillingPlan != nil -} - -// SetBillingPlan gets a reference to the given string and assigns it to the BillingPlan field. -func (o *TransportWebhookLogOrgMetadata) SetBillingPlan(v string) { - o.BillingPlan = &v -} - -// GetCustomerTier returns the CustomerTier field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetCustomerTier() string { - if o == nil || o.CustomerTier == nil { - var ret string - return ret - } - return *o.CustomerTier -} - -// GetCustomerTierOk returns a tuple with the CustomerTier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetCustomerTierOk() (*string, bool) { - if o == nil || o.CustomerTier == nil { - return nil, false - } - return o.CustomerTier, true -} - -// HasCustomerTier returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasCustomerTier() bool { - return o != nil && o.CustomerTier != nil -} - -// SetCustomerTier gets a reference to the given string and assigns it to the CustomerTier field. -func (o *TransportWebhookLogOrgMetadata) SetCustomerTier(v string) { - o.CustomerTier = &v -} - -// GetDomain returns the Domain field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetDomain() string { - if o == nil || o.Domain == nil { - var ret string - return ret - } - return *o.Domain -} - -// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetDomainOk() (*string, bool) { - if o == nil || o.Domain == nil { - return nil, false - } - return o.Domain, true -} - -// HasDomain returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasDomain() bool { - return o != nil && o.Domain != nil -} - -// SetDomain gets a reference to the given string and assigns it to the Domain field. -func (o *TransportWebhookLogOrgMetadata) SetDomain(v string) { - o.Domain = &v -} - -// GetIndustry returns the Industry field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetIndustry() string { - if o == nil || o.Industry == nil { - var ret string - return ret - } - return *o.Industry -} - -// GetIndustryOk returns a tuple with the Industry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetIndustryOk() (*string, bool) { - if o == nil || o.Industry == nil { - return nil, false - } - return o.Industry, true -} - -// HasIndustry returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasIndustry() bool { - return o != nil && o.Industry != nil -} - -// SetIndustry gets a reference to the given string and assigns it to the Industry field. -func (o *TransportWebhookLogOrgMetadata) SetIndustry(v string) { - o.Industry = &v -} - -// GetIsBugbounty returns the IsBugbounty field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetIsBugbounty() string { - if o == nil || o.IsBugbounty == nil { - var ret string - return ret - } - return *o.IsBugbounty -} - -// GetIsBugbountyOk returns a tuple with the IsBugbounty field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetIsBugbountyOk() (*string, bool) { - if o == nil || o.IsBugbounty == nil { - return nil, false - } - return o.IsBugbounty, true -} - -// HasIsBugbounty returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasIsBugbounty() bool { - return o != nil && o.IsBugbounty != nil -} - -// SetIsBugbounty gets a reference to the given string and assigns it to the IsBugbounty field. -func (o *TransportWebhookLogOrgMetadata) SetIsBugbounty(v string) { - o.IsBugbounty = &v -} - -// GetIsMsp returns the IsMsp field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetIsMsp() string { - if o == nil || o.IsMsp == nil { - var ret string - return ret - } - return *o.IsMsp -} - -// GetIsMspOk returns a tuple with the IsMsp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetIsMspOk() (*string, bool) { - if o == nil || o.IsMsp == nil { - return nil, false - } - return o.IsMsp, true -} - -// HasIsMsp returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasIsMsp() bool { - return o != nil && o.IsMsp != nil -} - -// SetIsMsp gets a reference to the given string and assigns it to the IsMsp field. -func (o *TransportWebhookLogOrgMetadata) SetIsMsp(v string) { - o.IsMsp = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *TransportWebhookLogOrgMetadata) SetName(v string) { - o.Name = &v -} - -// GetOrgUuid returns the OrgUuid field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetOrgUuid() string { - if o == nil || o.OrgUuid == nil { - var ret string - return ret - } - return *o.OrgUuid -} - -// GetOrgUuidOk returns a tuple with the OrgUuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetOrgUuidOk() (*string, bool) { - if o == nil || o.OrgUuid == nil { - return nil, false - } - return o.OrgUuid, true -} - -// HasOrgUuid returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasOrgUuid() bool { - return o != nil && o.OrgUuid != nil -} - -// SetOrgUuid gets a reference to the given string and assigns it to the OrgUuid field. -func (o *TransportWebhookLogOrgMetadata) SetOrgUuid(v string) { - o.OrgUuid = &v -} - -// GetParentOrgId returns the ParentOrgId field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetParentOrgId() string { - if o == nil || o.ParentOrgId == nil { - var ret string - return ret - } - return *o.ParentOrgId -} - -// GetParentOrgIdOk returns a tuple with the ParentOrgId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetParentOrgIdOk() (*string, bool) { - if o == nil || o.ParentOrgId == nil { - return nil, false - } - return o.ParentOrgId, true -} - -// HasParentOrgId returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasParentOrgId() bool { - return o != nil && o.ParentOrgId != nil -} - -// SetParentOrgId gets a reference to the given string and assigns it to the ParentOrgId field. -func (o *TransportWebhookLogOrgMetadata) SetParentOrgId(v string) { - o.ParentOrgId = &v -} - -// GetPremiumSupport returns the PremiumSupport field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetPremiumSupport() string { - if o == nil || o.PremiumSupport == nil { - var ret string - return ret - } - return *o.PremiumSupport -} - -// GetPremiumSupportOk returns a tuple with the PremiumSupport field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetPremiumSupportOk() (*string, bool) { - if o == nil || o.PremiumSupport == nil { - return nil, false - } - return o.PremiumSupport, true -} - -// HasPremiumSupport returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasPremiumSupport() bool { - return o != nil && o.PremiumSupport != nil -} - -// SetPremiumSupport gets a reference to the given string and assigns it to the PremiumSupport field. -func (o *TransportWebhookLogOrgMetadata) SetPremiumSupport(v string) { - o.PremiumSupport = &v -} - -// GetRootOrgId returns the RootOrgId field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetRootOrgId() string { - if o == nil || o.RootOrgId == nil { - var ret string - return ret - } - return *o.RootOrgId -} - -// GetRootOrgIdOk returns a tuple with the RootOrgId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetRootOrgIdOk() (*string, bool) { - if o == nil || o.RootOrgId == nil { - return nil, false - } - return o.RootOrgId, true -} - -// HasRootOrgId returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasRootOrgId() bool { - return o != nil && o.RootOrgId != nil -} - -// SetRootOrgId gets a reference to the given string and assigns it to the RootOrgId field. -func (o *TransportWebhookLogOrgMetadata) SetRootOrgId(v string) { - o.RootOrgId = &v -} - -// GetRootOrgName returns the RootOrgName field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetRootOrgName() string { - if o == nil || o.RootOrgName == nil { - var ret string - return ret - } - return *o.RootOrgName -} - -// GetRootOrgNameOk returns a tuple with the RootOrgName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetRootOrgNameOk() (*string, bool) { - if o == nil || o.RootOrgName == nil { - return nil, false - } - return o.RootOrgName, true -} - -// HasRootOrgName returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasRootOrgName() bool { - return o != nil && o.RootOrgName != nil -} - -// SetRootOrgName gets a reference to the given string and assigns it to the RootOrgName field. -func (o *TransportWebhookLogOrgMetadata) SetRootOrgName(v string) { - o.RootOrgName = &v -} - -// GetShippingCountry returns the ShippingCountry field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetShippingCountry() string { - if o == nil || o.ShippingCountry == nil { - var ret string - return ret - } - return *o.ShippingCountry -} - -// GetShippingCountryOk returns a tuple with the ShippingCountry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetShippingCountryOk() (*string, bool) { - if o == nil || o.ShippingCountry == nil { - return nil, false - } - return o.ShippingCountry, true -} - -// HasShippingCountry returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasShippingCountry() bool { - return o != nil && o.ShippingCountry != nil -} - -// SetShippingCountry gets a reference to the given string and assigns it to the ShippingCountry field. -func (o *TransportWebhookLogOrgMetadata) SetShippingCountry(v string) { - o.ShippingCountry = &v -} - -// GetWebsite returns the Website field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetWebsite() string { - if o == nil || o.Website == nil { - var ret string - return ret - } - return *o.Website -} - -// GetWebsiteOk returns a tuple with the Website field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetWebsiteOk() (*string, bool) { - if o == nil || o.Website == nil { - return nil, false - } - return o.Website, true -} - -// HasWebsite returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasWebsite() bool { - return o != nil && o.Website != nil -} - -// SetWebsite gets a reference to the given string and assigns it to the Website field. -func (o *TransportWebhookLogOrgMetadata) SetWebsite(v string) { - o.Website = &v -} - -// GetWhenCreated returns the WhenCreated field value if set, zero value otherwise. -func (o *TransportWebhookLogOrgMetadata) GetWhenCreated() string { - if o == nil || o.WhenCreated == nil { - var ret string - return ret - } - return *o.WhenCreated -} - -// GetWhenCreatedOk returns a tuple with the WhenCreated field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransportWebhookLogOrgMetadata) GetWhenCreatedOk() (*string, bool) { - if o == nil || o.WhenCreated == nil { - return nil, false - } - return o.WhenCreated, true -} - -// HasWhenCreated returns a boolean if a field has been set. -func (o *TransportWebhookLogOrgMetadata) HasWhenCreated() bool { - return o != nil && o.WhenCreated != nil -} - -// SetWhenCreated gets a reference to the given string and assigns it to the WhenCreated field. -func (o *TransportWebhookLogOrgMetadata) SetWhenCreated(v string) { - o.WhenCreated = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o TransportWebhookLogOrgMetadata) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.BillingCountry != nil { - toSerialize["billing_country"] = o.BillingCountry - } - if o.BillingPlan != nil { - toSerialize["billing_plan"] = o.BillingPlan - } - if o.CustomerTier != nil { - toSerialize["customer_tier"] = o.CustomerTier - } - if o.Domain != nil { - toSerialize["domain"] = o.Domain - } - if o.Industry != nil { - toSerialize["industry"] = o.Industry - } - if o.IsBugbounty != nil { - toSerialize["is_bugbounty"] = o.IsBugbounty - } - if o.IsMsp != nil { - toSerialize["is_msp"] = o.IsMsp - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.OrgUuid != nil { - toSerialize["org_uuid"] = o.OrgUuid - } - if o.ParentOrgId != nil { - toSerialize["parent_org_id"] = o.ParentOrgId - } - if o.PremiumSupport != nil { - toSerialize["premium_support"] = o.PremiumSupport - } - if o.RootOrgId != nil { - toSerialize["root_org_id"] = o.RootOrgId - } - if o.RootOrgName != nil { - toSerialize["root_org_name"] = o.RootOrgName - } - if o.ShippingCountry != nil { - toSerialize["shipping_country"] = o.ShippingCountry - } - if o.Website != nil { - toSerialize["website"] = o.Website - } - if o.WhenCreated != nil { - toSerialize["when_created"] = o.WhenCreated - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *TransportWebhookLogOrgMetadata) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - BillingCountry *string `json:"billing_country,omitempty"` - BillingPlan *string `json:"billing_plan,omitempty"` - CustomerTier *string `json:"customer_tier,omitempty"` - Domain *string `json:"domain,omitempty"` - Industry *string `json:"industry,omitempty"` - IsBugbounty *string `json:"is_bugbounty,omitempty"` - IsMsp *string `json:"is_msp,omitempty"` - Name *string `json:"name,omitempty"` - OrgUuid *string `json:"org_uuid,omitempty"` - ParentOrgId *string `json:"parent_org_id,omitempty"` - PremiumSupport *string `json:"premium_support,omitempty"` - RootOrgId *string `json:"root_org_id,omitempty"` - RootOrgName *string `json:"root_org_name,omitempty"` - ShippingCountry *string `json:"shipping_country,omitempty"` - Website *string `json:"website,omitempty"` - WhenCreated *string `json:"when_created,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"billing_country", "billing_plan", "customer_tier", "domain", "industry", "is_bugbounty", "is_msp", "name", "org_uuid", "parent_org_id", "premium_support", "root_org_id", "root_org_name", "shipping_country", "website", "when_created"}) - } else { - return err - } - o.BillingCountry = all.BillingCountry - o.BillingPlan = all.BillingPlan - o.CustomerTier = all.CustomerTier - o.Domain = all.Domain - o.Industry = all.Industry - o.IsBugbounty = all.IsBugbounty - o.IsMsp = all.IsMsp - o.Name = all.Name - o.OrgUuid = all.OrgUuid - o.ParentOrgId = all.ParentOrgId - o.PremiumSupport = all.PremiumSupport - o.RootOrgId = all.RootOrgId - o.RootOrgName = all.RootOrgName - o.ShippingCountry = all.ShippingCountry - o.Website = all.Website - o.WhenCreated = all.WhenCreated - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_update_app_favorite_request.go b/api/datadogV2/model_update_app_favorite_request.go new file mode 100644 index 00000000000..1a37144c964 --- /dev/null +++ b/api/datadogV2/model_update_app_favorite_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppFavoriteRequest A request to add or remove an app from the current user's favorites. +type UpdateAppFavoriteRequest struct { + // Data for updating an app's favorite status. + Data *UpdateAppFavoriteRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppFavoriteRequest instantiates a new UpdateAppFavoriteRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppFavoriteRequest() *UpdateAppFavoriteRequest { + this := UpdateAppFavoriteRequest{} + return &this +} + +// NewUpdateAppFavoriteRequestWithDefaults instantiates a new UpdateAppFavoriteRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppFavoriteRequestWithDefaults() *UpdateAppFavoriteRequest { + this := UpdateAppFavoriteRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppFavoriteRequest) GetData() UpdateAppFavoriteRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppFavoriteRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppFavoriteRequest) GetDataOk() (*UpdateAppFavoriteRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppFavoriteRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppFavoriteRequestData and assigns it to the Data field. +func (o *UpdateAppFavoriteRequest) SetData(v UpdateAppFavoriteRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppFavoriteRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppFavoriteRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppFavoriteRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_favorite_request_data.go b/api/datadogV2/model_update_app_favorite_request_data.go new file mode 100644 index 00000000000..278639b8c44 --- /dev/null +++ b/api/datadogV2/model_update_app_favorite_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppFavoriteRequestData Data for updating an app's favorite status. +type UpdateAppFavoriteRequestData struct { + // Attributes for updating an app's favorite status. + Attributes *UpdateAppFavoriteRequestDataAttributes `json:"attributes,omitempty"` + // The favorite resource type. + Type *AppFavoriteType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppFavoriteRequestData instantiates a new UpdateAppFavoriteRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppFavoriteRequestData() *UpdateAppFavoriteRequestData { + this := UpdateAppFavoriteRequestData{} + var typeVar AppFavoriteType = APPFAVORITETYPE_FAVORITES + this.Type = &typeVar + return &this +} + +// NewUpdateAppFavoriteRequestDataWithDefaults instantiates a new UpdateAppFavoriteRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppFavoriteRequestDataWithDefaults() *UpdateAppFavoriteRequestData { + this := UpdateAppFavoriteRequestData{} + var typeVar AppFavoriteType = APPFAVORITETYPE_FAVORITES + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppFavoriteRequestData) GetAttributes() UpdateAppFavoriteRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppFavoriteRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppFavoriteRequestData) GetAttributesOk() (*UpdateAppFavoriteRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppFavoriteRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppFavoriteRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppFavoriteRequestData) SetAttributes(v UpdateAppFavoriteRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateAppFavoriteRequestData) GetType() AppFavoriteType { + if o == nil || o.Type == nil { + var ret AppFavoriteType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppFavoriteRequestData) GetTypeOk() (*AppFavoriteType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateAppFavoriteRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppFavoriteType and assigns it to the Type field. +func (o *UpdateAppFavoriteRequestData) SetType(v AppFavoriteType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppFavoriteRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppFavoriteRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppFavoriteRequestDataAttributes `json:"attributes,omitempty"` + Type *AppFavoriteType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_favorite_request_data_attributes.go b/api/datadogV2/model_update_app_favorite_request_data_attributes.go new file mode 100644 index 00000000000..e5d94879951 --- /dev/null +++ b/api/datadogV2/model_update_app_favorite_request_data_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppFavoriteRequestDataAttributes Attributes for updating an app's favorite status. +type UpdateAppFavoriteRequestDataAttributes struct { + // Whether the app should be marked as a favorite for the current user. + Favorite bool `json:"favorite"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppFavoriteRequestDataAttributes instantiates a new UpdateAppFavoriteRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppFavoriteRequestDataAttributes(favorite bool) *UpdateAppFavoriteRequestDataAttributes { + this := UpdateAppFavoriteRequestDataAttributes{} + this.Favorite = favorite + return &this +} + +// NewUpdateAppFavoriteRequestDataAttributesWithDefaults instantiates a new UpdateAppFavoriteRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppFavoriteRequestDataAttributesWithDefaults() *UpdateAppFavoriteRequestDataAttributes { + this := UpdateAppFavoriteRequestDataAttributes{} + return &this +} + +// GetFavorite returns the Favorite field value. +func (o *UpdateAppFavoriteRequestDataAttributes) GetFavorite() bool { + if o == nil { + var ret bool + return ret + } + return o.Favorite +} + +// GetFavoriteOk returns a tuple with the Favorite field value +// and a boolean to check if the value has been set. +func (o *UpdateAppFavoriteRequestDataAttributes) GetFavoriteOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Favorite, true +} + +// SetFavorite sets field value. +func (o *UpdateAppFavoriteRequestDataAttributes) SetFavorite(v bool) { + o.Favorite = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppFavoriteRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["favorite"] = o.Favorite + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppFavoriteRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Favorite *bool `json:"favorite"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Favorite == nil { + return fmt.Errorf("required field favorite missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"favorite"}) + } else { + return err + } + o.Favorite = *all.Favorite + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_update_app_protection_level_request.go b/api/datadogV2/model_update_app_protection_level_request.go new file mode 100644 index 00000000000..9e756cf26e1 --- /dev/null +++ b/api/datadogV2/model_update_app_protection_level_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppProtectionLevelRequest A request to update an app's publication protection level. +type UpdateAppProtectionLevelRequest struct { + // Data for updating an app's publication protection level. + Data *UpdateAppProtectionLevelRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppProtectionLevelRequest instantiates a new UpdateAppProtectionLevelRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppProtectionLevelRequest() *UpdateAppProtectionLevelRequest { + this := UpdateAppProtectionLevelRequest{} + return &this +} + +// NewUpdateAppProtectionLevelRequestWithDefaults instantiates a new UpdateAppProtectionLevelRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppProtectionLevelRequestWithDefaults() *UpdateAppProtectionLevelRequest { + this := UpdateAppProtectionLevelRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppProtectionLevelRequest) GetData() UpdateAppProtectionLevelRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppProtectionLevelRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppProtectionLevelRequest) GetDataOk() (*UpdateAppProtectionLevelRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppProtectionLevelRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppProtectionLevelRequestData and assigns it to the Data field. +func (o *UpdateAppProtectionLevelRequest) SetData(v UpdateAppProtectionLevelRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppProtectionLevelRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppProtectionLevelRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppProtectionLevelRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_protection_level_request_data.go b/api/datadogV2/model_update_app_protection_level_request_data.go new file mode 100644 index 00000000000..f55a94dc153 --- /dev/null +++ b/api/datadogV2/model_update_app_protection_level_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppProtectionLevelRequestData Data for updating an app's publication protection level. +type UpdateAppProtectionLevelRequestData struct { + // Attributes for updating an app's publication protection level. + Attributes *UpdateAppProtectionLevelRequestDataAttributes `json:"attributes,omitempty"` + // The protection-level resource type. + Type *AppProtectionLevelType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppProtectionLevelRequestData instantiates a new UpdateAppProtectionLevelRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppProtectionLevelRequestData() *UpdateAppProtectionLevelRequestData { + this := UpdateAppProtectionLevelRequestData{} + var typeVar AppProtectionLevelType = APPPROTECTIONLEVELTYPE_PROTECTIONLEVEL + this.Type = &typeVar + return &this +} + +// NewUpdateAppProtectionLevelRequestDataWithDefaults instantiates a new UpdateAppProtectionLevelRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppProtectionLevelRequestDataWithDefaults() *UpdateAppProtectionLevelRequestData { + this := UpdateAppProtectionLevelRequestData{} + var typeVar AppProtectionLevelType = APPPROTECTIONLEVELTYPE_PROTECTIONLEVEL + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppProtectionLevelRequestData) GetAttributes() UpdateAppProtectionLevelRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppProtectionLevelRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppProtectionLevelRequestData) GetAttributesOk() (*UpdateAppProtectionLevelRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppProtectionLevelRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppProtectionLevelRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppProtectionLevelRequestData) SetAttributes(v UpdateAppProtectionLevelRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateAppProtectionLevelRequestData) GetType() AppProtectionLevelType { + if o == nil || o.Type == nil { + var ret AppProtectionLevelType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppProtectionLevelRequestData) GetTypeOk() (*AppProtectionLevelType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateAppProtectionLevelRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppProtectionLevelType and assigns it to the Type field. +func (o *UpdateAppProtectionLevelRequestData) SetType(v AppProtectionLevelType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppProtectionLevelRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppProtectionLevelRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppProtectionLevelRequestDataAttributes `json:"attributes,omitempty"` + Type *AppProtectionLevelType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_protection_level_request_data_attributes.go b/api/datadogV2/model_update_app_protection_level_request_data_attributes.go new file mode 100644 index 00000000000..e0e873a1903 --- /dev/null +++ b/api/datadogV2/model_update_app_protection_level_request_data_attributes.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppProtectionLevelRequestDataAttributes Attributes for updating an app's publication protection level. +type UpdateAppProtectionLevelRequestDataAttributes struct { + // The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + ProtectionLevel AppProtectionLevel `json:"protectionLevel"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppProtectionLevelRequestDataAttributes instantiates a new UpdateAppProtectionLevelRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppProtectionLevelRequestDataAttributes(protectionLevel AppProtectionLevel) *UpdateAppProtectionLevelRequestDataAttributes { + this := UpdateAppProtectionLevelRequestDataAttributes{} + this.ProtectionLevel = protectionLevel + return &this +} + +// NewUpdateAppProtectionLevelRequestDataAttributesWithDefaults instantiates a new UpdateAppProtectionLevelRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppProtectionLevelRequestDataAttributesWithDefaults() *UpdateAppProtectionLevelRequestDataAttributes { + this := UpdateAppProtectionLevelRequestDataAttributes{} + return &this +} + +// GetProtectionLevel returns the ProtectionLevel field value. +func (o *UpdateAppProtectionLevelRequestDataAttributes) GetProtectionLevel() AppProtectionLevel { + if o == nil { + var ret AppProtectionLevel + return ret + } + return o.ProtectionLevel +} + +// GetProtectionLevelOk returns a tuple with the ProtectionLevel field value +// and a boolean to check if the value has been set. +func (o *UpdateAppProtectionLevelRequestDataAttributes) GetProtectionLevelOk() (*AppProtectionLevel, bool) { + if o == nil { + return nil, false + } + return &o.ProtectionLevel, true +} + +// SetProtectionLevel sets field value. +func (o *UpdateAppProtectionLevelRequestDataAttributes) SetProtectionLevel(v AppProtectionLevel) { + o.ProtectionLevel = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppProtectionLevelRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["protectionLevel"] = o.ProtectionLevel + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppProtectionLevelRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ProtectionLevel *AppProtectionLevel `json:"protectionLevel"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ProtectionLevel == nil { + return fmt.Errorf("required field protectionLevel missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"protectionLevel"}) + } else { + return err + } + + hasInvalidField := false + if !all.ProtectionLevel.IsValid() { + hasInvalidField = true + } else { + o.ProtectionLevel = *all.ProtectionLevel + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_self_service_request.go b/api/datadogV2/model_update_app_self_service_request.go new file mode 100644 index 00000000000..8684a0d1807 --- /dev/null +++ b/api/datadogV2/model_update_app_self_service_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppSelfServiceRequest A request to enable or disable self-service for an app. +type UpdateAppSelfServiceRequest struct { + // Data for updating an app's self-service status. + Data *UpdateAppSelfServiceRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppSelfServiceRequest instantiates a new UpdateAppSelfServiceRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppSelfServiceRequest() *UpdateAppSelfServiceRequest { + this := UpdateAppSelfServiceRequest{} + return &this +} + +// NewUpdateAppSelfServiceRequestWithDefaults instantiates a new UpdateAppSelfServiceRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppSelfServiceRequestWithDefaults() *UpdateAppSelfServiceRequest { + this := UpdateAppSelfServiceRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppSelfServiceRequest) GetData() UpdateAppSelfServiceRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppSelfServiceRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppSelfServiceRequest) GetDataOk() (*UpdateAppSelfServiceRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppSelfServiceRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppSelfServiceRequestData and assigns it to the Data field. +func (o *UpdateAppSelfServiceRequest) SetData(v UpdateAppSelfServiceRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppSelfServiceRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppSelfServiceRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppSelfServiceRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_self_service_request_data.go b/api/datadogV2/model_update_app_self_service_request_data.go new file mode 100644 index 00000000000..33d6f27a1d8 --- /dev/null +++ b/api/datadogV2/model_update_app_self_service_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppSelfServiceRequestData Data for updating an app's self-service status. +type UpdateAppSelfServiceRequestData struct { + // Attributes for updating an app's self-service status. + Attributes *UpdateAppSelfServiceRequestDataAttributes `json:"attributes,omitempty"` + // The self-service resource type. + Type *AppSelfServiceType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppSelfServiceRequestData instantiates a new UpdateAppSelfServiceRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppSelfServiceRequestData() *UpdateAppSelfServiceRequestData { + this := UpdateAppSelfServiceRequestData{} + var typeVar AppSelfServiceType = APPSELFSERVICETYPE_SELFSERVICE + this.Type = &typeVar + return &this +} + +// NewUpdateAppSelfServiceRequestDataWithDefaults instantiates a new UpdateAppSelfServiceRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppSelfServiceRequestDataWithDefaults() *UpdateAppSelfServiceRequestData { + this := UpdateAppSelfServiceRequestData{} + var typeVar AppSelfServiceType = APPSELFSERVICETYPE_SELFSERVICE + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppSelfServiceRequestData) GetAttributes() UpdateAppSelfServiceRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppSelfServiceRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppSelfServiceRequestData) GetAttributesOk() (*UpdateAppSelfServiceRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppSelfServiceRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppSelfServiceRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppSelfServiceRequestData) SetAttributes(v UpdateAppSelfServiceRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateAppSelfServiceRequestData) GetType() AppSelfServiceType { + if o == nil || o.Type == nil { + var ret AppSelfServiceType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppSelfServiceRequestData) GetTypeOk() (*AppSelfServiceType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateAppSelfServiceRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppSelfServiceType and assigns it to the Type field. +func (o *UpdateAppSelfServiceRequestData) SetType(v AppSelfServiceType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppSelfServiceRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppSelfServiceRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppSelfServiceRequestDataAttributes `json:"attributes,omitempty"` + Type *AppSelfServiceType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_self_service_request_data_attributes.go b/api/datadogV2/model_update_app_self_service_request_data_attributes.go new file mode 100644 index 00000000000..f431c10152b --- /dev/null +++ b/api/datadogV2/model_update_app_self_service_request_data_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppSelfServiceRequestDataAttributes Attributes for updating an app's self-service status. +type UpdateAppSelfServiceRequestDataAttributes struct { + // Whether the app is enabled for self-service. + SelfService bool `json:"selfService"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppSelfServiceRequestDataAttributes instantiates a new UpdateAppSelfServiceRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppSelfServiceRequestDataAttributes(selfService bool) *UpdateAppSelfServiceRequestDataAttributes { + this := UpdateAppSelfServiceRequestDataAttributes{} + this.SelfService = selfService + return &this +} + +// NewUpdateAppSelfServiceRequestDataAttributesWithDefaults instantiates a new UpdateAppSelfServiceRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppSelfServiceRequestDataAttributesWithDefaults() *UpdateAppSelfServiceRequestDataAttributes { + this := UpdateAppSelfServiceRequestDataAttributes{} + return &this +} + +// GetSelfService returns the SelfService field value. +func (o *UpdateAppSelfServiceRequestDataAttributes) GetSelfService() bool { + if o == nil { + var ret bool + return ret + } + return o.SelfService +} + +// GetSelfServiceOk returns a tuple with the SelfService field value +// and a boolean to check if the value has been set. +func (o *UpdateAppSelfServiceRequestDataAttributes) GetSelfServiceOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.SelfService, true +} + +// SetSelfService sets field value. +func (o *UpdateAppSelfServiceRequestDataAttributes) SetSelfService(v bool) { + o.SelfService = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppSelfServiceRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["selfService"] = o.SelfService + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppSelfServiceRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + SelfService *bool `json:"selfService"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.SelfService == nil { + return fmt.Errorf("required field selfService missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"selfService"}) + } else { + return err + } + o.SelfService = *all.SelfService + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_update_app_tags_request.go b/api/datadogV2/model_update_app_tags_request.go new file mode 100644 index 00000000000..55371051e83 --- /dev/null +++ b/api/datadogV2/model_update_app_tags_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppTagsRequest A request to replace the tags on an app. +type UpdateAppTagsRequest struct { + // Data for replacing an app's tags. + Data *UpdateAppTagsRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppTagsRequest instantiates a new UpdateAppTagsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppTagsRequest() *UpdateAppTagsRequest { + this := UpdateAppTagsRequest{} + return &this +} + +// NewUpdateAppTagsRequestWithDefaults instantiates a new UpdateAppTagsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppTagsRequestWithDefaults() *UpdateAppTagsRequest { + this := UpdateAppTagsRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppTagsRequest) GetData() UpdateAppTagsRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppTagsRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppTagsRequest) GetDataOk() (*UpdateAppTagsRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppTagsRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppTagsRequestData and assigns it to the Data field. +func (o *UpdateAppTagsRequest) SetData(v UpdateAppTagsRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppTagsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppTagsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppTagsRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_tags_request_data.go b/api/datadogV2/model_update_app_tags_request_data.go new file mode 100644 index 00000000000..995e2dc1d47 --- /dev/null +++ b/api/datadogV2/model_update_app_tags_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppTagsRequestData Data for replacing an app's tags. +type UpdateAppTagsRequestData struct { + // Attributes for replacing an app's tags. + Attributes *UpdateAppTagsRequestDataAttributes `json:"attributes,omitempty"` + // The tags resource type. + Type *AppTagsType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppTagsRequestData instantiates a new UpdateAppTagsRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppTagsRequestData() *UpdateAppTagsRequestData { + this := UpdateAppTagsRequestData{} + var typeVar AppTagsType = APPTAGSTYPE_TAGS + this.Type = &typeVar + return &this +} + +// NewUpdateAppTagsRequestDataWithDefaults instantiates a new UpdateAppTagsRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppTagsRequestDataWithDefaults() *UpdateAppTagsRequestData { + this := UpdateAppTagsRequestData{} + var typeVar AppTagsType = APPTAGSTYPE_TAGS + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppTagsRequestData) GetAttributes() UpdateAppTagsRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppTagsRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppTagsRequestData) GetAttributesOk() (*UpdateAppTagsRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppTagsRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppTagsRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppTagsRequestData) SetAttributes(v UpdateAppTagsRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateAppTagsRequestData) GetType() AppTagsType { + if o == nil || o.Type == nil { + var ret AppTagsType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppTagsRequestData) GetTypeOk() (*AppTagsType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateAppTagsRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppTagsType and assigns it to the Type field. +func (o *UpdateAppTagsRequestData) SetType(v AppTagsType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppTagsRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppTagsRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppTagsRequestDataAttributes `json:"attributes,omitempty"` + Type *AppTagsType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_tags_request_data_attributes.go b/api/datadogV2/model_update_app_tags_request_data_attributes.go new file mode 100644 index 00000000000..5894de4f465 --- /dev/null +++ b/api/datadogV2/model_update_app_tags_request_data_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppTagsRequestDataAttributes Attributes for replacing an app's tags. +type UpdateAppTagsRequestDataAttributes struct { + // The full list of tags that should be set on the app. Existing tags not present in this list are removed. + Tags []string `json:"tags"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppTagsRequestDataAttributes instantiates a new UpdateAppTagsRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppTagsRequestDataAttributes(tags []string) *UpdateAppTagsRequestDataAttributes { + this := UpdateAppTagsRequestDataAttributes{} + this.Tags = tags + return &this +} + +// NewUpdateAppTagsRequestDataAttributesWithDefaults instantiates a new UpdateAppTagsRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppTagsRequestDataAttributesWithDefaults() *UpdateAppTagsRequestDataAttributes { + this := UpdateAppTagsRequestDataAttributes{} + return &this +} + +// GetTags returns the Tags field value. +func (o *UpdateAppTagsRequestDataAttributes) GetTags() []string { + if o == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *UpdateAppTagsRequestDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *UpdateAppTagsRequestDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppTagsRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["tags"] = o.Tags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppTagsRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Tags *[]string `json:"tags"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"tags"}) + } else { + return err + } + o.Tags = *all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_update_app_version_name_request.go b/api/datadogV2/model_update_app_version_name_request.go new file mode 100644 index 00000000000..16d396726d1 --- /dev/null +++ b/api/datadogV2/model_update_app_version_name_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppVersionNameRequest A request to assign a human-readable name to a specific app version. +type UpdateAppVersionNameRequest struct { + // Data for naming a specific app version. + Data *UpdateAppVersionNameRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppVersionNameRequest instantiates a new UpdateAppVersionNameRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppVersionNameRequest() *UpdateAppVersionNameRequest { + this := UpdateAppVersionNameRequest{} + return &this +} + +// NewUpdateAppVersionNameRequestWithDefaults instantiates a new UpdateAppVersionNameRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppVersionNameRequestWithDefaults() *UpdateAppVersionNameRequest { + this := UpdateAppVersionNameRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppVersionNameRequest) GetData() UpdateAppVersionNameRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppVersionNameRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppVersionNameRequest) GetDataOk() (*UpdateAppVersionNameRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppVersionNameRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppVersionNameRequestData and assigns it to the Data field. +func (o *UpdateAppVersionNameRequest) SetData(v UpdateAppVersionNameRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppVersionNameRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppVersionNameRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppVersionNameRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_version_name_request_data.go b/api/datadogV2/model_update_app_version_name_request_data.go new file mode 100644 index 00000000000..48045be31be --- /dev/null +++ b/api/datadogV2/model_update_app_version_name_request_data.go @@ -0,0 +1,154 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppVersionNameRequestData Data for naming a specific app version. +type UpdateAppVersionNameRequestData struct { + // Attributes for naming a specific app version. + Attributes *UpdateAppVersionNameRequestDataAttributes `json:"attributes,omitempty"` + // The version-name resource type. + Type *AppVersionNameType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppVersionNameRequestData instantiates a new UpdateAppVersionNameRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppVersionNameRequestData() *UpdateAppVersionNameRequestData { + this := UpdateAppVersionNameRequestData{} + var typeVar AppVersionNameType = APPVERSIONNAMETYPE_VERSIONNAMES + this.Type = &typeVar + return &this +} + +// NewUpdateAppVersionNameRequestDataWithDefaults instantiates a new UpdateAppVersionNameRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppVersionNameRequestDataWithDefaults() *UpdateAppVersionNameRequestData { + this := UpdateAppVersionNameRequestData{} + var typeVar AppVersionNameType = APPVERSIONNAMETYPE_VERSIONNAMES + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppVersionNameRequestData) GetAttributes() UpdateAppVersionNameRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppVersionNameRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppVersionNameRequestData) GetAttributesOk() (*UpdateAppVersionNameRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppVersionNameRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppVersionNameRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppVersionNameRequestData) SetAttributes(v UpdateAppVersionNameRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UpdateAppVersionNameRequestData) GetType() AppVersionNameType { + if o == nil || o.Type == nil { + var ret AppVersionNameType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppVersionNameRequestData) GetTypeOk() (*AppVersionNameType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UpdateAppVersionNameRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppVersionNameType and assigns it to the Type field. +func (o *UpdateAppVersionNameRequestData) SetType(v AppVersionNameType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppVersionNameRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppVersionNameRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppVersionNameRequestDataAttributes `json:"attributes,omitempty"` + Type *AppVersionNameType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_version_name_request_data_attributes.go b/api/datadogV2/model_update_app_version_name_request_data_attributes.go new file mode 100644 index 00000000000..7ed447a73ef --- /dev/null +++ b/api/datadogV2/model_update_app_version_name_request_data_attributes.go @@ -0,0 +1,101 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppVersionNameRequestDataAttributes Attributes for naming a specific app version. +type UpdateAppVersionNameRequestDataAttributes struct { + // The name to assign to the app version. + Name string `json:"name"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppVersionNameRequestDataAttributes instantiates a new UpdateAppVersionNameRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppVersionNameRequestDataAttributes(name string) *UpdateAppVersionNameRequestDataAttributes { + this := UpdateAppVersionNameRequestDataAttributes{} + this.Name = name + return &this +} + +// NewUpdateAppVersionNameRequestDataAttributesWithDefaults instantiates a new UpdateAppVersionNameRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppVersionNameRequestDataAttributesWithDefaults() *UpdateAppVersionNameRequestDataAttributes { + this := UpdateAppVersionNameRequestDataAttributes{} + return &this +} + +// GetName returns the Name field value. +func (o *UpdateAppVersionNameRequestDataAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UpdateAppVersionNameRequestDataAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *UpdateAppVersionNameRequestDataAttributes) SetName(v string) { + o.Name = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppVersionNameRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppVersionNameRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name"}) + } else { + return err + } + o.Name = *all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/examples/v1/monitors/CreateMonitor_2589528326.go b/examples/v1/monitors/CreateMonitor_2589528326.go new file mode 100644 index 00000000000..b1d92d3065b --- /dev/null +++ b/examples/v1/monitors/CreateMonitor_2589528326.go @@ -0,0 +1,53 @@ +// Create a Data Jobs monitor returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" +) + +func main() { + body := datadogV1.Monitor{ + Name: datadog.PtrString("Example-Monitor"), + Type: datadogV1.MONITORTYPE_DATA_JOBS_ALERT, + Query: `formula("failed_runs(run_query)").by(job_name,workspace_name).last(10d) > 0`, + Message: datadog.PtrString("Data jobs alert triggered"), + Tags: []string{ + "test:examplemonitor", + "env:ci", + }, + Options: &datadogV1.MonitorOptions{ + Thresholds: &datadogV1.MonitorThresholds{ + Critical: datadog.PtrFloat64(0), + }, + Variables: []datadogV1.MonitorFormulaAndFunctionQueryDefinition{ + datadogV1.MonitorFormulaAndFunctionQueryDefinition{ + MonitorFormulaAndFunctionDataJobsQueryDefinition: &datadogV1.MonitorFormulaAndFunctionDataJobsQueryDefinition{ + Name: "run_query", + JobsQuery: "job_name:*", + JobType: "databricks.job", + QueryDialect: "metric", + }}, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV1.NewMonitorsApi(apiClient) + resp, r, err := api.CreateMonitor(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MonitorsApi.CreateMonitor`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `MonitorsApi.CreateMonitor`:\n%s\n", responseContent) +} diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_2547523542.go b/examples/v1/synthetics/CreateSyntheticsAPITest_2547523542.go new file mode 100644 index 00000000000..0cc73f86e0b --- /dev/null +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_2547523542.go @@ -0,0 +1,189 @@ +// Create an API test with MCP steps returns "OK - Returns the created test details." response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" +) + +func main() { + body := datadogV1.SyntheticsAPITest{ + Config: datadogV1.SyntheticsAPITestConfig{ + Steps: []datadogV1.SyntheticsAPIStep{ + datadogV1.SyntheticsAPIStep{ + SyntheticsAPITestStep: &datadogV1.SyntheticsAPITestStep{ + Name: "Initialize MCP session", + Subtype: datadogV1.SYNTHETICSAPITESTSTEPSUBTYPE_MCP, + AllowFailure: datadog.PtrBool(false), + IsCritical: datadog.PtrBool(true), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(0), + Interval: datadog.PtrFloat64(300), + }, + Assertions: []datadogV1.SyntheticsAssertion{ + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_IS, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_STATUS_CODE, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(200)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionMCPRespectsSpecification: &datadogV1.SyntheticsAssertionMCPRespectsSpecification{ + Type: datadogV1.SYNTHETICSASSERTIONMCPRESPECTSSPECIFICATIONTYPE_MCP_RESPECTS_SPECIFICATION, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionMCPServerCapabilitiesTarget: &datadogV1.SyntheticsAssertionMCPServerCapabilitiesTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_CONTAINS, + Type: datadogV1.SYNTHETICSASSERTIONMCPSERVERCAPABILITIESTYPE_MCP_SERVER_CAPABILITIES, + Target: []datadogV1.SyntheticsMCPServerCapability{ + datadogV1.SYNTHETICSMCPSERVERCAPABILITY_TOOLS, + }, + }}, + }, + Request: datadogV1.SyntheticsTestRequest{ + Url: datadog.PtrString("https://example.org/mcp"), + CallType: datadogV1.SYNTHETICSTESTCALLTYPE_INIT.Ptr(), + McpProtocolVersion: datadogV1.SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18.Ptr(), + Headers: map[string]string{ + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "", + }, + }, + }}, + datadogV1.SyntheticsAPIStep{ + SyntheticsAPITestStep: &datadogV1.SyntheticsAPITestStep{ + Name: "List MCP tools", + Subtype: datadogV1.SYNTHETICSAPITESTSTEPSUBTYPE_MCP, + AllowFailure: datadog.PtrBool(false), + IsCritical: datadog.PtrBool(true), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(0), + Interval: datadog.PtrFloat64(300), + }, + Assertions: []datadogV1.SyntheticsAssertion{ + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_IS, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_STATUS_CODE, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(200)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_MORE_THAN, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_MCP_TOOL_COUNT, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(0)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_MCP_TOOL_NAME_LENGTH, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(64)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionMCPRespectsSpecification: &datadogV1.SyntheticsAssertionMCPRespectsSpecification{ + Type: datadogV1.SYNTHETICSASSERTIONMCPRESPECTSSPECIFICATIONTYPE_MCP_RESPECTS_SPECIFICATION, + }}, + }, + Request: datadogV1.SyntheticsTestRequest{ + Url: datadog.PtrString("https://example.org/mcp"), + CallType: datadogV1.SYNTHETICSTESTCALLTYPE_TOOL_LIST.Ptr(), + McpProtocolVersion: datadogV1.SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18.Ptr(), + Headers: map[string]string{ + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "", + }, + }, + }}, + datadogV1.SyntheticsAPIStep{ + SyntheticsAPITestStep: &datadogV1.SyntheticsAPITestStep{ + Name: "Call MCP search tool", + Subtype: datadogV1.SYNTHETICSAPITESTSTEPSUBTYPE_MCP, + AllowFailure: datadog.PtrBool(false), + IsCritical: datadog.PtrBool(true), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(0), + Interval: datadog.PtrFloat64(300), + }, + Assertions: []datadogV1.SyntheticsAssertion{ + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_IS, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_STATUS_CODE, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(200)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME, + Target: datadogV1.SyntheticsAssertionTargetValue{ + SyntheticsAssertionTargetValueNumber: datadog.PtrFloat64(5000)}, + }}, + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionMCPRespectsSpecification: &datadogV1.SyntheticsAssertionMCPRespectsSpecification{ + Type: datadogV1.SYNTHETICSASSERTIONMCPRESPECTSSPECIFICATIONTYPE_MCP_RESPECTS_SPECIFICATION, + }}, + }, + Request: datadogV1.SyntheticsTestRequest{ + Url: datadog.PtrString("https://example.org/mcp"), + CallType: datadogV1.SYNTHETICSTESTCALLTYPE_TOOL_CALL.Ptr(), + McpProtocolVersion: datadogV1.SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18.Ptr(), + ToolName: datadog.PtrString("search"), + ToolArgs: map[string]interface{}{ + "limit": 5, + "query": "datadog synthetics", + }, + Headers: map[string]string{ + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "", + }, + }, + }}, + }, + }, + Locations: []string{ + "aws:us-east-2", + }, + Message: "BDD test payload: synthetics_api_test_mcp_payload.json", + Name: "Example-Synthetic", + Options: datadogV1.SyntheticsTestOptions{ + MinFailureDuration: datadog.PtrInt64(10), + MinLocationFailed: datadog.PtrInt64(1), + MonitorName: datadog.PtrString("Example-Synthetic"), + MonitorPriority: datadog.PtrInt32(5), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(3), + Interval: datadog.PtrFloat64(1000), + }, + TickEvery: datadog.PtrInt64(900), + }, + Subtype: datadogV1.SYNTHETICSTESTDETAILSSUBTYPE_MULTI.Ptr(), + Tags: []string{ + "testing:api", + }, + Type: datadogV1.SYNTHETICSAPITESTTYPE_API, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV1.NewSyntheticsApi(apiClient) + resp, r, err := api.CreateSyntheticsAPITest(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.CreateSyntheticsAPITest`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.CreateSyntheticsAPITest`:\n%s\n", responseContent) +} diff --git a/examples/v1/synthetics/UpdateBrowserTest.go b/examples/v1/synthetics/UpdateBrowserTest.go index 8bcdcd90b26..6683c0eed67 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.go +++ b/examples/v1/synthetics/UpdateBrowserTest.go @@ -40,12 +40,14 @@ func main() { Files: []datadogV1.SyntheticsTestRequestBodyFile{ {}, }, - HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(), + HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(), + McpProtocolVersion: datadogV1.SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18.Ptr(), Proxy: &datadogV1.SyntheticsTestRequestProxy{ Url: "https://example.com", }, - Service: datadog.PtrString("Greeter"), - Url: datadog.PtrString("https://example.com"), + Service: datadog.PtrString("Greeter"), + ToolName: datadog.PtrString("search"), + Url: datadog.PtrString("https://example.com"), }, Variables: []datadogV1.SyntheticsBrowserVariable{ { diff --git a/examples/v2/app-builder/CreatePublishRequest.go b/examples/v2/app-builder/CreatePublishRequest.go new file mode 100644 index 00000000000..150da50d719 --- /dev/null +++ b/examples/v2/app-builder/CreatePublishRequest.go @@ -0,0 +1,39 @@ +// Create Publish Request returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + body := datadogV2.CreatePublishRequestRequest{ + Data: &datadogV2.CreatePublishRequestRequestData{ + Attributes: &datadogV2.CreatePublishRequestRequestDataAttributes{ + Description: datadog.PtrString("Adds new dashboard widgets and a few bug fixes."), + Title: "Release v1.2 to production", + }, + Type: datadogV2.PUBLISHREQUESTTYPE_PUBLISHREQUEST.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.CreatePublishRequest(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.CreatePublishRequest`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.CreatePublishRequest`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/GetBlueprint.go b/examples/v2/app-builder/GetBlueprint.go new file mode 100644 index 00000000000..6be5c63d1a9 --- /dev/null +++ b/examples/v2/app-builder/GetBlueprint.go @@ -0,0 +1,30 @@ +// Get Blueprint returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.GetBlueprint(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.GetBlueprint`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.GetBlueprint`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/GetBlueprintsByIntegrationId.go b/examples/v2/app-builder/GetBlueprintsByIntegrationId.go new file mode 100644 index 00000000000..a6334af7f5a --- /dev/null +++ b/examples/v2/app-builder/GetBlueprintsByIntegrationId.go @@ -0,0 +1,29 @@ +// Get Blueprints by Integration ID returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.GetBlueprintsByIntegrationId(ctx, "aws") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.GetBlueprintsByIntegrationId`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.GetBlueprintsByIntegrationId`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/GetBlueprintsBySlugs.go b/examples/v2/app-builder/GetBlueprintsBySlugs.go new file mode 100644 index 00000000000..5964e50bd21 --- /dev/null +++ b/examples/v2/app-builder/GetBlueprintsBySlugs.go @@ -0,0 +1,29 @@ +// Get Blueprints by Slugs returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.GetBlueprintsBySlugs(ctx, "aws-service-manager") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.GetBlueprintsBySlugs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.GetBlueprintsBySlugs`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/ListAppVersions.go b/examples/v2/app-builder/ListAppVersions.go new file mode 100644 index 00000000000..476b9734575 --- /dev/null +++ b/examples/v2/app-builder/ListAppVersions.go @@ -0,0 +1,33 @@ +// List App Versions returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.ListAppVersions(ctx, AppDataID, *datadogV2.NewListAppVersionsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.ListAppVersions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.ListAppVersions`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/ListBlueprints.go b/examples/v2/app-builder/ListBlueprints.go new file mode 100644 index 00000000000..523b1d83764 --- /dev/null +++ b/examples/v2/app-builder/ListBlueprints.go @@ -0,0 +1,29 @@ +// List Blueprints returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.ListBlueprints(ctx, *datadogV2.NewListBlueprintsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.ListBlueprints`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.ListBlueprints`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/ListTags.go b/examples/v2/app-builder/ListTags.go new file mode 100644 index 00000000000..9692f60b9ba --- /dev/null +++ b/examples/v2/app-builder/ListTags.go @@ -0,0 +1,29 @@ +// List Tags returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.ListTags(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.ListTags`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.ListTags`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/RevertApp.go b/examples/v2/app-builder/RevertApp.go new file mode 100644 index 00000000000..fcde8359e47 --- /dev/null +++ b/examples/v2/app-builder/RevertApp.go @@ -0,0 +1,30 @@ +// Revert App returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.RevertApp(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), "version") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.RevertApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.RevertApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-builder/UpdateAppFavorite.go b/examples/v2/app-builder/UpdateAppFavorite.go new file mode 100644 index 00000000000..a6feddb2774 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppFavorite.go @@ -0,0 +1,37 @@ +// Update App Favorite Status returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + body := datadogV2.UpdateAppFavoriteRequest{ + Data: &datadogV2.UpdateAppFavoriteRequestData{ + Attributes: &datadogV2.UpdateAppFavoriteRequestDataAttributes{ + Favorite: true, + }, + Type: datadogV2.APPFAVORITETYPE_FAVORITES.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + r, err := api.UpdateAppFavorite(ctx, AppDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateAppFavorite`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/app-builder/UpdateAppSelfService.go b/examples/v2/app-builder/UpdateAppSelfService.go new file mode 100644 index 00000000000..5c6a91824fc --- /dev/null +++ b/examples/v2/app-builder/UpdateAppSelfService.go @@ -0,0 +1,37 @@ +// Update App Self-Service Status returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + body := datadogV2.UpdateAppSelfServiceRequest{ + Data: &datadogV2.UpdateAppSelfServiceRequestData{ + Attributes: &datadogV2.UpdateAppSelfServiceRequestDataAttributes{ + SelfService: true, + }, + Type: datadogV2.APPSELFSERVICETYPE_SELFSERVICE.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + r, err := api.UpdateAppSelfService(ctx, AppDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateAppSelfService`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/app-builder/UpdateAppTags.go b/examples/v2/app-builder/UpdateAppTags.go new file mode 100644 index 00000000000..9b2f09d6b02 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppTags.go @@ -0,0 +1,40 @@ +// Update App Tags returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + body := datadogV2.UpdateAppTagsRequest{ + Data: &datadogV2.UpdateAppTagsRequestData{ + Attributes: &datadogV2.UpdateAppTagsRequestDataAttributes{ + Tags: []string{ + "team:platform", + "service:ops", + }, + }, + Type: datadogV2.APPTAGSTYPE_TAGS.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + r, err := api.UpdateAppTags(ctx, AppDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateAppTags`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/app-builder/UpdateAppVersionName.go b/examples/v2/app-builder/UpdateAppVersionName.go new file mode 100644 index 00000000000..6f90cf8fe20 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppVersionName.go @@ -0,0 +1,37 @@ +// Name App Version returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + body := datadogV2.UpdateAppVersionNameRequest{ + Data: &datadogV2.UpdateAppVersionNameRequestData{ + Attributes: &datadogV2.UpdateAppVersionNameRequestDataAttributes{ + Name: "v1.2.0 - bug fix release", + }, + Type: datadogV2.APPVERSIONNAMETYPE_VERSIONNAMES.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + r, err := api.UpdateAppVersionName(ctx, AppDataID, "latest", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateAppVersionName`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/app-builder/UpdateProtectionLevel.go b/examples/v2/app-builder/UpdateProtectionLevel.go new file mode 100644 index 00000000000..862d9211843 --- /dev/null +++ b/examples/v2/app-builder/UpdateProtectionLevel.go @@ -0,0 +1,41 @@ +// Update App Protection Level returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + // there is a valid "app" in the system + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) + + body := datadogV2.UpdateAppProtectionLevelRequest{ + Data: &datadogV2.UpdateAppProtectionLevelRequestData{ + Attributes: &datadogV2.UpdateAppProtectionLevelRequestDataAttributes{ + ProtectionLevel: datadogV2.APPPROTECTIONLEVEL_APPROVAL_REQUIRED, + }, + Type: datadogV2.APPPROTECTIONLEVELTYPE_PROTECTIONLEVEL.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.UpdateProtectionLevel(ctx, AppDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateProtectionLevel`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.UpdateProtectionLevel`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.go b/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.go new file mode 100644 index 00000000000..08f1796c7ce --- /dev/null +++ b/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.go @@ -0,0 +1,47 @@ +// Update custom attribute config returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CustomAttributeConfigUpdateRequest{ + Data: datadogV2.CustomAttributeConfigUpdate{ + Attributes: &datadogV2.CustomAttributeConfigUpdateAttributes{ + Description: datadog.PtrString("Updated description."), + DisplayName: datadog.PtrString("AWS Region"), + Type: datadogV2.CUSTOMATTRIBUTETYPE_NUMBER.Ptr(), + TypeData: &datadogV2.CustomAttributeTypeData{ + Options: []datadogV2.CustomAttributeSelectOption{ + { + Value: "us-east-1", + }, + }, + }, + }, + Type: datadogV2.CUSTOMATTRIBUTECONFIGRESOURCETYPE_CUSTOM_ATTRIBUTE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCustomAttributeConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementAttributeApi(apiClient) + resp, r, err := api.UpdateCustomAttributeConfig(ctx, "case_type_id", "custom_attribute_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementAttributeApi.UpdateCustomAttributeConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementAttributeApi.UpdateCustomAttributeConfig`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management-type/UpdateCaseType.go b/examples/v2/case-management-type/UpdateCaseType.go new file mode 100644 index 00000000000..2487e7cd11b --- /dev/null +++ b/examples/v2/case-management-type/UpdateCaseType.go @@ -0,0 +1,40 @@ +// Update a case type returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseTypeUpdateRequest{ + Data: datadogV2.CaseTypeUpdate{ + Attributes: &datadogV2.CaseTypeResourceAttributes{ + Description: datadog.PtrString("Investigations done in case management"), + Emoji: datadog.PtrString("🕵🏻‍♂️"), + Name: "Investigation", + }, + Type: datadogV2.CASETYPERESOURCETYPE_CASE_TYPE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseType", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementTypeApi(apiClient) + resp, r, err := api.UpdateCaseType(ctx, "case_type_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementTypeApi.UpdateCaseType`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementTypeApi.UpdateCaseType`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/AddCaseInsights.go b/examples/v2/case-management/AddCaseInsights.go new file mode 100644 index 00000000000..357d70f6bf3 --- /dev/null +++ b/examples/v2/case-management/AddCaseInsights.go @@ -0,0 +1,44 @@ +// Add insights to a case returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseInsightsRequest{ + Data: datadogV2.CaseInsightsData{ + Attributes: datadogV2.CaseInsightsAttributes{ + Insights: []datadogV2.CaseInsight{ + { + Ref: "/monitors/12345?q=total", + ResourceId: "12345", + Type: datadogV2.CASEINSIGHTTYPE_SECURITY_SIGNAL, + }, + }, + }, + Type: datadogV2.CASERESOURCETYPE_CASE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.AddCaseInsights", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.AddCaseInsights(ctx, "case_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.AddCaseInsights`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.AddCaseInsights`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/AggregateCases.go b/examples/v2/case-management/AggregateCases.go new file mode 100644 index 00000000000..1a059afca43 --- /dev/null +++ b/examples/v2/case-management/AggregateCases.go @@ -0,0 +1,44 @@ +// Aggregate cases returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseAggregateRequest{ + Data: datadogV2.CaseAggregateRequestData{ + Attributes: datadogV2.CaseAggregateRequestAttributes{ + GroupBy: datadogV2.CaseAggregateGroupBy{ + Groups: []string{ + "status", + }, + Limit: 14, + }, + QueryFilter: "service:case-api", + }, + Type: datadogV2.CASEAGGREGATERESOURCETYPE_AGGREGATE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.AggregateCases", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.AggregateCases(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.AggregateCases`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.AggregateCases`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/BulkUpdateCases.go b/examples/v2/case-management/BulkUpdateCases.go new file mode 100644 index 00000000000..d0d74d451bc --- /dev/null +++ b/examples/v2/case-management/BulkUpdateCases.go @@ -0,0 +1,41 @@ +// Bulk update cases returns "OK" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseBulkUpdateRequest{ + Data: datadogV2.CaseBulkUpdateRequestData{ + Attributes: datadogV2.CaseBulkUpdateRequestAttributes{ + CaseIds: []string{ + "case-id-1", + "case-id-2", + }, + Payload: map[string]string{ + "priority": "P1", + }, + Type: datadogV2.CASEBULKACTIONTYPE_PRIORITY, + }, + Type: datadogV2.CASEBULKRESOURCETYPE_BULK, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.BulkUpdateCases", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.BulkUpdateCases(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.BulkUpdateCases`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/CountCases.go b/examples/v2/case-management/CountCases.go new file mode 100644 index 00000000000..8991e3438f3 --- /dev/null +++ b/examples/v2/case-management/CountCases.go @@ -0,0 +1,30 @@ +// Count cases returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CountCases", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.CountCases(ctx, *datadogV2.NewCountCasesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CountCases`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CountCases`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/CreateCaseAutomationRule.go b/examples/v2/case-management/CreateCaseAutomationRule.go new file mode 100644 index 00000000000..1ec5ca6dad0 --- /dev/null +++ b/examples/v2/case-management/CreateCaseAutomationRule.go @@ -0,0 +1,49 @@ +// Create an automation rule returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.AutomationRuleCreateRequest{ + Data: datadogV2.AutomationRuleCreate{ + Attributes: datadogV2.AutomationRuleCreateAttributes{ + Action: datadogV2.AutomationRuleAction{ + Data: datadogV2.AutomationRuleActionData{ + Handle: datadog.PtrString("workflow-handle-123"), + }, + Type: datadogV2.AUTOMATIONRULEACTIONTYPE_EXECUTE_WORKFLOW, + }, + Name: "Auto-assign workflow", + State: datadogV2.CASEAUTOMATIONRULESTATE_ENABLED.Ptr(), + Trigger: datadogV2.AutomationRuleTrigger{ + Data: &datadogV2.AutomationRuleTriggerData{}, + Type: datadogV2.AUTOMATIONRULETRIGGERTYPE_CASE_CREATED, + }, + }, + Type: datadogV2.CASEAUTOMATIONRULERESOURCETYPE_RULE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.CreateCaseAutomationRule(ctx, "project_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateCaseAutomationRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/CreateCaseLink.go b/examples/v2/case-management/CreateCaseLink.go new file mode 100644 index 00000000000..1a72f26e82b --- /dev/null +++ b/examples/v2/case-management/CreateCaseLink.go @@ -0,0 +1,42 @@ +// Create a case link returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseLinkCreateRequest{ + Data: datadogV2.CaseLinkCreate{ + Attributes: datadogV2.CaseLinkAttributes{ + ChildEntityId: "4417921d-0866-4a38-822c-6f2a0f65f77d", + ChildEntityType: "CASE", + ParentEntityId: "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", + ParentEntityType: "CASE", + Relationship: "BLOCKS", + }, + Type: datadogV2.CASELINKRESOURCETYPE_LINK, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateCaseLink", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.CreateCaseLink(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateCaseLink`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateCaseLink`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/CreateCaseView.go b/examples/v2/case-management/CreateCaseView.go new file mode 100644 index 00000000000..abff9dc8b0f --- /dev/null +++ b/examples/v2/case-management/CreateCaseView.go @@ -0,0 +1,40 @@ +// Create a case view returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseViewCreateRequest{ + Data: datadogV2.CaseViewCreate{ + Attributes: datadogV2.CaseViewCreateAttributes{ + Name: "Open bugs", + ProjectId: "e555e290-ed65-49bd-ae18-8acbfcf18db7", + Query: "status:open type:bug", + }, + Type: datadogV2.CASEVIEWRESOURCETYPE_VIEW, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateCaseView", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.CreateCaseView(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateCaseView`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateCaseView`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/CreateMaintenanceWindow.go b/examples/v2/case-management/CreateMaintenanceWindow.go new file mode 100644 index 00000000000..ba496f9c67d --- /dev/null +++ b/examples/v2/case-management/CreateMaintenanceWindow.go @@ -0,0 +1,42 @@ +// Create a maintenance window returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.MaintenanceWindowCreateRequest{ + Data: datadogV2.MaintenanceWindowCreate{ + Attributes: datadogV2.MaintenanceWindowCreateAttributes{ + EndAt: time.Date(2026, 6, 1, 6, 0, 0, 0, time.UTC), + Name: "Weekly maintenance", + Query: "project:SEC", + StartAt: time.Date(2026, 6, 1, 0, 0, 0, 0, time.UTC), + }, + Type: datadogV2.MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateMaintenanceWindow", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.CreateMaintenanceWindow(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateMaintenanceWindow`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateMaintenanceWindow`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/DeleteCaseAutomationRule.go b/examples/v2/case-management/DeleteCaseAutomationRule.go new file mode 100644 index 00000000000..f48bfd52a68 --- /dev/null +++ b/examples/v2/case-management/DeleteCaseAutomationRule.go @@ -0,0 +1,26 @@ +// Delete an automation rule returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.DeleteCaseAutomationRule(ctx, "project_id", "rule_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DeleteCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/DeleteCaseLink.go b/examples/v2/case-management/DeleteCaseLink.go new file mode 100644 index 00000000000..31c7ef4e94d --- /dev/null +++ b/examples/v2/case-management/DeleteCaseLink.go @@ -0,0 +1,26 @@ +// Delete a case link returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteCaseLink", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.DeleteCaseLink(ctx, "804cd682-55f6-4541-ab00-b608b282ea7d") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DeleteCaseLink`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/DeleteCaseView.go b/examples/v2/case-management/DeleteCaseView.go new file mode 100644 index 00000000000..4f2f03bdfa8 --- /dev/null +++ b/examples/v2/case-management/DeleteCaseView.go @@ -0,0 +1,26 @@ +// Delete a case view returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteCaseView", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.DeleteCaseView(ctx, "view_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DeleteCaseView`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/DeleteMaintenanceWindow.go b/examples/v2/case-management/DeleteMaintenanceWindow.go new file mode 100644 index 00000000000..b75c9804c58 --- /dev/null +++ b/examples/v2/case-management/DeleteMaintenanceWindow.go @@ -0,0 +1,26 @@ +// Delete a maintenance window returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteMaintenanceWindow", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.DeleteMaintenanceWindow(ctx, "maintenance_window_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DeleteMaintenanceWindow`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/DisableCaseAutomationRule.go b/examples/v2/case-management/DisableCaseAutomationRule.go new file mode 100644 index 00000000000..3061464ec44 --- /dev/null +++ b/examples/v2/case-management/DisableCaseAutomationRule.go @@ -0,0 +1,30 @@ +// Disable an automation rule returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DisableCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.DisableCaseAutomationRule(ctx, "project_id", "rule_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DisableCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.DisableCaseAutomationRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/EnableCaseAutomationRule.go b/examples/v2/case-management/EnableCaseAutomationRule.go new file mode 100644 index 00000000000..49d438af9ec --- /dev/null +++ b/examples/v2/case-management/EnableCaseAutomationRule.go @@ -0,0 +1,30 @@ +// Enable an automation rule returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.EnableCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.EnableCaseAutomationRule(ctx, "project_id", "rule_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.EnableCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.EnableCaseAutomationRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/FavoriteCaseProject.go b/examples/v2/case-management/FavoriteCaseProject.go new file mode 100644 index 00000000000..8b85af4c416 --- /dev/null +++ b/examples/v2/case-management/FavoriteCaseProject.go @@ -0,0 +1,26 @@ +// Favorite a project returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.FavoriteCaseProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.FavoriteCaseProject(ctx, "project_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.FavoriteCaseProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/GetCaseAutomationRule.go b/examples/v2/case-management/GetCaseAutomationRule.go new file mode 100644 index 00000000000..2c2eb9ccb27 --- /dev/null +++ b/examples/v2/case-management/GetCaseAutomationRule.go @@ -0,0 +1,30 @@ +// Get an automation rule returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.GetCaseAutomationRule(ctx, "project_id", "rule_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.GetCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetCaseAutomationRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/GetCaseView.go b/examples/v2/case-management/GetCaseView.go new file mode 100644 index 00000000000..ca198618b52 --- /dev/null +++ b/examples/v2/case-management/GetCaseView.go @@ -0,0 +1,30 @@ +// Get a case view returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCaseView", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.GetCaseView(ctx, "view_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.GetCaseView`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetCaseView`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListCaseAutomationRules.go b/examples/v2/case-management/ListCaseAutomationRules.go new file mode 100644 index 00000000000..0f45f8ad4ab --- /dev/null +++ b/examples/v2/case-management/ListCaseAutomationRules.go @@ -0,0 +1,30 @@ +// List automation rules returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCaseAutomationRules", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListCaseAutomationRules(ctx, "project_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListCaseAutomationRules`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListCaseAutomationRules`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListCaseLinks.go b/examples/v2/case-management/ListCaseLinks.go new file mode 100644 index 00000000000..d9594ecbc90 --- /dev/null +++ b/examples/v2/case-management/ListCaseLinks.go @@ -0,0 +1,30 @@ +// List case links returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCaseLinks", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListCaseLinks(ctx, "CASE", "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", *datadogV2.NewListCaseLinksOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListCaseLinks`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListCaseLinks`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListCaseTimeline.go b/examples/v2/case-management/ListCaseTimeline.go new file mode 100644 index 00000000000..bc556e97c86 --- /dev/null +++ b/examples/v2/case-management/ListCaseTimeline.go @@ -0,0 +1,30 @@ +// Get case timeline returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCaseTimeline", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListCaseTimeline(ctx, "case_id", *datadogV2.NewListCaseTimelineOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListCaseTimeline`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListCaseTimeline`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListCaseViews.go b/examples/v2/case-management/ListCaseViews.go new file mode 100644 index 00000000000..5a5177c5d06 --- /dev/null +++ b/examples/v2/case-management/ListCaseViews.go @@ -0,0 +1,30 @@ +// List case views returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCaseViews", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListCaseViews(ctx, "project_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListCaseViews`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListCaseViews`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListCaseWatchers.go b/examples/v2/case-management/ListCaseWatchers.go new file mode 100644 index 00000000000..df666abf4cc --- /dev/null +++ b/examples/v2/case-management/ListCaseWatchers.go @@ -0,0 +1,30 @@ +// List case watchers returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCaseWatchers", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListCaseWatchers(ctx, "case_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListCaseWatchers`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListCaseWatchers`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListMaintenanceWindows.go b/examples/v2/case-management/ListMaintenanceWindows.go new file mode 100644 index 00000000000..6e967acf797 --- /dev/null +++ b/examples/v2/case-management/ListMaintenanceWindows.go @@ -0,0 +1,30 @@ +// List maintenance windows returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListMaintenanceWindows", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListMaintenanceWindows(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListMaintenanceWindows`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListMaintenanceWindows`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/ListUserCaseProjectFavorites.go b/examples/v2/case-management/ListUserCaseProjectFavorites.go new file mode 100644 index 00000000000..ce9c66a3448 --- /dev/null +++ b/examples/v2/case-management/ListUserCaseProjectFavorites.go @@ -0,0 +1,30 @@ +// List project favorites returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListUserCaseProjectFavorites", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.ListUserCaseProjectFavorites(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ListUserCaseProjectFavorites`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ListUserCaseProjectFavorites`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/RemoveCaseInsights.go b/examples/v2/case-management/RemoveCaseInsights.go new file mode 100644 index 00000000000..f46d6c5c77c --- /dev/null +++ b/examples/v2/case-management/RemoveCaseInsights.go @@ -0,0 +1,44 @@ +// Remove insights from a case returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseInsightsRequest{ + Data: datadogV2.CaseInsightsData{ + Attributes: datadogV2.CaseInsightsAttributes{ + Insights: []datadogV2.CaseInsight{ + { + Ref: "/monitors/12345?q=total", + ResourceId: "12345", + Type: datadogV2.CASEINSIGHTTYPE_SECURITY_SIGNAL, + }, + }, + }, + Type: datadogV2.CASERESOURCETYPE_CASE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.RemoveCaseInsights", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.RemoveCaseInsights(ctx, "case_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.RemoveCaseInsights`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.RemoveCaseInsights`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/UnfavoriteCaseProject.go b/examples/v2/case-management/UnfavoriteCaseProject.go new file mode 100644 index 00000000000..9e8eab56af3 --- /dev/null +++ b/examples/v2/case-management/UnfavoriteCaseProject.go @@ -0,0 +1,26 @@ +// Unfavorite a project returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UnfavoriteCaseProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.UnfavoriteCaseProject(ctx, "project_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UnfavoriteCaseProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/UnwatchCase.go b/examples/v2/case-management/UnwatchCase.go new file mode 100644 index 00000000000..25721595591 --- /dev/null +++ b/examples/v2/case-management/UnwatchCase.go @@ -0,0 +1,26 @@ +// Unwatch a case returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UnwatchCase", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.UnwatchCase(ctx, "case_id", "user_uuid") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UnwatchCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/UpdateCaseAutomationRule.go b/examples/v2/case-management/UpdateCaseAutomationRule.go new file mode 100644 index 00000000000..7a6fdab1855 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseAutomationRule.go @@ -0,0 +1,49 @@ +// Update an automation rule returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.AutomationRuleUpdateRequest{ + Data: datadogV2.AutomationRuleUpdate{ + Attributes: &datadogV2.AutomationRuleCreateAttributes{ + Action: datadogV2.AutomationRuleAction{ + Data: datadogV2.AutomationRuleActionData{ + Handle: datadog.PtrString("workflow-handle-123"), + }, + Type: datadogV2.AUTOMATIONRULEACTIONTYPE_EXECUTE_WORKFLOW, + }, + Name: "Auto-assign workflow", + State: datadogV2.CASEAUTOMATIONRULESTATE_ENABLED.Ptr(), + Trigger: datadogV2.AutomationRuleTrigger{ + Data: &datadogV2.AutomationRuleTriggerData{}, + Type: datadogV2.AUTOMATIONRULETRIGGERTYPE_CASE_CREATED, + }, + }, + Type: datadogV2.CASEAUTOMATIONRULERESOURCETYPE_RULE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseAutomationRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.UpdateCaseAutomationRule(ctx, "project_id", "rule_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseAutomationRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseAutomationRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/UpdateCaseComment.go b/examples/v2/case-management/UpdateCaseComment.go new file mode 100644 index 00000000000..67305d5ea6e --- /dev/null +++ b/examples/v2/case-management/UpdateCaseComment.go @@ -0,0 +1,34 @@ +// Update case comment returns "OK" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseUpdateCommentRequest{ + Data: datadogV2.CaseUpdateComment{ + Attributes: datadogV2.CaseUpdateCommentAttributes{ + Comment: "Updated comment text", + }, + Type: datadogV2.CASERESOURCETYPE_CASE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseComment", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.UpdateCaseComment(ctx, "case_id", "cell_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseComment`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/case-management/UpdateCaseDueDate.go b/examples/v2/case-management/UpdateCaseDueDate.go new file mode 100644 index 00000000000..ec27a067b28 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseDueDate.go @@ -0,0 +1,38 @@ +// Update case due date returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseUpdateDueDateRequest{ + Data: datadogV2.CaseUpdateDueDate{ + Attributes: datadogV2.CaseUpdateDueDateAttributes{ + DueDate: "2026-12-31", + }, + Type: datadogV2.CASERESOURCETYPE_CASE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseDueDate", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.UpdateCaseDueDate(ctx, "case_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseDueDate`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseDueDate`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/UpdateCaseResolvedReason.go b/examples/v2/case-management/UpdateCaseResolvedReason.go new file mode 100644 index 00000000000..a4fdbe88975 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseResolvedReason.go @@ -0,0 +1,38 @@ +// Update case resolved reason returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseUpdateResolvedReasonRequest{ + Data: datadogV2.CaseUpdateResolvedReason{ + Attributes: datadogV2.CaseUpdateResolvedReasonAttributes{ + SecurityResolvedReason: "FALSE_POSITIVE", + }, + Type: datadogV2.CASERESOURCETYPE_CASE, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseResolvedReason", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.UpdateCaseResolvedReason(ctx, "case_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseResolvedReason`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseResolvedReason`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/UpdateCaseView.go b/examples/v2/case-management/UpdateCaseView.go new file mode 100644 index 00000000000..de411d14e3e --- /dev/null +++ b/examples/v2/case-management/UpdateCaseView.go @@ -0,0 +1,36 @@ +// Update a case view returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CaseViewUpdateRequest{ + Data: datadogV2.CaseViewUpdate{ + Attributes: &datadogV2.CaseViewUpdateAttributes{}, + Type: datadogV2.CASEVIEWRESOURCETYPE_VIEW, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCaseView", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.UpdateCaseView(ctx, "view_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseView`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseView`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/UpdateMaintenanceWindow.go b/examples/v2/case-management/UpdateMaintenanceWindow.go new file mode 100644 index 00000000000..e985a6b8cc1 --- /dev/null +++ b/examples/v2/case-management/UpdateMaintenanceWindow.go @@ -0,0 +1,36 @@ +// Update a maintenance window returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.MaintenanceWindowUpdateRequest{ + Data: datadogV2.MaintenanceWindowUpdate{ + Attributes: &datadogV2.MaintenanceWindowUpdateAttributes{}, + Type: datadogV2.MAINTENANCEWINDOWRESOURCETYPE_MAINTENANCE_WINDOW, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateMaintenanceWindow", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + resp, r, err := api.UpdateMaintenanceWindow(ctx, "maintenance_window_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateMaintenanceWindow`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateMaintenanceWindow`:\n%s\n", responseContent) +} diff --git a/examples/v2/case-management/WatchCase.go b/examples/v2/case-management/WatchCase.go new file mode 100644 index 00000000000..7adf43d88fc --- /dev/null +++ b/examples/v2/case-management/WatchCase.go @@ -0,0 +1,26 @@ +// Watch a case returns "Created" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.WatchCase", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCaseManagementApi(apiClient) + r, err := api.WatchCase(ctx, "case_id", "user_uuid") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.WatchCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.go b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.go new file mode 100644 index 00000000000..a196cf20bb4 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.go @@ -0,0 +1,30 @@ +// Get commitments list returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsCommitmentList", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsCommitmentList(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsCommitmentListOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsCommitmentList`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsCommitmentList`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.go b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.go new file mode 100644 index 00000000000..1344281521d --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.go @@ -0,0 +1,30 @@ +// Get commitments coverage (scalar) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsCoverageScalar", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsCoverageScalar(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsCoverageScalarOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsCoverageScalar`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsCoverageScalar`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.go b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.go new file mode 100644 index 00000000000..0c23ccaef11 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.go @@ -0,0 +1,30 @@ +// Get commitments coverage (timeseries) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsCoverageTimeseries", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsCoverageTimeseries(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsCoverageTimeseriesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsCoverageTimeseries`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsCoverageTimeseries`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.go b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.go new file mode 100644 index 00000000000..5261ff1c02c --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.go @@ -0,0 +1,30 @@ +// Get commitments on-demand hot spots (scalar) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsOnDemandHotspotsScalar", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsOnDemandHotspotsScalar(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsOnDemandHotspotsScalarOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsOnDemandHotspotsScalar`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsOnDemandHotspotsScalar`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.go b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.go new file mode 100644 index 00000000000..d77f7e44aa9 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.go @@ -0,0 +1,30 @@ +// Get commitments savings (scalar) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsSavingsScalar", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsSavingsScalar(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsSavingsScalarOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsSavingsScalar`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsSavingsScalar`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.go b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.go new file mode 100644 index 00000000000..ce83c9e49d8 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.go @@ -0,0 +1,30 @@ +// Get commitments savings (timeseries) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsSavingsTimeseries", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsSavingsTimeseries(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsSavingsTimeseriesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsSavingsTimeseries`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsSavingsTimeseries`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.go b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.go new file mode 100644 index 00000000000..d965d40ccd2 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.go @@ -0,0 +1,30 @@ +// Get commitments utilization (scalar) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsUtilizationScalar", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsUtilizationScalar(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsUtilizationScalarOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsUtilizationScalar`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsUtilizationScalar`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.go b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.go new file mode 100644 index 00000000000..a7a4ff090aa --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.go @@ -0,0 +1,30 @@ +// Get commitments utilization (timeseries) returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCommitmentsUtilizationTimeseries", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCommitmentsUtilizationTimeseries(ctx, datadogV2.COMMITMENTSPROVIDER_AWS, "product", 9223372036854775807, 9223372036854775807, *datadogV2.NewGetCommitmentsUtilizationTimeseriesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCommitmentsUtilizationTimeseries`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCommitmentsUtilizationTimeseries`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.go b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.go new file mode 100644 index 00000000000..d8191f85603 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.go @@ -0,0 +1,30 @@ +// Get the Cloud Cost Management billing currency returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCostTagMetadataCurrency", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.GetCostTagMetadataCurrency(ctx, "filter[month]", *datadogV2.NewGetCostTagMetadataCurrencyOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCostTagMetadataCurrency`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCostTagMetadataCurrency`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/ListCostTagKeySources.go b/examples/v2/cloud-cost-management/ListCostTagKeySources.go new file mode 100644 index 00000000000..3a6cf5d91cf --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagKeySources.go @@ -0,0 +1,30 @@ +// List Cloud Cost Management tag sources returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCostTagKeySources", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.ListCostTagKeySources(ctx, "filter[month]", *datadogV2.NewListCostTagKeySourcesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostTagKeySources`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostTagKeySources`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadata.go b/examples/v2/cloud-cost-management/ListCostTagMetadata.go new file mode 100644 index 00000000000..7d85ae338c0 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadata.go @@ -0,0 +1,30 @@ +// List Cloud Cost Management tag key metadata returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCostTagMetadata", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.ListCostTagMetadata(ctx, "filter[month]", *datadogV2.NewListCostTagMetadataOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostTagMetadata`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostTagMetadata`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.go b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.go new file mode 100644 index 00000000000..346ba50bd29 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.go @@ -0,0 +1,30 @@ +// List available Cloud Cost Management metrics returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCostTagMetadataMetrics", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.ListCostTagMetadataMetrics(ctx, "filter[month]", *datadogV2.NewListCostTagMetadataMetricsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostTagMetadataMetrics`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostTagMetadataMetrics`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.go b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.go new file mode 100644 index 00000000000..04a5064b532 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.go @@ -0,0 +1,30 @@ +// List Cloud Cost Management orchestrators returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCostTagMetadataOrchestrators", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.ListCostTagMetadataOrchestrators(ctx, "filter[month]", *datadogV2.NewListCostTagMetadataOrchestratorsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostTagMetadataOrchestrators`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostTagMetadataOrchestrators`:\n%s\n", responseContent) +} diff --git a/examples/v2/cloud-cost-management/SearchCostRecommendations.go b/examples/v2/cloud-cost-management/SearchCostRecommendations.go new file mode 100644 index 00000000000..159203a5f12 --- /dev/null +++ b/examples/v2/cloud-cost-management/SearchCostRecommendations.go @@ -0,0 +1,39 @@ +// Search cost recommendations returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.RecommendationsFilterRequest{ + Filter: datadog.PtrString("@resource_table:aws_ec2_instance"), + Sort: []datadogV2.RecommendationsFilterRequestSortItems{ + { + Expression: datadog.PtrString("potential_daily_savings.amount"), + Order: datadog.PtrString("DESC"), + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.SearchCostRecommendations", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCloudCostManagementApi(apiClient) + resp, r, err := api.SearchCostRecommendations(ctx, body, *datadogV2.NewSearchCostRecommendationsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.SearchCostRecommendations`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.SearchCostRecommendations`:\n%s\n", responseContent) +} diff --git a/examples/v2/compliance/GetRuleBasedView.go b/examples/v2/compliance/GetRuleBasedView.go new file mode 100644 index 00000000000..06083836bbf --- /dev/null +++ b/examples/v2/compliance/GetRuleBasedView.go @@ -0,0 +1,30 @@ +// Get the rule-based view of compliance findings returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetRuleBasedView", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewComplianceApi(apiClient) + resp, r, err := api.GetRuleBasedView(ctx, 1739982278000, *datadogV2.NewGetRuleBasedViewOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ComplianceApi.GetRuleBasedView`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ComplianceApi.GetRuleBasedView`:\n%s\n", responseContent) +} diff --git a/examples/v2/dashboards/GetDashboardUsage.go b/examples/v2/dashboards/GetDashboardUsage.go new file mode 100644 index 00000000000..8ad54324538 --- /dev/null +++ b/examples/v2/dashboards/GetDashboardUsage.go @@ -0,0 +1,33 @@ +// Get usage stats for a dashboard returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "dashboard" in the system + DashboardID := os.Getenv("DASHBOARD_ID") + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetDashboardUsage", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewDashboardsApi(apiClient) + resp, r, err := api.GetDashboardUsage(ctx, DashboardID) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.GetDashboardUsage`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.GetDashboardUsage`:\n%s\n", responseContent) +} diff --git a/examples/v2/dashboards/ListDashboardsUsage.go b/examples/v2/dashboards/ListDashboardsUsage.go new file mode 100644 index 00000000000..5153af1864b --- /dev/null +++ b/examples/v2/dashboards/ListDashboardsUsage.go @@ -0,0 +1,30 @@ +// Get usage stats for all dashboards returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListDashboardsUsage", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewDashboardsApi(apiClient) + resp, r, err := api.ListDashboardsUsage(ctx, *datadogV2.NewListDashboardsUsageOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboardsUsage`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.ListDashboardsUsage`:\n%s\n", responseContent) +} diff --git a/examples/v2/dashboards/ListDashboardsUsage_3152353926.go b/examples/v2/dashboards/ListDashboardsUsage_3152353926.go new file mode 100644 index 00000000000..4adb304beac --- /dev/null +++ b/examples/v2/dashboards/ListDashboardsUsage_3152353926.go @@ -0,0 +1,30 @@ +// Get usage stats for all dashboards returns "OK" response with pagination + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListDashboardsUsage", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewDashboardsApi(apiClient) + resp, _ := api.ListDashboardsUsageWithPagination(ctx, *datadogV2.NewListDashboardsUsageOptionalParameters().WithPageLimit(500)) + + for paginationResult := range resp { + if paginationResult.Error != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboardsUsage`: %v\n", paginationResult.Error) + } + responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/examples/v2/email-transport/CreateEmailTransportWebhookIntake.go b/examples/v2/email-transport/CreateEmailTransportWebhookIntake.go deleted file mode 100644 index 2a59368eca1..00000000000 --- a/examples/v2/email-transport/CreateEmailTransportWebhookIntake.go +++ /dev/null @@ -1,104 +0,0 @@ -// Ingest email transport webhook events returns "No Content" response - -package main - -import ( - "context" - "fmt" - "os" - "time" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - body := []datadogV2.TransportWebhookLog{ - { - Attributes: datadogV2.TransportWebhookLogAttributes{ - Category: []string{ - "transactional", - }, - Email: &datadogV2.TransportWebhookLogEmail{ - Address: datadog.PtrString("user@example.com"), - Domain: datadog.PtrString("example.com"), - Subject: datadog.PtrString("[Monitor Alert] CPU usage is high"), - Type: []string{ - "transactional", - }, - }, - EmailId: datadog.PtrString("abc123-def456"), - EmailTypeDisplayName: datadog.PtrString("Monitor Alert"), - Message: &datadogV2.TransportWebhookLogMessage{ - Auth: &datadogV2.TransportWebhookLogMessageAuth{ - DeliveredWithTls: datadog.PtrString("TLSv1.2"), - }, - CustomArgs: &datadogV2.TransportWebhookLogMessageCustomArgs{ - EmailId: datadog.PtrString("abc123-def456"), - EmailTypeDisplayName: datadog.PtrString("Monitor Alert"), - OrgUuid: datadog.PtrString("8dee7c38-00cb-11ea-a77b-8b5a08d3b091"), - QueueTime: datadog.PtrString("2024-01-15T10:29:00Z"), - Subject: datadog.PtrString("[Monitor Alert] CPU usage is high"), - }, - Id: &datadogV2.TransportWebhookLogMessageId{ - MessageId: datadog.PtrString(""), - SmtpId: datadog.PtrString(""), - TransportEventId: datadog.PtrString("evt_abc123"), - }, - Name: datadog.PtrString("delivered"), - Response: &datadogV2.TransportWebhookLogMessageResponse{ - EnhancedSmtpCode: datadog.PtrString("2.0.0"), - Reason: datadog.PtrString("250 2.0.0 OK"), - SmtpCode: datadog.PtrString("250"), - }, - SenderIp: datadog.PtrString("192.168.1.1"), - Timestamp: &datadogV2.TransportWebhookLogMessageTimestamp{ - EventTimestamp: datadog.PtrFloat64(1705312200.0), - Lifetime: datadog.PtrFloat64(3.2), - QueueTime: datadog.PtrFloat64(1.5), - ScheduledTime: datadog.PtrFloat64(1705312190.0), - }, - }, - Network: &datadogV2.TransportWebhookLogNetwork{ - Ip: &datadogV2.TransportWebhookLogNetworkIp{ - Attributes: []datadogV2.TransportWebhookLogIpAttribute{ - { - Ip: datadog.PtrString("192.168.1.1"), - Source: []string{ - "sendgrid", - }, - }, - }, - List: []string{ - "192.168.1.1", - }, - }, - }, - Org: datadog.PtrInt64(1234), - OrgMetadata: &datadogV2.TransportWebhookLogOrgMetadata{}, - OrgUuid: datadog.PtrString("8dee7c38-00cb-11ea-a77b-8b5a08d3b091"), - QueueTime: datadog.PtrString("2024-01-15T10:29:00Z"), - Subject: datadog.PtrString("[Monitor Alert] CPU usage is high"), - Useragent: datadog.PtrString("Mozilla/5.0"), - }, - Date: time.Date(2024, 1, 15, 10, 30, 0, 0, time.UTC), - LogId: "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR", - Source: "sendgrid", - Status: "info", - Tags: []string{ - "env:production", - }, - }, - } - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.CreateEmailTransportWebhookIntake", true) - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewEmailTransportApi(apiClient) - r, err := api.CreateEmailTransportWebhookIntake(ctx, body) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `EmailTransportApi.CreateEmailTransportWebhookIntake`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} diff --git a/examples/v2/llm-observability/AggregateLLMObsExperimentation.go b/examples/v2/llm-observability/AggregateLLMObsExperimentation.go new file mode 100644 index 00000000000..a0a28dcde64 --- /dev/null +++ b/examples/v2/llm-observability/AggregateLLMObsExperimentation.go @@ -0,0 +1,62 @@ +// Aggregate LLM Observability experimentation returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsExperimentationAnalyticsRequest{ + Data: datadogV2.LLMObsExperimentationAnalyticsDataRequest{ + Attributes: datadogV2.LLMObsExperimentationAnalyticsDataAttributesRequest{ + Aggregate: datadogV2.LLMObsExperimentationAnalyticsAggregate{ + Compute: []datadogV2.LLMObsExperimentationAnalyticsCompute{ + { + Metric: "score_value", + Name: datadog.PtrString("avg_faithfulness"), + }, + }, + DatasetVersion: *datadog.NewNullableInt64(nil), + GroupBy: []datadogV2.LLMObsExperimentationAnalyticsGroupBy{ + { + Field: "span_id", + }, + }, + Indexes: []string{ + "experiment-evals", + }, + Limit: *datadog.NewNullableInt32(datadog.PtrInt32(1000)), + Search: datadogV2.LLMObsExperimentationAnalyticsSearch{ + Query: "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012", + }, + Time: &datadogV2.LLMObsExperimentationAnalyticsTimeRange{ + From: 1705312200000, + To: 1705315800000, + }, + }, + }, + Type: datadogV2.LLMOBSEXPERIMENTATIONTYPE_EXPERIMENTATION, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.AggregateLLMObsExperimentation", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.AggregateLLMObsExperimentation(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.AggregateLLMObsExperimentation`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.AggregateLLMObsExperimentation`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go index 359bdc40549..35d2a7b3389 100644 --- a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go @@ -17,10 +17,11 @@ func main() { Data: datadogV2.LLMObsAnnotationQueueInteractionsDataRequest{ Attributes: datadogV2.LLMObsAnnotationQueueInteractionsDataAttributesRequest{ Interactions: []datadogV2.LLMObsAnnotationQueueInteractionItem{ - { - ContentId: "trace-abc-123", - Type: datadogV2.LLMOBSINTERACTIONTYPE_TRACE, - }, + datadogV2.LLMObsAnnotationQueueInteractionItem{ + LLMObsTraceInteractionItem: &datadogV2.LLMObsTraceInteractionItem{ + ContentId: "trace-abc-123", + Type: datadogV2.LLMOBSTRACEINTERACTIONTYPE_TRACE, + }}, }, }, Type: datadogV2.LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS, diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.go b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.go new file mode 100644 index 00000000000..44a7e7874e1 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.go @@ -0,0 +1,49 @@ +// Add a display_block interaction returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsAnnotationQueueInteractionsRequest{ + Data: datadogV2.LLMObsAnnotationQueueInteractionsDataRequest{ + Attributes: datadogV2.LLMObsAnnotationQueueInteractionsDataAttributesRequest{ + Interactions: []datadogV2.LLMObsAnnotationQueueInteractionItem{ + datadogV2.LLMObsAnnotationQueueInteractionItem{ + LLMObsDisplayBlockInteractionItem: &datadogV2.LLMObsDisplayBlockInteractionItem{ + Type: datadogV2.LLMOBSDISPLAYBLOCKINTERACTIONTYPE_DISPLAY_BLOCK, + DisplayBlock: []datadogV2.LLMObsContentBlock{ + { + Type: datadogV2.LLMOBSCONTENTBLOCKTYPE_MARKDOWN, + Content: "## Triage Instructions", + }, + }, + }}, + }, + }, + Type: datadogV2.LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateLLMObsAnnotationQueueInteractions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.CreateLLMObsAnnotationQueueInteractions(ctx, "queue_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/CreateLLMObsIntegrationInference.go b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.go new file mode 100644 index 00000000000..9cfbb45e0d0 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.go @@ -0,0 +1,127 @@ +// Run an LLM inference returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsIntegrationInferenceRequest{ + AnthropicMetadata: &datadogV2.LLMObsAnthropicMetadata{ + Effort: *datadogV2.NewNullableLLMObsAnthropicEffort(datadogV2.LLMOBSANTHROPICEFFORT_MEDIUM.Ptr()), + Thinking: &datadogV2.LLMObsAnthropicThinkingConfig{ + BudgetTokens: *datadog.NewNullableInt64(datadog.PtrInt64(1024)), + Type: datadogV2.LLMOBSANTHROPICTHINKINGTYPE_ENABLED, + }, + }, + AzureOpenaiMetadata: &datadogV2.LLMObsAzureOpenAIMetadata{ + DeploymentId: datadog.PtrString("my-gpt4-deployment"), + ModelVersion: datadog.PtrString("0613"), + ResourceName: datadog.PtrString("my-azure-resource"), + }, + BedrockMetadata: &datadogV2.LLMObsBedrockMetadata{ + Region: datadog.PtrString("us-east-1"), + }, + FrequencyPenalty: *datadog.NewNullableFloat64(datadog.PtrFloat64(0.0)), + JsonSchema: *datadog.NewNullableString(datadog.PtrString(`{"type":"object","properties":{"answer":{"type":"string"}}}`)), + MaxCompletionTokens: *datadog.NewNullableInt64(datadog.PtrInt64(1024)), + MaxTokens: *datadog.NewNullableInt64(datadog.PtrInt64(1024)), + Messages: []datadogV2.LLMObsInferenceMessage{ + { + Content: datadog.PtrString("What is the capital of France?"), + Contents: []datadogV2.LLMObsInferenceContent{ + { + Type: "text", + Value: datadogV2.LLMObsInferenceContentValue{ + Text: datadog.PtrString("Hello, how can I help you?"), + ToolCall: &datadogV2.LLMObsInferenceToolCall{ + Arguments: map[string]interface{}{ + "location": "San Francisco", + }, + Name: datadog.PtrString("get_weather"), + ToolId: datadog.PtrString("call_abc123"), + Type: datadog.PtrString("function"), + }, + ToolCallResult: &datadogV2.LLMObsInferenceToolResult{ + Name: datadog.PtrString("get_weather"), + Result: datadog.PtrString("The weather in San Francisco is 68°F and sunny."), + ToolId: datadog.PtrString("call_abc123"), + Type: datadog.PtrString("function"), + }, + }, + }, + }, + Id: datadog.PtrString("msg_001"), + Role: datadog.PtrString("user"), + ToolCalls: []datadogV2.LLMObsInferenceToolCall{ + { + Arguments: map[string]interface{}{ + "location": "San Francisco", + }, + Name: datadog.PtrString("get_weather"), + ToolId: datadog.PtrString("call_abc123"), + Type: datadog.PtrString("function"), + }, + }, + ToolResults: []datadogV2.LLMObsInferenceToolResult{ + { + Name: datadog.PtrString("get_weather"), + Result: datadog.PtrString("The weather in San Francisco is 68°F and sunny."), + ToolId: datadog.PtrString("call_abc123"), + Type: datadog.PtrString("function"), + }, + }, + }, + }, + ModelId: "gpt-4o", + OpenaiMetadata: &datadogV2.LLMObsOpenAIMetadata{ + ReasoningEffort: *datadogV2.NewNullableLLMObsOpenAIReasoningEffort(datadogV2.LLMOBSOPENAIREASONINGEFFORT_MEDIUM.Ptr()), + ReasoningSummary: *datadogV2.NewNullableLLMObsOpenAIReasoningSummary(datadogV2.LLMOBSOPENAIREASONINGSUMMARY_AUTO.Ptr()), + }, + PresencePenalty: *datadog.NewNullableFloat64(datadog.PtrFloat64(0.0)), + Temperature: *datadog.NewNullableFloat64(datadog.PtrFloat64(0.7)), + Tools: []datadogV2.LLMObsInferenceTool{ + { + Function: datadogV2.LLMObsInferenceFunction{ + Description: datadog.PtrString("Get the current weather for a location."), + Name: "get_weather", + Parameters: map[string]interface{}{ + "properties": "{'location': {'type': 'string'}}", + "type": "object", + }, + }, + Type: "function", + }, + }, + TopK: *datadog.NewNullableInt64(datadog.PtrInt64(50)), + TopP: *datadog.NewNullableFloat64(datadog.PtrFloat64(1.0)), + VertexAiMetadata: &datadogV2.LLMObsVertexAIMetadata{ + Location: datadog.PtrString("us-central1"), + Project: datadog.PtrString("my-gcp-project"), + ProjectIds: []string{ + "my-gcp-project", + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateLLMObsIntegrationInference", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.CreateLLMObsIntegrationInference(ctx, datadogV2.LLMOBSINTEGRATIONNAME_OPENAI, "account_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.CreateLLMObsIntegrationInference`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.CreateLLMObsIntegrationInference`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/DeleteLLMObsData.go b/examples/v2/llm-observability/DeleteLLMObsData.go new file mode 100644 index 00000000000..f96edfb2ac0 --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsData.go @@ -0,0 +1,43 @@ +// Delete LLM Observability data returns "Accepted" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsDataDeletionRequest{ + Data: datadogV2.LLMObsDataDeletionRequestData{ + Attributes: datadogV2.LLMObsDataDeletionRequestAttributes{ + Delay: datadog.PtrInt64(0), + From: 1705314600000, + Query: map[string]string{ + "query": "@trace_id:abc123def456", + }, + To: 1705315200000, + }, + Type: datadogV2.LLMOBSDATADELETIONREQUESTTYPE_CREATE_DELETION_REQ, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteLLMObsData", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.DeleteLLMObsData(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.DeleteLLMObsData`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.DeleteLLMObsData`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/ListLLMObsExperimentEvents.go b/examples/v2/llm-observability/ListLLMObsExperimentEvents.go new file mode 100644 index 00000000000..08a8736889c --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsExperimentEvents.go @@ -0,0 +1,30 @@ +// List events for an LLM Observability experiment returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListLLMObsExperimentEvents", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.ListLLMObsExperimentEvents(ctx, "experiment_id", *datadogV2.NewListLLMObsExperimentEventsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.ListLLMObsExperimentEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.ListLLMObsExperimentEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.go b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.go new file mode 100644 index 00000000000..549c65620bf --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.go @@ -0,0 +1,30 @@ +// List LLM integration accounts returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListLLMObsIntegrationAccounts", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.ListLLMObsIntegrationAccounts(ctx, datadogV2.LLMOBSINTEGRATIONNAME_OPENAI) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.ListLLMObsIntegrationAccounts`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.ListLLMObsIntegrationAccounts`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationModels.go b/examples/v2/llm-observability/ListLLMObsIntegrationModels.go new file mode 100644 index 00000000000..d9c633fbe6d --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationModels.go @@ -0,0 +1,30 @@ +// List LLM integration models returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListLLMObsIntegrationModels", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.ListLLMObsIntegrationModels(ctx, datadogV2.LLMOBSINTEGRATIONNAME_OPENAI, "account_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.ListLLMObsIntegrationModels`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.ListLLMObsIntegrationModels`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/ListLLMObsSpans.go b/examples/v2/llm-observability/ListLLMObsSpans.go new file mode 100644 index 00000000000..0d128874b39 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsSpans.go @@ -0,0 +1,30 @@ +// List LLM Observability spans returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListLLMObsSpans", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.ListLLMObsSpans(ctx, *datadogV2.NewListLLMObsSpansOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.ListLLMObsSpans`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.ListLLMObsSpans`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/SearchLLMObsExperimentation.go b/examples/v2/llm-observability/SearchLLMObsExperimentation.go new file mode 100644 index 00000000000..73f19247051 --- /dev/null +++ b/examples/v2/llm-observability/SearchLLMObsExperimentation.go @@ -0,0 +1,56 @@ +// Search LLM Observability experimentation entities returns "Partial Content — more results are available. Use +// `meta.after` as the next `page.cursor`." response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsExperimentationSearchRequest{ + Data: datadogV2.LLMObsExperimentationSearchDataRequest{ + Attributes: datadogV2.LLMObsExperimentationSearchDataAttributesRequest{ + ContentPreview: &datadogV2.LLMObsExperimentationContentPreview{ + Limit: datadog.PtrInt64(500), + }, + Filter: datadogV2.LLMObsExperimentationFilter{ + IncludeDeleted: datadog.PtrBool(false), + IsDeleted: datadog.PtrBool(false), + Query: datadog.PtrString("my experiment"), + Scope: []string{ + "experiments", + }, + Version: *datadog.NewNullableInt64(nil), + }, + Include: &datadogV2.LLMObsExperimentationInclude{ + UserData: datadog.PtrBool(false), + }, + Page: &datadogV2.LLMObsExperimentationCursorPage{ + Limit: datadog.PtrInt64(100), + }, + }, + Type: datadogV2.LLMOBSEXPERIMENTATIONTYPE_EXPERIMENTATION, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.SearchLLMObsExperimentation", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.SearchLLMObsExperimentation(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.SearchLLMObsExperimentation`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.SearchLLMObsExperimentation`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/SearchLLMObsSpans.go b/examples/v2/llm-observability/SearchLLMObsSpans.go new file mode 100644 index 00000000000..55562e101f4 --- /dev/null +++ b/examples/v2/llm-observability/SearchLLMObsSpans.go @@ -0,0 +1,56 @@ +// Search LLM Observability spans returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsSearchSpansRequest{ + Data: datadogV2.LLMObsSearchSpansRequestData{ + Attributes: datadogV2.LLMObsSearchSpansRequestAttributes{ + Filter: &datadogV2.LLMObsSpanFilter{ + From: datadog.PtrString("now-900s"), + MlApp: datadog.PtrString("my-llm-app"), + Query: datadog.PtrString("@session_id:abc123def456"), + SpanId: datadog.PtrString("abc123def456"), + SpanKind: datadog.PtrString("llm"), + SpanName: datadog.PtrString("llm_call"), + To: datadog.PtrString("now"), + TraceId: datadog.PtrString("trace-9a8b7c6d5e4f"), + }, + Options: &datadogV2.LLMObsSpanSearchOptions{ + IncludeAttachments: datadog.PtrBool(true), + TimeOffset: datadog.PtrInt64(0), + }, + Page: &datadogV2.LLMObsSpanPageQuery{ + Cursor: datadog.PtrString("eyJzdGFydCI6MTAwfQ=="), + Limit: datadog.PtrInt64(10), + }, + Sort: datadog.PtrString("-start_ns"), + }, + Type: datadogV2.LLMOBSSEARCHSPANSREQUESTTYPE_SPANS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.SearchLLMObsSpans", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.SearchLLMObsSpans(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.SearchLLMObsSpans`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.SearchLLMObsSpans`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/SimpleSearchLLMObsExperimentation.go b/examples/v2/llm-observability/SimpleSearchLLMObsExperimentation.go new file mode 100644 index 00000000000..a7d9bb24d64 --- /dev/null +++ b/examples/v2/llm-observability/SimpleSearchLLMObsExperimentation.go @@ -0,0 +1,62 @@ +// Simple search experimentation entities returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsExperimentationSimpleSearchRequest{ + Data: datadogV2.LLMObsExperimentationSimpleSearchDataRequest{ + Attributes: datadogV2.LLMObsExperimentationSimpleSearchDataAttributesRequest{ + ContentPreview: &datadogV2.LLMObsExperimentationContentPreview{ + Limit: datadog.PtrInt64(500), + }, + Filter: datadogV2.LLMObsExperimentationFilter{ + IncludeDeleted: datadog.PtrBool(false), + IsDeleted: datadog.PtrBool(false), + Query: datadog.PtrString("my experiment"), + Scope: []string{ + "experiments", + }, + Version: *datadog.NewNullableInt64(nil), + }, + Include: &datadogV2.LLMObsExperimentationInclude{ + UserData: datadog.PtrBool(false), + }, + Page: &datadogV2.LLMObsExperimentationNumberPage{ + Limit: datadog.PtrInt32(50), + Number: datadog.PtrInt32(1), + }, + Sort: []datadogV2.LLMObsExperimentationSortField{ + { + Direction: datadogV2.LLMOBSEXPERIMENTATIONSORTFIELDDIRECTION_DESC.Ptr(), + Field: "created_at", + }, + }, + }, + Type: datadogV2.LLMOBSEXPERIMENTATIONTYPE_EXPERIMENTATION, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.SimpleSearchLLMObsExperimentation", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.SimpleSearchLLMObsExperimentation(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.SimpleSearchLLMObsExperimentation`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.SimpleSearchLLMObsExperimentation`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/DeleteModelLabRun.go b/examples/v2/model-lab-api/DeleteModelLabRun.go new file mode 100644 index 00000000000..d1c261cb566 --- /dev/null +++ b/examples/v2/model-lab-api/DeleteModelLabRun.go @@ -0,0 +1,26 @@ +// Delete a Model Lab run returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteModelLabRun", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.DeleteModelLabRun(ctx, 70158) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.DeleteModelLabRun`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/model-lab-api/GetModelLabArtifactContent.go b/examples/v2/model-lab-api/GetModelLabArtifactContent.go new file mode 100644 index 00000000000..31c8fd64540 --- /dev/null +++ b/examples/v2/model-lab-api/GetModelLabArtifactContent.go @@ -0,0 +1,30 @@ +// Get Model Lab artifact content returns "OK" response + +package main + +import ( + "context" + "fmt" + "io/ioutil" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetModelLabArtifactContent", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.GetModelLabArtifactContent(ctx, "1", "runs/42/model/weights.pt") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.GetModelLabArtifactContent`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := ioutil.ReadAll(resp) + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.GetModelLabArtifactContent`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/GetModelLabArtifactContent_2858422658.go b/examples/v2/model-lab-api/GetModelLabArtifactContent_2858422658.go new file mode 100644 index 00000000000..680f1daea31 --- /dev/null +++ b/examples/v2/model-lab-api/GetModelLabArtifactContent_2858422658.go @@ -0,0 +1,30 @@ +// Download artifact content returns "OK" response + +package main + +import ( + "context" + "fmt" + "io/ioutil" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetModelLabArtifactContent", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.GetModelLabArtifactContent(ctx, "2387", "f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/adapter_config.json") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.GetModelLabArtifactContent`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := ioutil.ReadAll(resp) + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.GetModelLabArtifactContent`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/GetModelLabProject.go b/examples/v2/model-lab-api/GetModelLabProject.go new file mode 100644 index 00000000000..8baa4bd2a23 --- /dev/null +++ b/examples/v2/model-lab-api/GetModelLabProject.go @@ -0,0 +1,30 @@ +// Get a Model Lab project returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetModelLabProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.GetModelLabProject(ctx, 2387) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.GetModelLabProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.GetModelLabProject`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/GetModelLabRun.go b/examples/v2/model-lab-api/GetModelLabRun.go new file mode 100644 index 00000000000..032f7389e02 --- /dev/null +++ b/examples/v2/model-lab-api/GetModelLabRun.go @@ -0,0 +1,30 @@ +// Get a Model Lab run returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetModelLabRun", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.GetModelLabRun(ctx, 70158) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.GetModelLabRun`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.GetModelLabRun`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabProjectArtifacts.go b/examples/v2/model-lab-api/ListModelLabProjectArtifacts.go new file mode 100644 index 00000000000..7b2a66a56f3 --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabProjectArtifacts.go @@ -0,0 +1,30 @@ +// List Model Lab project artifacts returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabProjectArtifacts", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabProjectArtifacts(ctx, 2387) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabProjectArtifacts`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabProjectArtifacts`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabProjectFacetKeys.go b/examples/v2/model-lab-api/ListModelLabProjectFacetKeys.go new file mode 100644 index 00000000000..f27a835417e --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabProjectFacetKeys.go @@ -0,0 +1,30 @@ +// List Model Lab project facet keys returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabProjectFacetKeys", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabProjectFacetKeys(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabProjectFacetKeys`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabProjectFacetKeys`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabProjectFacetValues.go b/examples/v2/model-lab-api/ListModelLabProjectFacetValues.go new file mode 100644 index 00000000000..cb70038ab8d --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabProjectFacetValues.go @@ -0,0 +1,30 @@ +// List Model Lab project facet values returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabProjectFacetValues", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabProjectFacetValues(ctx, datadogV2.MODELLABPROJECTFACETTYPE_TAG, "model") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabProjectFacetValues`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabProjectFacetValues`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabProjects.go b/examples/v2/model-lab-api/ListModelLabProjects.go new file mode 100644 index 00000000000..c5f42ad1a53 --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabProjects.go @@ -0,0 +1,30 @@ +// List Model Lab projects returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabProjects", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabProjects(ctx, *datadogV2.NewListModelLabProjectsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabProjects`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabProjects`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabRunArtifacts.go b/examples/v2/model-lab-api/ListModelLabRunArtifacts.go new file mode 100644 index 00000000000..acf6fcf0116 --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabRunArtifacts.go @@ -0,0 +1,30 @@ +// List Model Lab run artifacts returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabRunArtifacts", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabRunArtifacts(ctx, 70158, *datadogV2.NewListModelLabRunArtifactsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabRunArtifacts`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabRunArtifacts`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabRunFacetKeys.go b/examples/v2/model-lab-api/ListModelLabRunFacetKeys.go new file mode 100644 index 00000000000..171fe82b5e9 --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabRunFacetKeys.go @@ -0,0 +1,30 @@ +// List Model Lab run facet keys returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabRunFacetKeys", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabRunFacetKeys(ctx, 2387) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabRunFacetKeys`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabRunFacetKeys`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabRunFacetValues.go b/examples/v2/model-lab-api/ListModelLabRunFacetValues.go new file mode 100644 index 00000000000..f95afd73c2a --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabRunFacetValues.go @@ -0,0 +1,30 @@ +// List Model Lab run facet values returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabRunFacetValues", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabRunFacetValues(ctx, 2387, datadogV2.MODELLABFACETTYPE_TAG, "model") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabRunFacetValues`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabRunFacetValues`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/ListModelLabRuns.go b/examples/v2/model-lab-api/ListModelLabRuns.go new file mode 100644 index 00000000000..d95a9a6099d --- /dev/null +++ b/examples/v2/model-lab-api/ListModelLabRuns.go @@ -0,0 +1,30 @@ +// List Model Lab runs returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListModelLabRuns", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + resp, r, err := api.ListModelLabRuns(ctx, *datadogV2.NewListModelLabRunsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.ListModelLabRuns`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ModelLabAPIApi.ListModelLabRuns`:\n%s\n", responseContent) +} diff --git a/examples/v2/model-lab-api/PinModelLabRun.go b/examples/v2/model-lab-api/PinModelLabRun.go new file mode 100644 index 00000000000..602872adc36 --- /dev/null +++ b/examples/v2/model-lab-api/PinModelLabRun.go @@ -0,0 +1,26 @@ +// Pin a Model Lab run returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.PinModelLabRun", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.PinModelLabRun(ctx, 70158) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.PinModelLabRun`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/model-lab-api/StarModelLabProject.go b/examples/v2/model-lab-api/StarModelLabProject.go new file mode 100644 index 00000000000..6ae024ea660 --- /dev/null +++ b/examples/v2/model-lab-api/StarModelLabProject.go @@ -0,0 +1,26 @@ +// Star a Model Lab project returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.StarModelLabProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.StarModelLabProject(ctx, 2387) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.StarModelLabProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/model-lab-api/UnpinModelLabRun.go b/examples/v2/model-lab-api/UnpinModelLabRun.go new file mode 100644 index 00000000000..c16d901d908 --- /dev/null +++ b/examples/v2/model-lab-api/UnpinModelLabRun.go @@ -0,0 +1,26 @@ +// Unpin a Model Lab run returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UnpinModelLabRun", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.UnpinModelLabRun(ctx, 70158) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.UnpinModelLabRun`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/model-lab-api/UnstarModelLabProject.go b/examples/v2/model-lab-api/UnstarModelLabProject.go new file mode 100644 index 00000000000..4b5b8390d28 --- /dev/null +++ b/examples/v2/model-lab-api/UnstarModelLabProject.go @@ -0,0 +1,26 @@ +// Remove star from a Model Lab project returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UnstarModelLabProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.UnstarModelLabProject(ctx, 1) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.UnstarModelLabProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/model-lab-api/UnstarModelLabProject_931927092.go b/examples/v2/model-lab-api/UnstarModelLabProject_931927092.go new file mode 100644 index 00000000000..5ebf85c6b5b --- /dev/null +++ b/examples/v2/model-lab-api/UnstarModelLabProject_931927092.go @@ -0,0 +1,26 @@ +// Unstar a Model Lab project returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UnstarModelLabProject", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewModelLabAPIApi(apiClient) + r, err := api.UnstarModelLabProject(ctx, 2387) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ModelLabAPIApi.UnstarModelLabProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1070998129.go b/examples/v2/observability-pipelines/ValidatePipeline_1070998129.go new file mode 100644 index 00000000000..26d221ec68c --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1070998129.go @@ -0,0 +1,82 @@ +// Validate an observability pipeline with cloud_prem destination buffer returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.ObservabilityPipelineSpec{ + Data: datadogV2.ObservabilityPipelineSpecData{ + Attributes: datadogV2.ObservabilityPipelineDataAttributes{ + Config: datadogV2.ObservabilityPipelineConfig{ + Destinations: []datadogV2.ObservabilityPipelineConfigDestinationItem{ + datadogV2.ObservabilityPipelineConfigDestinationItem{ + ObservabilityPipelineCloudPremDestination: &datadogV2.ObservabilityPipelineCloudPremDestination{ + Id: "cloud-prem-destination", + Inputs: []string{ + "my-processor-group", + }, + Type: datadogV2.OBSERVABILITYPIPELINECLOUDPREMDESTINATIONTYPE_CLOUD_PREM, + EndpointUrlKey: datadog.PtrString("CLOUDPREM_ENDPOINT_URL"), + Buffer: &datadogV2.ObservabilityPipelineBufferOptions{ + ObservabilityPipelineDiskBufferOptions: &datadogV2.ObservabilityPipelineDiskBufferOptions{ + Type: datadogV2.OBSERVABILITYPIPELINEBUFFEROPTIONSDISKTYPE_DISK.Ptr(), + MaxSize: 1073741824, + WhenFull: datadogV2.OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK.Ptr(), + }}, + }}, + }, + ProcessorGroups: []datadogV2.ObservabilityPipelineConfigProcessorGroup{ + { + Enabled: true, + Id: "my-processor-group", + Include: "service:my-service", + Inputs: []string{ + "datadog-agent-source", + }, + Processors: []datadogV2.ObservabilityPipelineConfigProcessorItem{ + datadogV2.ObservabilityPipelineConfigProcessorItem{ + ObservabilityPipelineFilterProcessor: &datadogV2.ObservabilityPipelineFilterProcessor{ + Enabled: true, + Id: "filter-processor", + Include: "status:error", + Type: datadogV2.OBSERVABILITYPIPELINEFILTERPROCESSORTYPE_FILTER, + }}, + }, + }, + }, + Sources: []datadogV2.ObservabilityPipelineConfigSourceItem{ + datadogV2.ObservabilityPipelineConfigSourceItem{ + ObservabilityPipelineDatadogAgentSource: &datadogV2.ObservabilityPipelineDatadogAgentSource{ + Id: "datadog-agent-source", + Type: datadogV2.OBSERVABILITYPIPELINEDATADOGAGENTSOURCETYPE_DATADOG_AGENT, + }}, + }, + }, + Name: "Pipeline with CloudPrem Buffer", + }, + Type: "pipelines", + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewObservabilityPipelinesApi(apiClient) + resp, r, err := api.ValidatePipeline(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObservabilityPipelinesApi.ValidatePipeline`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ObservabilityPipelinesApi.ValidatePipeline`:\n%s\n", responseContent) +} diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1130701356.go b/examples/v2/observability-pipelines/ValidatePipeline_1130701356.go new file mode 100644 index 00000000000..66fd34c150b --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1130701356.go @@ -0,0 +1,89 @@ +// Validate an observability pipeline with Splunk HEC source valid_tokens returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.ObservabilityPipelineSpec{ + Data: datadogV2.ObservabilityPipelineSpecData{ + Attributes: datadogV2.ObservabilityPipelineDataAttributes{ + Config: datadogV2.ObservabilityPipelineConfig{ + Destinations: []datadogV2.ObservabilityPipelineConfigDestinationItem{ + datadogV2.ObservabilityPipelineConfigDestinationItem{ + ObservabilityPipelineDatadogLogsDestination: &datadogV2.ObservabilityPipelineDatadogLogsDestination{ + Id: "datadog-logs-destination", + Inputs: []string{ + "my-processor-group", + }, + Type: datadogV2.OBSERVABILITYPIPELINEDATADOGLOGSDESTINATIONTYPE_DATADOG_LOGS, + }}, + }, + ProcessorGroups: []datadogV2.ObservabilityPipelineConfigProcessorGroup{ + { + Enabled: true, + Id: "my-processor-group", + Include: "service:my-service", + Inputs: []string{ + "splunk-hec-source", + }, + Processors: []datadogV2.ObservabilityPipelineConfigProcessorItem{ + datadogV2.ObservabilityPipelineConfigProcessorItem{ + ObservabilityPipelineFilterProcessor: &datadogV2.ObservabilityPipelineFilterProcessor{ + Enabled: true, + Id: "filter-processor", + Include: "status:error", + Type: datadogV2.OBSERVABILITYPIPELINEFILTERPROCESSORTYPE_FILTER, + }}, + }, + }, + }, + Sources: []datadogV2.ObservabilityPipelineConfigSourceItem{ + datadogV2.ObservabilityPipelineConfigSourceItem{ + ObservabilityPipelineSplunkHecSource: &datadogV2.ObservabilityPipelineSplunkHecSource{ + Id: "splunk-hec-source", + Type: datadogV2.OBSERVABILITYPIPELINESPLUNKHECSOURCETYPE_SPLUNK_HEC, + ValidTokens: []datadogV2.ObservabilityPipelineSplunkHecSourceValidToken{ + { + TokenKey: "SPLUNK_HEC_TOKEN", + Enabled: datadog.PtrBool(true), + FieldToAdd: &datadogV2.ObservabilityPipelineSourceValidTokenFieldToAdd{ + Key: "token_name", + Value: "primary_token", + }, + }, + { + TokenKey: "SPLUNK_HEC_TOKEN_BACKUP", + Enabled: datadog.PtrBool(false), + }, + }, + }}, + }, + }, + Name: "Pipeline with Splunk HEC valid_tokens", + }, + Type: "pipelines", + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewObservabilityPipelinesApi(apiClient) + resp, r, err := api.ValidatePipeline(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObservabilityPipelinesApi.ValidatePipeline`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ObservabilityPipelinesApi.ValidatePipeline`:\n%s\n", responseContent) +} diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1785209526.go b/examples/v2/observability-pipelines/ValidatePipeline_1785209526.go new file mode 100644 index 00000000000..9ae94e2fcf7 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1785209526.go @@ -0,0 +1,97 @@ +// Validate an observability pipeline with HTTP server source valid_tokens returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.ObservabilityPipelineSpec{ + Data: datadogV2.ObservabilityPipelineSpecData{ + Attributes: datadogV2.ObservabilityPipelineDataAttributes{ + Config: datadogV2.ObservabilityPipelineConfig{ + Destinations: []datadogV2.ObservabilityPipelineConfigDestinationItem{ + datadogV2.ObservabilityPipelineConfigDestinationItem{ + ObservabilityPipelineDatadogLogsDestination: &datadogV2.ObservabilityPipelineDatadogLogsDestination{ + Id: "datadog-logs-destination", + Inputs: []string{ + "my-processor-group", + }, + Type: datadogV2.OBSERVABILITYPIPELINEDATADOGLOGSDESTINATIONTYPE_DATADOG_LOGS, + }}, + }, + ProcessorGroups: []datadogV2.ObservabilityPipelineConfigProcessorGroup{ + { + Enabled: true, + Id: "my-processor-group", + Include: "service:my-service", + Inputs: []string{ + "http-server-source", + }, + Processors: []datadogV2.ObservabilityPipelineConfigProcessorItem{ + datadogV2.ObservabilityPipelineConfigProcessorItem{ + ObservabilityPipelineFilterProcessor: &datadogV2.ObservabilityPipelineFilterProcessor{ + Enabled: true, + Id: "filter-processor", + Include: "status:error", + Type: datadogV2.OBSERVABILITYPIPELINEFILTERPROCESSORTYPE_FILTER, + }}, + }, + }, + }, + Sources: []datadogV2.ObservabilityPipelineConfigSourceItem{ + datadogV2.ObservabilityPipelineConfigSourceItem{ + ObservabilityPipelineHttpServerSource: &datadogV2.ObservabilityPipelineHttpServerSource{ + Id: "http-server-source", + Type: datadogV2.OBSERVABILITYPIPELINEHTTPSERVERSOURCETYPE_HTTP_SERVER, + AuthStrategy: datadogV2.OBSERVABILITYPIPELINEHTTPSERVERSOURCEAUTHSTRATEGY_NONE, + Decoding: datadogV2.OBSERVABILITYPIPELINEDECODING_DECODE_JSON, + ValidTokens: []datadogV2.ObservabilityPipelineHttpServerSourceValidToken{ + { + TokenKey: "HTTP_SERVER_TOKEN", + Enabled: datadog.PtrBool(true), + PathToToken: &datadogV2.ObservabilityPipelineHttpServerSourceValidTokenPathToToken{ + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader: &datadogV2.ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader{ + Header: "X-Token", + }}, + FieldToAdd: &datadogV2.ObservabilityPipelineSourceValidTokenFieldToAdd{ + Key: "token_name", + Value: "primary_token", + }, + }, + { + TokenKey: "HTTP_SERVER_TOKEN_BACKUP", + Enabled: datadog.PtrBool(true), + PathToToken: &datadogV2.ObservabilityPipelineHttpServerSourceValidTokenPathToToken{ + ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation: datadogV2.OBSERVABILITYPIPELINEHTTPSERVERSOURCEVALIDTOKENPATHTOTOKENLOCATION_PATH.Ptr()}, + }, + }, + }}, + }, + }, + Name: "Pipeline with HTTP server valid_tokens", + }, + Type: "pipelines", + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewObservabilityPipelinesApi(apiClient) + resp, r, err := api.ValidatePipeline(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObservabilityPipelinesApi.ValidatePipeline`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ObservabilityPipelinesApi.ValidatePipeline`:\n%s\n", responseContent) +} diff --git a/examples/v2/on-call/SetOnCallTeamRoutingRules.go b/examples/v2/on-call/SetOnCallTeamRoutingRules.go index 38e658a0c96..57cb4877c8a 100644 --- a/examples/v2/on-call/SetOnCallTeamRoutingRules.go +++ b/examples/v2/on-call/SetOnCallTeamRoutingRules.go @@ -26,13 +26,13 @@ func main() { { Actions: []datadogV2.RoutingRuleAction{ datadogV2.RoutingRuleAction{ - SendSlackMessageAction: &datadogV2.SendSlackMessageAction{ - Channel: "channel", - Type: datadogV2.SENDSLACKMESSAGEACTIONTYPE_SEND_SLACK_MESSAGE, - Workspace: "workspace", + RoutingRuleEscalationPolicyAction: &datadogV2.RoutingRuleEscalationPolicyAction{ + Type: datadogV2.ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY, + PolicyId: EscalationPolicyDataID, + Urgency: datadogV2.URGENCY_LOW.Ptr(), }}, }, - Query: datadog.PtrString("tags.service:test"), + Query: datadog.PtrString("tags.service:time_restrictions"), TimeRestriction: &datadogV2.TimeRestrictions{ TimeZone: "Europe/Paris", Restrictions: []datadogV2.TimeRestriction{ @@ -51,11 +51,51 @@ func main() { }, }, }, + { + Actions: []datadogV2.RoutingRuleAction{ + datadogV2.RoutingRuleAction{ + RoutingRuleEscalationPolicyAction: &datadogV2.RoutingRuleEscalationPolicyAction{ + Type: datadogV2.ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY, + PolicyId: EscalationPolicyDataID, + Urgency: datadogV2.URGENCY_LOW.Ptr(), + AckTimeoutMinutes: datadog.PtrInt64(30), + SupportHours: &datadogV2.RoutingRuleEscalationPolicyActionSupportHours{ + TimeZone: "Europe/Paris", + Restrictions: []datadogV2.TimeRestriction{ + { + EndDay: datadogV2.WEEKDAY_WEDNESDAY.Ptr(), + EndTime: datadog.PtrString("17:00:00"), + StartDay: datadogV2.WEEKDAY_WEDNESDAY.Ptr(), + StartTime: datadog.PtrString("09:00:00"), + }, + { + EndDay: datadogV2.WEEKDAY_THURSDAY.Ptr(), + EndTime: datadog.PtrString("17:00:00"), + StartDay: datadogV2.WEEKDAY_THURSDAY.Ptr(), + StartTime: datadog.PtrString("09:00:00"), + }, + }, + }, + }}, + }, + Query: datadog.PtrString("tags.service:support_hours_and_acknowledgment_timeout"), + }, { PolicyId: datadog.PtrString(EscalationPolicyDataID), - Query: datadog.PtrString(""), + Query: datadog.PtrString("tags.service:legacy_policy_definition"), Urgency: datadogV2.URGENCY_LOW.Ptr(), }, + { + Actions: []datadogV2.RoutingRuleAction{ + datadogV2.RoutingRuleAction{ + RoutingRuleEscalationPolicyAction: &datadogV2.RoutingRuleEscalationPolicyAction{ + Type: datadogV2.ROUTINGRULEESCALATIONPOLICYACTIONTYPE_ESCALATION_POLICY, + PolicyId: EscalationPolicyDataID, + Urgency: datadogV2.URGENCY_LOW.Ptr(), + }}, + }, + Query: datadog.PtrString(""), + }, }, }, Id: datadog.PtrString(DdTeamDataID), diff --git a/examples/v2/scorecards/ListScorecardScores.go b/examples/v2/scorecards/ListScorecardScores.go new file mode 100644 index 00000000000..2419ba2d494 --- /dev/null +++ b/examples/v2/scorecards/ListScorecardScores.go @@ -0,0 +1,29 @@ +// List all scores returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewScorecardsApi(apiClient) + resp, r, err := api.ListScorecardScores(ctx, datadogV2.SCORECARDSCORESAGGREGATION_BY_ENTITY, *datadogV2.NewListScorecardScoresOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScorecardsApi.ListScorecardScores`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `ScorecardsApi.ListScorecardScores`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.go b/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.go new file mode 100644 index 00000000000..80ec0cc6cfd --- /dev/null +++ b/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.go @@ -0,0 +1,41 @@ +// Bulk subscribe to sample log generation returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SampleLogGenerationBulkSubscriptionRequest{ + Data: datadogV2.SampleLogGenerationBulkSubscriptionData{ + Attributes: datadogV2.SampleLogGenerationBulkSubscriptionAttributes{ + ContentPackIds: []string{ + "aws-cloudtrail", + }, + Duration: datadogV2.SAMPLELOGGENERATIONDURATION_THREE_DAYS.Ptr(), + }, + Type: datadogV2.SAMPLELOGGENERATIONBULKSUBSCRIPTIONREQUESTTYPE_BULK_SUBSCRIPTION_REQUESTS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.BulkCreateSampleLogGenerationSubscriptions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.BulkCreateSampleLogGenerationSubscriptions(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.BulkCreateSampleLogGenerationSubscriptions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.BulkCreateSampleLogGenerationSubscriptions`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.go b/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.go new file mode 100644 index 00000000000..97a7cce5469 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.go @@ -0,0 +1,39 @@ +// Subscribe to sample log generation returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SampleLogGenerationSubscriptionCreateRequest{ + Data: datadogV2.SampleLogGenerationSubscriptionCreateData{ + Attributes: datadogV2.SampleLogGenerationSubscriptionCreateAttributes{ + ContentPackId: "aws-cloudtrail", + Duration: datadogV2.SAMPLELOGGENERATIONDURATION_THREE_DAYS.Ptr(), + }, + Type: datadogV2.SAMPLELOGGENERATIONSUBSCRIPTIONREQUESTTYPE_SUBSCRIPTION_REQUESTS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateSampleLogGenerationSubscription", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.CreateSampleLogGenerationSubscription(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.CreateSampleLogGenerationSubscription`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.CreateSampleLogGenerationSubscription`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.go b/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.go new file mode 100644 index 00000000000..73d67221eb8 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.go @@ -0,0 +1,46 @@ +// Create an entity context sync configuration returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SecurityMonitoringIntegrationConfigCreateRequest{ + Data: datadogV2.SecurityMonitoringIntegrationConfigCreateData{ + Attributes: datadogV2.SecurityMonitoringIntegrationConfigCreateAttributes{ + Domain: "siem-test.com", + IntegrationType: datadogV2.SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE, + Name: "My GWS Integration", + Secrets: map[string]interface{}{ + "admin_email": "test@example.com", + }, + Settings: map[string]interface{}{ + "setting1": "value1", + }, + }, + Type: datadogV2.SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateSecurityMonitoringIntegrationConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.CreateSecurityMonitoringIntegrationConfig(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.CreateSecurityMonitoringIntegrationConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.CreateSecurityMonitoringIntegrationConfig`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3243059428.go b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3243059428.go new file mode 100644 index 00000000000..deea799a6f2 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3243059428.go @@ -0,0 +1,67 @@ +// Create a detection rule with type 'impossible_travel' and baselineUserLocationsDuration returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SecurityMonitoringRuleCreatePayload{ + SecurityMonitoringStandardRuleCreatePayload: &datadogV2.SecurityMonitoringStandardRuleCreatePayload{ + Queries: []datadogV2.SecurityMonitoringStandardRuleQuery{ + { + Aggregation: datadogV2.SECURITYMONITORINGRULEQUERYAGGREGATION_GEO_DATA.Ptr(), + GroupByFields: []string{ + "@usr.id", + }, + DistinctFields: []string{}, + Metric: datadog.PtrString("@network.client.geoip"), + Query: datadog.PtrString("*"), + }, + }, + Cases: []datadogV2.SecurityMonitoringRuleCaseCreate{ + { + Name: datadog.PtrString(""), + Status: datadogV2.SECURITYMONITORINGRULESEVERITY_INFO, + Notifications: []string{}, + }, + }, + HasExtendedTitle: datadog.PtrBool(true), + Message: "test", + IsEnabled: true, + Options: datadogV2.SecurityMonitoringRuleOptions{ + MaxSignalDuration: datadogV2.SECURITYMONITORINGRULEMAXSIGNALDURATION_ONE_DAY.Ptr(), + EvaluationWindow: datadogV2.SECURITYMONITORINGRULEEVALUATIONWINDOW_FIFTEEN_MINUTES.Ptr(), + KeepAlive: datadogV2.SECURITYMONITORINGRULEKEEPALIVE_ONE_HOUR.Ptr(), + DetectionMethod: datadogV2.SECURITYMONITORINGRULEDETECTIONMETHOD_IMPOSSIBLE_TRAVEL.Ptr(), + ImpossibleTravelOptions: &datadogV2.SecurityMonitoringRuleImpossibleTravelOptions{ + BaselineUserLocations: datadog.PtrBool(true), + BaselineUserLocationsDuration: *datadog.NewNullableInt32(datadog.PtrInt32(7)), + }, + }, + Name: "Example-Security-Monitoring", + Type: datadogV2.SECURITYMONITORINGRULETYPECREATE_LOG_DETECTION.Ptr(), + Tags: []string{}, + Filters: []datadogV2.SecurityMonitoringFilter{}, + }} + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.CreateSecurityMonitoringRule(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.CreateSecurityMonitoringRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.CreateSecurityMonitoringRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.go b/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.go new file mode 100644 index 00000000000..612994f2b93 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.go @@ -0,0 +1,30 @@ +// Unsubscribe from sample log generation returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteSampleLogGenerationSubscription", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.DeleteSampleLogGenerationSubscription(ctx, "content_pack_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.DeleteSampleLogGenerationSubscription`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.DeleteSampleLogGenerationSubscription`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.go b/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.go new file mode 100644 index 00000000000..c94c84d2928 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.go @@ -0,0 +1,26 @@ +// Delete an entity context sync configuration returns "OK" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteSecurityMonitoringIntegrationConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + r, err := api.DeleteSecurityMonitoringIntegrationConfig(ctx, "integration_config_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.DeleteSecurityMonitoringIntegrationConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/security-monitoring/GetEntityContext.go b/examples/v2/security-monitoring/GetEntityContext.go new file mode 100644 index 00000000000..2ebdf93951c --- /dev/null +++ b/examples/v2/security-monitoring/GetEntityContext.go @@ -0,0 +1,30 @@ +// Get entity context returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetEntityContext", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.GetEntityContext(ctx, *datadogV2.NewGetEntityContextOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.GetEntityContext`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.GetEntityContext`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.go b/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.go new file mode 100644 index 00000000000..29842fcedb6 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.go @@ -0,0 +1,30 @@ +// Get an entity context sync configuration returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetSecurityMonitoringIntegrationConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.GetSecurityMonitoringIntegrationConfig(ctx, "integration_config_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.GetSecurityMonitoringIntegrationConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.GetSecurityMonitoringIntegrationConfig`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/GetSignalEntities.go b/examples/v2/security-monitoring/GetSignalEntities.go new file mode 100644 index 00000000000..d1424285729 --- /dev/null +++ b/examples/v2/security-monitoring/GetSignalEntities.go @@ -0,0 +1,30 @@ +// Get entities related to a signal returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetSignalEntities", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.GetSignalEntities(ctx, "signal_id", *datadogV2.NewGetSignalEntitiesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.GetSignalEntities`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.GetSignalEntities`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.go b/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.go new file mode 100644 index 00000000000..dd5b71df4bc --- /dev/null +++ b/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.go @@ -0,0 +1,30 @@ +// Get sample log generation subscriptions returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListSampleLogGenerationSubscriptions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.ListSampleLogGenerationSubscriptions(ctx, *datadogV2.NewListSampleLogGenerationSubscriptionsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.ListSampleLogGenerationSubscriptions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.ListSampleLogGenerationSubscriptions`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/ListSecurityFilterVersions.go b/examples/v2/security-monitoring/ListSecurityFilterVersions.go new file mode 100644 index 00000000000..95dc1db1e66 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFilterVersions.go @@ -0,0 +1,29 @@ +// Get the version history of security filters returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.ListSecurityFilterVersions(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.ListSecurityFilterVersions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.ListSecurityFilterVersions`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.go b/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.go new file mode 100644 index 00000000000..4995171a99e --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.go @@ -0,0 +1,30 @@ +// List entity context sync configurations returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListSecurityMonitoringIntegrationConfigs", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.ListSecurityMonitoringIntegrationConfigs(ctx, *datadogV2.NewListSecurityMonitoringIntegrationConfigsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.ListSecurityMonitoringIntegrationConfigs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.ListSecurityMonitoringIntegrationConfigs`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.go b/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.go new file mode 100644 index 00000000000..944e4060128 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.go @@ -0,0 +1,47 @@ +// Update an entity context sync configuration returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SecurityMonitoringIntegrationConfigUpdateRequest{ + Data: datadogV2.SecurityMonitoringIntegrationConfigUpdateData{ + Attributes: datadogV2.SecurityMonitoringIntegrationConfigUpdateAttributes{ + Domain: datadog.PtrString("siem-test.com"), + Enabled: datadog.PtrBool(true), + IntegrationType: datadogV2.SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE.Ptr(), + Name: datadog.PtrString("My GWS Integration (renamed)"), + Secrets: map[string]interface{}{ + "admin_email": "test@example.com", + }, + Settings: map[string]interface{}{ + "setting1": "value1", + }, + }, + Type: datadogV2.SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateSecurityMonitoringIntegrationConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.UpdateSecurityMonitoringIntegrationConfig(ctx, "integration_config_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.UpdateSecurityMonitoringIntegrationConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.UpdateSecurityMonitoringIntegrationConfig`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.go b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.go new file mode 100644 index 00000000000..8bce432fba4 --- /dev/null +++ b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.go @@ -0,0 +1,26 @@ +// Validate an entity context sync configuration returns "OK" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ValidateSecurityMonitoringIntegrationConfig", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + r, err := api.ValidateSecurityMonitoringIntegrationConfig(ctx, "integration_config_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationConfig`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.go b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.go new file mode 100644 index 00000000000..afd88161bcf --- /dev/null +++ b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.go @@ -0,0 +1,38 @@ +// Validate entity context sync credentials returns "OK" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.SecurityMonitoringIntegrationCredentialsValidateRequest{ + Data: datadogV2.SecurityMonitoringIntegrationCredentialsValidateData{ + Attributes: datadogV2.SecurityMonitoringIntegrationCredentialsValidateAttributes{ + Domain: "siem-test.com", + IntegrationType: datadogV2.SECURITYMONITORINGINTEGRATIONTYPE_GOOGLE_WORKSPACE, + Secrets: map[string]interface{}{ + "admin_email": "test@example.com", + }, + }, + Type: datadogV2.SECURITYMONITORINGINTEGRATIONCONFIGRESOURCETYPE_INTEGRATION_CONFIG, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ValidateSecurityMonitoringIntegrationCredentials", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + r, err := api.ValidateSecurityMonitoringIntegrationCredentials(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.ValidateSecurityMonitoringIntegrationCredentials`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/test-examples/ListTestExamples.go b/examples/v2/test-examples/ListTestExamples.go new file mode 100644 index 00000000000..cf13db6a1aa --- /dev/null +++ b/examples/v2/test-examples/ListTestExamples.go @@ -0,0 +1,29 @@ +// List test examples returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewTestExamplesApi(apiClient) + resp, r, err := api.ListTestExamples(ctx) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestExamplesApi.ListTestExamples`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `TestExamplesApi.ListTestExamples`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index d6aceaa17ce..3c7c209fe1d 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -71,6 +71,7 @@ var apiMappings = map[string]map[string]reflect.Value{ "SecurityMonitoringApi": reflect.ValueOf(datadogV2.NewSecurityMonitoringApi), "StorageManagementApi": reflect.ValueOf(datadogV2.NewStorageManagementApi), "CodeCoverageApi": reflect.ValueOf(datadogV2.NewCodeCoverageApi), + "ComplianceApi": reflect.ValueOf(datadogV2.NewComplianceApi), "ContainerImagesApi": reflect.ValueOf(datadogV2.NewContainerImagesApi), "ContainersApi": reflect.ValueOf(datadogV2.NewContainersApi), "CloudCostManagementApi": reflect.ValueOf(datadogV2.NewCloudCostManagementApi), @@ -79,13 +80,13 @@ var apiMappings = map[string]map[string]reflect.Value{ "CSMCoverageAnalysisApi": reflect.ValueOf(datadogV2.NewCSMCoverageAnalysisApi), "DashboardListsApi": reflect.ValueOf(datadogV2.NewDashboardListsApi), "DashboardSecureEmbedApi": reflect.ValueOf(datadogV2.NewDashboardSecureEmbedApi), + "DashboardsApi": reflect.ValueOf(datadogV2.NewDashboardsApi), "DatasetsApi": reflect.ValueOf(datadogV2.NewDatasetsApi), "DataDeletionApi": reflect.ValueOf(datadogV2.NewDataDeletionApi), "DeploymentGatesApi": reflect.ValueOf(datadogV2.NewDeploymentGatesApi), "DomainAllowlistApi": reflect.ValueOf(datadogV2.NewDomainAllowlistApi), "DORAMetricsApi": reflect.ValueOf(datadogV2.NewDORAMetricsApi), "DowntimesApi": reflect.ValueOf(datadogV2.NewDowntimesApi), - "EmailTransportApi": reflect.ValueOf(datadogV2.NewEmailTransportApi), "ErrorTrackingApi": reflect.ValueOf(datadogV2.NewErrorTrackingApi), "EventsApi": reflect.ValueOf(datadogV2.NewEventsApi), "FeatureFlagsApi": reflect.ValueOf(datadogV2.NewFeatureFlagsApi), @@ -112,6 +113,7 @@ var apiMappings = map[string]map[string]reflect.Value{ "LogsMetricsApi": reflect.ValueOf(datadogV2.NewLogsMetricsApi), "LogsRestrictionQueriesApi": reflect.ValueOf(datadogV2.NewLogsRestrictionQueriesApi), "MetricsApi": reflect.ValueOf(datadogV2.NewMetricsApi), + "ModelLabAPIApi": reflect.ValueOf(datadogV2.NewModelLabAPIApi), "MonitorsApi": reflect.ValueOf(datadogV2.NewMonitorsApi), "NetworkDeviceMonitoringApi": reflect.ValueOf(datadogV2.NewNetworkDeviceMonitoringApi), "CloudNetworkMonitoringApi": reflect.ValueOf(datadogV2.NewCloudNetworkMonitoringApi), @@ -151,6 +153,7 @@ var apiMappings = map[string]map[string]reflect.Value{ "StatusPagesApi": reflect.ValueOf(datadogV2.NewStatusPagesApi), "SyntheticsApi": reflect.ValueOf(datadogV2.NewSyntheticsApi), "TeamsApi": reflect.ValueOf(datadogV2.NewTeamsApi), + "TestExamplesApi": reflect.ValueOf(datadogV2.NewTestExamplesApi), "WebIntegrationsApi": reflect.ValueOf(datadogV2.NewWebIntegrationsApi), "WidgetsApi": reflect.ValueOf(datadogV2.NewWidgetsApi), "WorkflowAutomationApi": reflect.ValueOf(datadogV2.NewWorkflowAutomationApi), diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.freeze new file mode 100644 index 00000000000..1665e973daf --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-14T10:58:54.153Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.yaml new file mode 100644 index 00000000000..72fdd7d8c35 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Monitors/Scenario_Create_a_Data_Jobs_monitor_returns_OK_response.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: | + {"message":"Data jobs alert triggered","name":"Test-Create_a_Data_Jobs_monitor_returns_OK_response-1778756334","options":{"thresholds":{"critical":0},"variables":[{"job_type":"databricks.job","jobs_query":"job_name:*","name":"run_query","query_dialect":"metric"}]},"query":"formula(\"failed_runs(run_query)\").by(job_name,workspace_name).last(10d) \u003e 0","tags":["test:testcreateadatajobsmonitorreturnsokresponse1778756334","env:ci"],"type":"data-jobs alert"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/monitor + response: + body: '{"id":283063470,"org_id":321813,"type":"data-jobs alert","name":"Test-Create_a_Data_Jobs_monitor_returns_OK_response-1778756334","message":"Data + jobs alert triggered","tags":["test:testcreateadatajobsmonitorreturnsokresponse1778756334","env:ci"],"query":"formula(\"failed_runs(run_query)\").by(job_name,workspace_name).last(10d) + > 0","options":{"thresholds":{"critical":0.0},"variables":[{"job_type":"databricks.job","jobs_query":"job_name:*","name":"run_query","query_dialect":"metric"}],"notify_no_data":false,"notify_audit":false,"new_host_delay":300,"include_tags":true,"silenced":{}},"multi":true,"created_at":1778756334000,"created":"2026-05-14T10:58:54.236230+00:00","modified":"2026-05-14T10:58:54.236230+00:00","deleted":null,"priority":null,"restricted_roles":null,"restriction_policy":null,"draft_status":"published","assets":[],"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v1/monitor/283063470 + response: + body: '{"deleted_monitor_id":283063470} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.freeze new file mode 100644 index 00000000000..214d2620f7d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.freeze @@ -0,0 +1 @@ +2026-05-19T16:45:21.251Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.yaml new file mode 100644 index 00000000000..4fd75b1010f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_MCP_steps_returns_OK_-_Returns_the_created_test_details._response.yaml @@ -0,0 +1,49 @@ +interactions: +- request: + body: | + {"config":{"steps":[{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"type":"mcpRespectsSpecification"},{"operator":"contains","target":["tools"],"type":"mcpServerCapabilities"}],"isCritical":true,"name":"Initialize MCP session","request":{"callType":"init","headers":{"DD-API-KEY":"\u003cYOUR-API-KEY\u003e","DD-APPLICATION-KEY":"\u003cYOUR-APP-KEY\u003e"},"mcpProtocolVersion":"2025-06-18","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"moreThan","target":0,"type":"mcpToolCount"},{"operator":"lessThan","target":64,"type":"mcpToolNameLength"},{"type":"mcpRespectsSpecification"}],"isCritical":true,"name":"List MCP tools","request":{"callType":"tool_list","headers":{"DD-API-KEY":"\u003cYOUR-API-KEY\u003e","DD-APPLICATION-KEY":"\u003cYOUR-APP-KEY\u003e"},"mcpProtocolVersion":"2025-06-18","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"lessThan","target":5000,"type":"responseTime"},{"type":"mcpRespectsSpecification"}],"isCritical":true,"name":"Call MCP search tool","request":{"callType":"tool_call","headers":{"DD-API-KEY":"\u003cYOUR-API-KEY\u003e","DD-APPLICATION-KEY":"\u003cYOUR-APP-KEY\u003e"},"mcpProtocolVersion":"2025-06-18","toolArgs":{"limit":5,"query":"datadog synthetics"},"toolName":"search","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_mcp_payload.json","name":"Test-Create_an_API_test_with_MCP_steps_returns_OK_Returns_the_created_test_details_response-1779209121","options":{"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_MCP_steps_returns_OK_Returns_the_created_test_details_response-1779209121","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":900},"subtype":"multi","tags":["testing:api"],"type":"api"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: '{"public_id":"htz-sbz-vuw","name":"Test-Create_an_API_test_with_MCP_steps_returns_OK_Returns_the_created_test_details_response-1779209121","status":"live","type":"api","subtype":"multi","tags":["testing:api"],"created_at":"2026-05-19T16:45:22.077574+00:00","modified_at":"2026-05-19T16:45:22.077574+00:00","config":{"steps":[{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"type":"mcpRespectsSpecification"},{"operator":"contains","target":["tools"],"type":"mcpServerCapabilities"}],"isCritical":true,"name":"Initialize + MCP session","request":{"callType":"init","headers":{"DD-API-KEY":"","DD-APPLICATION-KEY":""},"mcpProtocolVersion":"2025-06-18","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp","id":"3qn-99h-nhn"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"moreThan","target":0,"type":"mcpToolCount"},{"operator":"lessThan","target":64,"type":"mcpToolNameLength"},{"type":"mcpRespectsSpecification"}],"isCritical":true,"name":"List + MCP tools","request":{"callType":"tool_list","headers":{"DD-API-KEY":"","DD-APPLICATION-KEY":""},"mcpProtocolVersion":"2025-06-18","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp","id":"4xh-7i6-xda"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"lessThan","target":5000,"type":"responseTime"},{"type":"mcpRespectsSpecification"}],"isCritical":true,"name":"Call + MCP search tool","request":{"callType":"tool_call","headers":{"DD-API-KEY":"","DD-APPLICATION-KEY":""},"mcpProtocolVersion":"2025-06-18","toolArgs":{"limit":5,"query":"datadog + synthetics"},"toolName":"search","url":"https://example.org/mcp"},"retry":{"count":0,"interval":300},"subtype":"mcp","id":"38v-zrk-3th"}]},"message":"BDD + test payload: synthetics_api_test_mcp_payload.json","options":{"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_MCP_steps_returns_OK_Returns_the_created_test_details_response-1779209121","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":900,"bits_ai_auto_investigate":false},"locations":["aws:us-east-2"],"created_by":{"name":"frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":284930680,"org_id":321813,"modified_by":{"name":"frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"public_ids":["htz-sbz-vuw"]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: POST + url: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: '{"deleted_tests":[{"public_id":"htz-sbz-vuw","deleted_at":"2026-05-19T16:45:22.518455+00:00"}]} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..3630c84dd5b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:47.462Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..1e94fa38172 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_Publish_Request_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"description":"Adds new dashboard widgets and a few bug fixes.","title":"Release v1.2 to production"},"type":"publishRequest"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/publish-request + response: + body: '{"errors":[{"status":"404","id":"c9247d40-2291-4860-90ac-9c2441ff23db","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..d0257e0632b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T17:39:16.852Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..4443dca6d7c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprint_returns_Not_Found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/blueprint/00000000-0000-0000-0000-000000000001 + response: + body: '{"errors":[{"status":"404","id":"75010b80-a44e-47bd-b903-e38f79efce20","title":"blueprint + not found","detail":"blueprint with id 00000000-0000-0000-0000-000000000001 + not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.freeze new file mode 100644 index 00000000000..0f3a3af5e16 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T17:39:17.553Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.yaml new file mode 100644 index 00000000000..82fbf63896c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Integration_ID_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/blueprints/integration-id/aws + response: + body: '{"data":[]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.freeze new file mode 100644 index 00000000000..4d6bba7034f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T17:39:18.076Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.yaml new file mode 100644 index 00000000000..2871e6912d9 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_Blueprints_by_Slugs_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/blueprints/slugs/aws-service-manager + response: + body: '{"data":[]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..25a432b084d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:53.216Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..ddfad689246 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_Not_Found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/versions + response: + body: '{"errors":[{"status":"404","id":"4dfd53b4-6987-4868-b330-af0535219c61","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.freeze new file mode 100644 index 00000000000..f134f190413 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:53.386Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.yaml new file mode 100644 index 00000000000..c6395fc42e3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_App_Versions_returns_OK_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"d928ecbc-acfe-4126-96f6-092fa0a01416","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/d928ecbc-acfe-4126-96f6-092fa0a01416/versions + response: + body: '{"data": [{"id": "98cd3a5a-644d-41fd-8ffa-e58e21e8e21b", "type": "appVersions", + "attributes": {"app_id": "d928ecbc-acfe-4126-96f6-092fa0a01416", "created_at": + "2026-05-18T19:51:53.59976Z", "has_ever_been_published": false, "updated_at": + "2026-05-18T19:51:53.59976Z", "user_id": 1445416, "user_name": "", "user_uuid": + "3ad549bf-eba0-11e9-a77a-0705486660d0", "version": 1}}], "meta": {"page": {"totalCount": + 1, "totalFilteredCount": 0}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/d928ecbc-acfe-4126-96f6-092fa0a01416 + response: + body: '{"data": {"id": "d928ecbc-acfe-4126-96f6-092fa0a01416", "type": "appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.freeze new file mode 100644 index 00000000000..bf22ce4bbc0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T17:39:19.135Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.yaml new file mode 100644 index 00000000000..cf2d06f5634 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Blueprints_returns_OK_response.yaml @@ -0,0 +1,326 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/blueprints + response: + body: "{\"data\":[{\"id\":\"faeef8bc-d9eb-43a1-b829-71782380279d\",\"type\":\"\ + blueprint\",\"attributes\":{\"created_at\":\"2025-08-18T16:20:42.182618Z\",\"\ + description\":\"Manage AWS Services from a single unified interface.\",\"name\"\ + :\"AWS Service Management Console\",\"slug\":\"aws_service_management_console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.organizations.listAccounts\",\"updated_at\":\"2026-05-18T17:02:03.016145Z\"\ + }},{\"id\":\"b2ba39de-d111-4940-b600-df6bb52661dc\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-08-15T00:00:19.017104Z\",\"description\"\ + :\"Manage projects, merge requests, commits, pipelines, jobs, branches, and\ + \ deployments all from a unified interface within Datadog.\",\"name\":\"GitLab\ + \ Manager\",\"slug\":\"gitlab_manager\",\"tags\":[\"software_delivery\"],\"\ + tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.gitlab.projects.listProjects\"\ + ,\"updated_at\":\"2026-05-18T17:01:20.81581Z\"}},{\"id\":\"398529ec-6c34-4e6d-bccf-5a34be7e6e1c\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-10-15T19:11:36.098607Z\"\ + ,\"description\":\"Unifying Jira, Confluence, GitHub, and Datadog Incidents\ + \ to highlight team and developer contribution with AI summaries.\",\"name\"\ + :\"Development Insights\",\"slug\":\"development-insights\",\"tags\":[\"datadog\"\ + ,\"uses_ai\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.dd.apps_datastore.getDatastoreItem\",\"updated_at\":\"2026-05-18T17:02:03.557012Z\"\ + }},{\"id\":\"1a9239ca-1d11-48c0-ad23-0f8ca00cd321\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-10-08T17:07:54.77105Z\",\"description\"\ + :\"Unified device visibility. Smarter investigations\",\"name\":\"Asset Investigation\ + \ App\",\"slug\":\"asset-intel-app\",\"tags\":[\"datadog\",\"uses_ai\"],\"tile_background\"\ + :\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.apps_datastore.listDatastoreItems\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.371529Z\"}},{\"id\":\"d190e5cd-412c-4857-9993-6e98a478a64e\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-30T18:02:02.519433Z\"\ + ,\"description\":\"Manage Okta users, groups, and roles directly from Datadog\ + \ in a secure, unified interface.\",\"name\":\"Manage Okta Users, Groups, and\ + \ Roles\",\"slug\":\"manage-okta-user-groups-roles\",\"tags\":[\"security\"\ + ],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.okta.add_user_to_group\"\ + ,\"updated_at\":\"2026-05-18T17:02:15.156458Z\"}},{\"id\":\"11feb11b-85d9-4e89-9f5c-0c96c04da5bc\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-30T18:02:02.176559Z\"\ + ,\"description\":\"Scaffolder app can be used for creating new software components\ + \ from template repositories. It takes inputs from developers and generates\ + \ a new repository or a PR based on the provided data and the template.\",\"\ + name\":\"Scaffold New Project in GitHub\",\"slug\":\"scaffold-new-project-in-github\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\",\"\ + tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\",\"updated_at\"\ + :\"2026-05-18T17:02:09.340524Z\"}},{\"id\":\"6c5b24ef-c303-42ec-a305-351f5a1026cf\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.381741Z\"\ + ,\"description\":\"Monitor Kubernetes resources, restart deployments, delete\ + \ pods, and create tickets or incidents\",\"name\":\"Manage Kubernetes Deployments\"\ + ,\"slug\":\"manage-kubernetes-deployments\",\"tags\":[\"kubernetes\",\"private_action\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.kubernetes.apps.listDeployment\"\ + ,\"updated_at\":\"2026-05-18T17:01:26.003985Z\"}},{\"id\":\"dd0adb73-dd5f-4cb5-a22d-41946755958e\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.261927Z\"\ + ,\"description\":\"Stop RDS clusters \\u0026 instances and reduce your cost\"\ + ,\"name\":\"Manage RDS Clusters \\u0026 Instances\",\"slug\":\"rds_console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"\ + com.datadoghq.aws.rds.list_db_instances\",\"updated_at\":\"2026-05-18T17:02:04.353815Z\"\ + }},{\"id\":\"8750a7cb-f076-474f-9f66-8d3f7c02ad3f\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-08T15:16:02.674864Z\",\"description\"\ + :\"Analyze your metrics in Datadog and create threshold alert monitors\",\"\ + name\":\"Explore Metrics \\u0026 Create Monitors\",\"slug\":\"datadog_metrics_and_monitors\"\ + ,\"tags\":[\"datadog\"],\"tile_background\":\"bento-box-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.dd.metrics.listMetrics\",\"updated_at\":\"2026-05-18T17:02:03.452603Z\"\ + }},{\"id\":\"17127e2b-ea85-4c3a-ba3e-0f1dfa0c941a\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-30T21:11:28.731422Z\",\"description\"\ + :\"Fill out the form to generate the terraform for a new S3 bucket in Github\"\ + ,\"name\":\"Create S3 Bucket with a Terraform PR\",\"slug\":\"create-new-s3-bucket-terraform-pr\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\",\"\ + tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\",\"updated_at\"\ + :\"2026-05-18T17:02:09.266218Z\"}},{\"id\":\"dc4075af-5e50-402f-abb2-6041db59d378\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.759103Z\"\ + ,\"description\":\"View open pull requests from your team in a table with an\ + \ AI-generated summary of the progress.\",\"name\":\"GitHub PR Summarizer\"\ + ,\"slug\":\"github-pr-summarizer\",\"tags\":[\"uses_ai\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\"\ + ,\"updated_at\":\"2026-05-18T17:02:09.306954Z\"}},{\"id\":\"dc1bcad2-1eb7-456f-a32b-60e8ad7adf71\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.010916Z\"\ + ,\"description\":\"Start, stop or reboot your AWS EC2 instances\",\"name\":\"\ + Manage EC2 Instances\",\"slug\":\"ec2_instance_manager\",\"tags\":[\"aws\"],\"\ + tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.ec2.describe_ec2_instances\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.602628Z\"}},{\"id\":\"8d6b6284-10ba-42d0-829c-800e7c396a3b\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T08:38:29.623958Z\"\ + ,\"description\":\"Peek, purge or redrive SQS queues\",\"name\":\"Manage SQS\ + \ Queues\",\"slug\":\"sqs-queue-manager\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"bento-box-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.sqs.list_queues_with_attributes\"\ + ,\"updated_at\":\"2026-05-18T17:02:02.47498Z\"}},{\"id\":\"be6d5e27-a5a8-406a-9b0c-b779f6a94728\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.237126Z\"\ + ,\"description\":\"Create, view, or toggle on or off LaunchDarkly feature flags\"\ + ,\"name\":\"LaunchDarkly Feature Flag Manager\",\"slug\":\"launchdarkly_feature_flag_manager\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"bento-box-table\",\"\ + tile_icon_action_fqn\":\"com.datadoghq.launchdarkly.listProjects\",\"updated_at\"\ + :\"2026-05-18T17:01:49.464175Z\"}},{\"id\":\"7566d028-b111-47a8-8ee2-b42efbd95edb\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.058949Z\"\ + ,\"description\":\"View, retry, or cancel deployments in Gitlab\",\"name\":\"\ + Manage Gitlab Deployments\",\"slug\":\"gitlab-deployment-manager\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.gitlab.getProjectDeployments\",\"updated_at\":\"2026-05-18T17:01:20.761242Z\"\ + }},{\"id\":\"dddf3b1a-47a4-400a-8485-321ad58f2779\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-30T08:38:30.229357Z\",\"description\"\ + :\"Create, view, and manage incidents in ServiceNow\",\"name\":\"Manage ServiceNow\ + \ Incidents\",\"slug\":\"servicenow_incident_manager\",\"tags\":[\"paging\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.servicenow.listIncidents\"\ + ,\"updated_at\":\"2026-05-18T17:02:17.797196Z\"}},{\"id\":\"df97f5ff-0ce8-4def-b1fb-151b427fc82d\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-09T16:50:07.302357Z\"\ + ,\"description\":\"Personalized developer homepage to prioritize tasks across\ + \ tools\",\"name\":\"Developer Homepage\",\"slug\":\"developer-homepage\",\"\ + tags\":[\"datadog\",\"uses_ai\"],\"tile_background\":\"one-callout-table\",\"\ + tile_icon_action_fqn\":\"com.datadoghq.dd.service_catalog.getServicePagerdutyOncall\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.484343Z\"}},{\"id\":\"f290ac0f-ded8-4143-bb94-3dbe20f883d5\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-05T19:50:19.410003Z\"\ + ,\"description\":\"Explore mobile user sessions, using Luciq's observability\ + \ tools\",\"name\":\"Explore Luciq Sessions\",\"slug\":\"instabug-sessions-explorer\"\ + ,\"tags\":[\"observability\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.http.request\",\"updated_at\":\"2026-05-18T17:01:48.606352Z\"\ + }},{\"id\":\"a7041749-fb41-451b-880f-10eddcdbbe1c\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-05-02T20:27:48.306432Z\",\"description\"\ + :\"View incidents across pages, update them, follow past updates, and create\ + \ new incidents on Statuspage \u2014 all directly from Datadog.\",\"name\":\"\ + Manage Statuspage Incidents\",\"slug\":\"manage-statuspage-incidents\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.statuspage.updateComponentStatus\",\"updated_at\":\"2026-05-18T17:02:18.402711Z\"\ + }},{\"id\":\"8839570e-1711-43e8-86f2-679f5ae0f8f9\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-30T21:11:28.769943Z\",\"description\"\ + :\"Complete the form to provision a new EKS Cluster using Terraform\",\"name\"\ + :\"Provision EKS Cluster\",\"slug\":\"provision-eks-cluster\",\"tags\":[\"software_delivery\"\ + ],\"tile_background\":\"table-with-modal\",\"tile_icon_action_fqn\":\"com.datadoghq.github.createOrUpdateFile\"\ + ,\"updated_at\":\"2026-05-18T17:02:09.329157Z\"}},{\"id\":\"7f3fb131-0ff5-48d9-a997-87f99ef8b364\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.764126Z\"\ + ,\"description\":\"Select a service and trigger a restart in Github Workflows\"\ + ,\"name\":\"Restart Service With Github Actions\",\"slug\":\"github_actions_restart_service\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.github.actions.triggerWorkflowRun\",\"updated_at\":\"2026-05-18T17:02:09.318622Z\"\ + }},{\"id\":\"39ff9db2-aeed-4552-8080-d6a13fbfad74\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-29T18:37:39.278756Z\",\"description\"\ + :\"Create a new RDS DB instance from a form\",\"name\":\"Provision RDS Instance\"\ + ,\"slug\":\"rds_provision_instance\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.rds.createRdsDbInstance\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.37742Z\"}},{\"id\":\"0b110831-0834-4898-84dc-292153807df1\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.21136Z\"\ + ,\"description\":\"View and manage Jira tickets by board, status, or sprint\"\ + ,\"name\":\"Manage Jira Tickets\",\"slug\":\"jira-ticket-manager\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.jira.create_issue\",\"updated_at\":\"2026-05-18T17:02:04.247226Z\"\ + }},{\"id\":\"111cc4d5-1fdf-47aa-8bb1-25cc8ac7dff2\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-29T18:37:39.286928Z\",\"description\"\ + :\"Explore S3 files and view their content\",\"name\":\"Explore S3 Files\",\"\ + slug\":\"s3_file_explorer\",\"tags\":[\"aws\"],\"tile_background\":\"bento-box-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.aws.s3.list_s3_buckets\",\"updated_at\"\ + :\"2026-05-18T17:02:02.170177Z\"}},{\"id\":\"773fce74-eec7-4170-a222-53e24261f812\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.307523Z\"\ + ,\"description\":\"Fill out the form to generate the terraform for new monitors\ + \ for a service.\",\"name\":\"Create Monitors for New Service\",\"slug\":\"\ + service-monitor-creation\",\"tags\":[\"datadog\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.dd.service_catalog.listServiceDefinitions\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.388154Z\"}},{\"id\":\"b899cebf-0b56-4e6e-89c8-01afdb19e781\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.742329Z\"\ + ,\"description\":\"View opened, closed, and assigned pull requests to a specific\ + \ user\",\"name\":\"Github PR Pipeline\",\"slug\":\"github-pr-dashboard\",\"\ + tags\":[\"software_delivery\"],\"tile_background\":\"two-input-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.github.searchRepositories\",\"updated_at\":\"2026-05-18T17:02:09.287376Z\"\ + }},{\"id\":\"635fc8c5-0330-40e6-a859-b8fc3d76e331\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-05-02T20:27:46.466284Z\",\"description\"\ + :\"Monitor the status of PagerDuty services and trigger incidents when needed\"\ + ,\"name\":\"Manage PagerDuty Services\",\"slug\":\"pagerduty_service_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.listServices\",\"updated_at\":\"2026-05-18T17:02:15.911013Z\"\ + }},{\"id\":\"8ada5164-b533-462e-80db-47e7d0fbed0d\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-28T21:17:42.02843Z\",\"description\"\ + :\"Select from your clusters and services, and easily scale tasks up or down\"\ + ,\"name\":\"Manage ECS Tasks\",\"slug\":\"ecs_task_manager\",\"tags\":[\"aws\"\ + ],\"tile_background\":\"three-callout-prompt\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.ecs.listEcsClusters\"\ + ,\"updated_at\":\"2026-05-18T17:02:00.300159Z\"}},{\"id\":\"e2f2ff93-709c-4eae-95ab-cbc0f2bc87f0\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-23T19:08:48.624684Z\"\ + ,\"description\":\"List, explore details and re-run lambda functions\",\"name\"\ + :\"Manage Lambda Functions\",\"slug\":\"lambda-function-manager\",\"tags\":[\"\ + aws\"],\"tile_background\":\"table-with-modal\",\"tile_icon_action_fqn\":\"\ + com.datadoghq.aws.lambda.listAWSLambdaFunction\",\"updated_at\":\"2026-05-18T17:02:01.047167Z\"\ + }},{\"id\":\"07f8536d-6342-4f30-8254-0c7b019707f0\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-30T08:38:30.332498Z\",\"description\"\ + :\"Manage and update Statuspage components across pages.\",\"name\":\"Manage\ + \ Statuspage Components\",\"slug\":\"statuspage-component-manager\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.statuspage.listIncidents\",\"updated_at\":\"2026-05-18T17:02:18.425899Z\"\ + }},{\"id\":\"53d32e20-034c-4d46-ad54-f71f83ae7850\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-05-02T20:27:47.563531Z\",\"description\"\ + :\"Manage, update or delete your AWS EKS clusters\",\"name\":\"Manage AWS EKS\"\ + ,\"slug\":\"manage-aws-eks\",\"tags\":[\"aws\"],\"tile_background\":\"one-callout-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.aws.eks.updateClusterConfig\",\"updated_at\"\ + :\"2026-05-18T17:02:04.264646Z\"}},{\"id\":\"8b8aa818-4ed3-40f5-b6ca-dd891c75f317\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.449263Z\"\ + ,\"description\":\"Trigger, acknowledge and resolve incidents from PagerDuty.\"\ + ,\"name\":\"Manage PagerDuty Incidents\",\"slug\":\"pagerduty_incident_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.resolve_incident\",\"updated_at\":\"2026-05-18T17:02:15.703635Z\"\ + }},{\"id\":\"d4eac482-3518-412b-8424-31935f6fc1b6\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-29T18:37:39.247502Z\",\"description\"\ + :\"Enter a prompt to find the most likely causes of your regression\",\"name\"\ + :\"Find PR Regressions\",\"slug\":\"pr_regression_finder\",\"tags\":[\"uses_ai\"\ + ],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.openai.generateText\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.329232Z\"}},{\"id\":\"5a617cdf-6d0c-4fc5-a26f-e123e37e1438\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:47.572068Z\"\ + ,\"description\":\"List a Datastore in your app and manage its CRUD (Create,\ + \ Read, Update, Delete) operations directly from App Builder.\",\"name\":\"\ + Manage Datastore\",\"slug\":\"manage-datastore\",\"tags\":[\"datadog\"],\"tile_background\"\ + :\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.apps_datastore.bulkPutDatastoreItem\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.277122Z\"}},{\"id\":\"8caf15ac-f175-4b46-b867-dfbd73f5d1ba\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.237759Z\"\ + ,\"description\":\"Track on-call engineers across different teams and services,\ + \ and create incidents in OpsGenie\",\"name\":\"Manage OpsGenie On-call\",\"\ + slug\":\"manage-ops-genie-on-call\",\"tags\":[\"paging\"],\"tile_background\"\ + :\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.opsgenie.createIncident\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.302057Z\"}},{\"id\":\"88a2c35b-31f4-4420-b6a0-f3da6a1fd740\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-14T02:00:39.687547Z\"\ + ,\"description\":\"Create new S3 buckets directly in AWS.\",\"name\":\"Create\ + \ S3 Bucket\",\"slug\":\"create-new-s3-bucket\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.s3.create_s3_bucket\"\ + ,\"updated_at\":\"2026-05-18T17:02:02.159767Z\"}},{\"id\":\"eef5812e-45ef-47a4-9570-4c6b7a11bc4f\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.692089Z\"\ + ,\"description\":\"Prompt OpenAI and get responses from a text inputs\",\"name\"\ + :\"Prompt OpenAI\",\"slug\":\"openai-prompter\",\"tags\":[\"uses_ai\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.openai.generateText\",\"\ + updated_at\":\"2026-05-18T17:01:29.850296Z\"}},{\"id\":\"f333c674-1010-4bf6-9b7b-215f6c88f878\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.458292Z\"\ + ,\"description\":\"Track on-call engineers across different teams and services\"\ + ,\"name\":\"Manage PagerDuty On-call\",\"slug\":\"pagerduty_oncall_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"people-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.listServices\",\"updated_at\":\"2026-05-18T17:02:15.724318Z\"\ + }},{\"id\":\"5761abf4-771d-42e6-9898-5eae6465e94c\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-29T18:37:39.317021Z\",\"description\"\ + :\"Manage, start, restart, and stop your Azure Web Apps\",\"name\":\"Manage\ + \ Azure Web Apps\",\"slug\":\"manage-azure-web-apps\",\"tags\":[\"azure\"],\"\ + tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.azure.apps.restartWebApp\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.40436Z\"}},{\"id\":\"858a49c0-7781-46ef-b4e0-7fc7c96a311b\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-23T19:08:48.677682Z\"\ + ,\"description\":\"View state machines and stop, start or pause their associated\ + \ executions\",\"name\":\"Manage Step Functions\",\"slug\":\"step-functions-console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"table-with-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.stepfunctions.listStateMachines\",\"updated_at\":\"2026-05-18T17:02:02.699196Z\"\ + }},{\"id\":\"4c19fab0-3269-46e4-a2dd-365ba5bb2619\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-28T21:17:42.057615Z\",\"description\"\ + :\"List, start, restart, power off and deallocate your VMs\",\"name\":\"Manage\ + \ Azure Virtual Machines\",\"slug\":\"azure_vms_management_console\",\"tags\"\ + :[\"azure\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.azure.vm.listSubscriptionVirtualMachines\",\"updated_at\":\"\ + 2026-05-18T17:02:06.221711Z\"}},{\"id\":\"a276b5f5-c6c0-4329-af64-d630d25593dc\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.000627Z\"\ + ,\"description\":\"View DynamoDB table status and perform CRUD operations\"\ + ,\"name\":\"Manage DynamoDB\",\"slug\":\"dynamodb_console\",\"tags\":[\"aws\"\ + ],\"tile_background\":\"bento-box-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.dynamodb.describe_table\"\ + ,\"updated_at\":\"2026-05-18T17:02:00.038636Z\"}},{\"id\":\"cc9872f6-9a15-454e-8f02-beec66ce1bde\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.039633Z\"\ + ,\"description\":\"Rebuild or restart Elastic Beanstalk applications\",\"name\"\ + :\"Manage Elastic Beanstalk Apps\",\"slug\":\"elastic_beanstalk_console\",\"\ + tags\":[\"aws\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.elasticbeanstalk.listApplications\",\"updated_at\":\"2026-05-18T17:02:03.613799Z\"\ + }},{\"id\":\"84c7ba6f-d69b-4e7c-aa0b-56ba9022ff50\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-05-05T19:50:21.700674Z\",\"description\"\ + :\"List, start or stop your Compute Engine instances\",\"name\":\"Manage Google\ + \ Cloud Compute\",\"slug\":\"gcp-cloud-compute-management-console\",\"tags\"\ + :[\"gcp\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.gcp.compute.listInstances\",\"updated_at\":\"2026-05-18T17:02:11.166133Z\"\ + }},{\"id\":\"e426403a-5d30-49d2-abed-d2372e8c7744\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-05-02T20:27:46.472898Z\",\"description\"\ + :\"Select a service \\u0026 trigger an incident\",\"name\":\"Trigger Incident\ + \ in Pagerduty\",\"slug\":\"pagerduty_trigger_incident\",\"tags\":[\"paging\"\ + ,\"datadog\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.pagerduty.trigger_incident\"\ + ,\"updated_at\":\"2026-05-18T17:02:15.92158Z\"}},{\"id\":\"e6b74e1f-7f36-49b4-abfe-7c9ebf067ff2\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-08T20:09:58.363312Z\"\ + ,\"description\":\"View autoscaling group capacity and trigger a change\",\"\ + name\":\"Manage AWS Autoscaling Groups\",\"slug\":\"aws_autoscaling_groups\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"three-callout-prompt\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.autoscaling.describe_auto_scaling_group\",\"updated_at\"\ + :\"2026-05-18T17:02:03.420659Z\"}},{\"id\":\"9913dec9-e949-45e6-908a-587ffb823a0c\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:47.592154Z\"\ + ,\"description\":\"Renew, describe, delete and request private and public certificates\"\ + ,\"name\":\"Manage AWS Certificates\",\"slug\":\"manage-aws-certificates\",\"\ + tags\":[\"aws\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.acm.requestPublicCertificate\",\"updated_at\":\"2026-05-18T17:02:04.316282Z\"\ + }},{\"id\":\"d837c301-edcd-48fb-8250-a4e9fb9add11\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-04-29T18:37:39.200777Z\",\"description\"\ + :\"Create new tickets in Jira\",\"name\":\"Create Jira Ticket\",\"slug\":\"\ + jira-ticket-creator\",\"tags\":[\"software_delivery\"],\"tile_background\":\"\ + table\",\"tile_icon_action_fqn\":\"com.datadoghq.jira.create_issue\",\"updated_at\"\ + :\"2026-05-18T17:02:04.229225Z\"}},{\"id\":\"25bc3ad1-724c-4750-9bc2-112a59e76b6a\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-08-22T01:16:30.733428Z\"\ + ,\"description\":\"Use this form to create a new entity definition YAML in Github.\"\ + ,\"name\":\"Create Catalog Entity Definition\",\"slug\":\"create_catalog_entity_definition\"\ + ,\"tags\":[\"datadog\",\"software_delivery\"],\"tile_background\":\"people-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.createOrUpdateFile\",\"updated_at\"\ + :\"2026-05-18T17:02:03.431113Z\"}},{\"id\":\"7d2e21d5-1e1f-4abc-aebb-880ef86882f5\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-21T00:43:24.42963Z\"\ + ,\"description\":\"How to add bar charts to apps\",\"name\":\"How To: Bar Charts\"\ + ,\"slug\":\"how_to__bar_charts\",\"tags\":[\"datadog\",\"howTo\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.teams.listTeams\",\"\ + updated_at\":\"2026-05-18T17:02:03.801347Z\"}},{\"id\":\"6bf5671b-3195-4ea5-b3fe-eba97d25b26a\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-02T16:43:02.148346Z\"\ + ,\"description\":\"Scaffolder app is used to create new software components\ + \ from template repositories. It takes inputs from developers and generates\ + \ a new repository or a PR based on the provided data and the template.\",\"\ + name\":\"Scaffold New Project in GitLab\",\"slug\":\"scaffold-new-project-in-gitlab\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\",\"\ + tile_icon_action_fqn\":\"com.datadoghq.gitlab.getProjectDeployments\",\"updated_at\"\ + :\"2026-05-18T17:01:20.860684Z\"}},{\"id\":\"f5998cda-c054-48d9-9e88-ae37ab1990cb\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-18T16:51:32.667124Z\"\ + ,\"description\":\"See how to make form fields dynamic and dependent on other\ + \ fields.\",\"name\":\"How to: Form With Dynamic Fields\",\"slug\":\"how_to__form_with_dynamic_fields\"\ + ,\"tags\":[\"howTo\"],\"tile_background\":\"people-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.github.createOrUpdateFile\",\"updated_at\":\"2026-05-18T17:02:03.923635Z\"\ + }},{\"id\":\"6e27f913-7170-4977-b2b1-243015b9fafd\",\"type\":\"blueprint\",\"\ + attributes\":{\"created_at\":\"2025-07-17T23:29:17.423877Z\",\"description\"\ + :\"How to persist your app in a datastore using CRUD (Create, Read, Update,\ + \ Delete) operations\",\"name\":\"How To: Persist Data in Datastore\",\"slug\"\ + :\"how_to__persist_data_in_datastore_using_crud\",\"tags\":[\"datadog\",\"howTo\"\ + ],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.apps_datastore.listDatastoreItems\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.018585Z\"}}]}" + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.freeze new file mode 100644 index 00000000000..0b99c48bf67 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T17:39:19.668Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.yaml new file mode 100644 index 00000000000..6acc5bc668a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Tags_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/tags + response: + body: '{"data":[]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.freeze new file mode 100644 index 00000000000..b224652513e --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:55.262Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.yaml new file mode 100644 index 00000000000..8f12ccd8e4c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_No_Content_response.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"850d5920-6bfb-4723-a3ff-91bfb2d898d8","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"v1.2.0 - bug fix release"},"type":"versionNames"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/850d5920-6bfb-4723-a3ff-91bfb2d898d8/version-name?version=latest + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/850d5920-6bfb-4723-a3ff-91bfb2d898d8 + response: + body: '{"data":{"id":"850d5920-6bfb-4723-a3ff-91bfb2d898d8","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..f304ca2f684 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:56.300Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..12a103134b6 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Name_App_Version_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"name":"v1.2.0 - bug fix release"},"type":"versionNames"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 0 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/version-name?version=latest + response: + body: '{"errors":[{"status":"404","id":"16fc993f-2445-4b88-b1e7-c924feed5141","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..b8cdcb67d8c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:58.197Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..f409467746f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Revert_App_returns_Not_Found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/revert?version=1 + response: + body: '{"errors":[{"status":"404","id":"09483925-ee8b-44c8-882a-35b53e209584","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.freeze new file mode 100644 index 00000000000..632a7af485a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:51:59.539Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.yaml new file mode 100644 index 00000000000..9e4da1d50df --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_No_Content_response.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"ff20368e-cb9a-4216-aa76-a61c11aef6d1","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"favorite":true},"type":"favorites"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/ff20368e-cb9a-4216-aa76-a61c11aef6d1/favorite + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/ff20368e-cb9a-4216-aa76-a61c11aef6d1 + response: + body: '{"data":{"id":"ff20368e-cb9a-4216-aa76-a61c11aef6d1","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ff1ec95de16 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:01.652Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..a7b31fb6df0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Favorite_Status_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"favorite":true},"type":"favorites"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 0 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/favorite + response: + body: '{"errors":[{"status":"404","id":"3711d641-f1a9-4a08-b8a2-f02b0c6d3cac","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..be4a0d65e2d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:01.865Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..ace4c2aefb2 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"protectionLevel":"approval_required"},"type":"protectionLevel"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/protection-level + response: + body: '{"errors":[{"status":"404","id":"ac8e4f99-d059-43c6-b48a-2feb634c46b9","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.freeze new file mode 100644 index 00000000000..181d84d9c6e --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:02.394Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.yaml new file mode 100644 index 00000000000..6f0e6a91858 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Protection_Level_returns_OK_response.yaml @@ -0,0 +1,71 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"7233c313-f027-46ba-b269-fbca3f75cbad","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"protectionLevel":"approval_required"},"type":"protectionLevel"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7233c313-f027-46ba-b269-fbca3f75cbad/protection-level + response: + body: '{"data":{"id":"7233c313-f027-46ba-b269-fbca3f75cbad","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# + Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due + Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused + Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## + Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This + is a slightly complicated example app that fetches and displays cat facts","favorite":false,"name":"Example + Cat Facts Viewer","protectionLevel":"approval_required","queries":[{"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","type":"action","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + + 1).toString()}"}],"verb":"GET"}}}},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","type":"stateVariable","properties":{"defaultValue":"${20}"}},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","type":"dataTransform","properties":{"outputs":"${(() + =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"}}],"rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":321813,"user_id":1445416,"user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","user_name":"frog@datadoghq.com","version":1,"version_id":"42a9e44d-6fd7-4dd6-8a72-17e570b9e46f","updated_since_deployment":false,"created_at":"2026-05-18T19:52:02.806411Z","updated_at":"2026-05-18T19:52:02.806411Z","deleted_at":"0001-01-01T00:00:00Z","run_as_user":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/7233c313-f027-46ba-b269-fbca3f75cbad + response: + body: '{"data":{"id":"7233c313-f027-46ba-b269-fbca3f75cbad","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.freeze new file mode 100644 index 00000000000..30060a318bf --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:04.154Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.yaml new file mode 100644 index 00000000000..bdf34844848 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_No_Content_response.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"f18f2a0e-bf9a-4b7a-b43d-31ca68aaf5f1","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"selfService":true},"type":"selfService"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/f18f2a0e-bf9a-4b7a-b43d-31ca68aaf5f1/self-service + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/f18f2a0e-bf9a-4b7a-b43d-31ca68aaf5f1 + response: + body: '{"data":{"id":"f18f2a0e-bf9a-4b7a-b43d-31ca68aaf5f1","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..e8d61c77153 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:06.076Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..53f23112cf8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Self-Service_Status_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"selfService":true},"type":"selfService"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 0 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/self-service + response: + body: '{"errors":[{"status":"404","id":"623c417b-ba6a-4952-8d3c-1d90edaf3166","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.freeze new file mode 100644 index 00000000000..94bb561b71f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:06.248Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.yaml new file mode 100644 index 00000000000..735910ebeb5 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_No_Content_response.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"57a1c1c9-edfb-47ea-ad74-e90c2e13d0f0","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"tags":["team:platform","service:ops"]},"type":"tags"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/57a1c1c9-edfb-47ea-ad74-e90c2e13d0f0/tags + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/57a1c1c9-edfb-47ea-ad74-e90c2e13d0f0 + response: + body: '{"data":{"id":"57a1c1c9-edfb-47ea-ad74-e90c2e13d0f0","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..641ef7d09b7 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T19:52:07.233Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..2b834c145ce --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_Tags_returns_Not_Found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"tags":["team:platform","service:ops"]},"type":"tags"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 0 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/tags + response: + body: '{"errors":[{"status":"404","id":"26c91c86-51b3-4c5f-98b4-713698730b08","title":"app + not found","detail":"app with id 7addb29b-f935-472c-ae79-d1963979a23e not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..8a9a80955aa --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T14:40:26.660Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..5ca442e8416 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_Not_Found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/xxx-xxx-xxx/usage + response: + body: '{"errors":["Dashboard not found for dashboard_id=xxx-xxx-xxx in org_id=321813 + not found"]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.freeze new file mode 100644 index 00000000000..3848782ff12 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T14:40:26.861Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.yaml new file mode 100644 index 00000000000..0d9cee7c2ef --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_a_dashboard_returns_OK_response.yaml @@ -0,0 +1,58 @@ +interactions: +- request: + body: | + {"layout_type":"ordered","title":"Test-Get_usage_stats_for_a_dashboard_returns_OK_response-1779115226 with Profile Metrics Query","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"}}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/dashboard + response: + body: '{"id":"cb5-47u-8yc","title":"Test-Get_usage_stats_for_a_dashboard_returns_OK_response-1779115226 + with Profile Metrics Query","description":null,"author_handle":"frog@datadoghq.com","author_name":"frog","layout_type":"ordered","url":"/dashboard/cb5-47u-8yc/test-getusagestatsforadashboardreturnsokresponse-1779115226-with-profile-metrics","template_variables":null,"widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"},"id":7645859989261101}],"notify_list":null,"created_at":"2026-05-18T14:40:27.022358+00:00","modified_at":"2026-05-18T14:40:27.022358+00:00","restricted_roles":[]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/cb5-47u-8yc/usage + response: + body: '{"data":{"id":"cb5-47u-8yc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Get_usage_stats_for_a_dashboard_returns_OK_response-1779115226 + with Profile Metrics Query","teams":[],"created_at":"2026-05-18T14:40:27.022358Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-05-18T14:40:27.022358Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":null}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v1/dashboard/cb5-47u-8yc + response: + body: '{"deleted_dashboard_id":"cb5-47u-8yc"}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..b8215d02483 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2026-05-18T14:40:28.138Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..5e871e26f7b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_Bad_Request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/usage?page%5Blimit%5D=10000 + response: + body: '{"errors":["Input should be less than or equal to 500"]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.freeze new file mode 100644 index 00000000000..84fa8e891ca --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T14:40:28.411Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.yaml new file mode 100644 index 00000000000..731394b4c65 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response.yaml @@ -0,0 +1,353 @@ +interactions: +- request: + body: | + {"layout_type":"ordered","title":"Test-Get_usage_stats_for_all_dashboards_returns_OK_response-1779115228 with Profile Metrics Query","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"}}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/dashboard + response: + body: '{"id":"wu3-x5g-reh","title":"Test-Get_usage_stats_for_all_dashboards_returns_OK_response-1779115228 + with Profile Metrics Query","description":null,"author_handle":"frog@datadoghq.com","author_name":"frog","layout_type":"ordered","url":"/dashboard/wu3-x5g-reh/test-getusagestatsforalldashboardsreturnsokresponse-1779115228-with-profile-metr","template_variables":null,"widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"},"id":2898809444744372}],"notify_list":null,"created_at":"2026-05-18T14:40:28.606887+00:00","modified_at":"2026-05-18T14:40:28.606887+00:00","restricted_roles":[]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/usage + response: + body: '{"data":[{"id":"22p-zw6-qia","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770895286 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:26.907249Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:26.907249Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28204906085021153}},{"id":"284-wiv-iqk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-10-21T21:02:03.739689Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-21T21:02:03.739689Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"287-waf-fua","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1770981465 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:45.310427Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:45.310427Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852179956698162}},{"id":"29x-55z-rt2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-09T22:20:08.019993Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T22:20:09.093470Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2be-q62-ep5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-06-23T00:04:08.199090Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-23T00:04:08.199090Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2cz-cim-bga","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771235251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:32.359535Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:32.359535Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2945502017336819}},{"id":"2fb-2xi-b3r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771048054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:35.029821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:35.029821Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2876666193692902}},{"id":"2fn-zr3-4jy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771249651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:32.319363Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:32.319363Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2950797141452782}},{"id":"2fp-uaa-dxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770904050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:31.270385Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:31.270385Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2823713422390794}},{"id":"2gn-qtd-zd9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:54:10.920756Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:54:57.107615Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"2m8-ht3-7kf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T02:11:27.660825Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T02:11:27.660825Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2n8-amr-8ws","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_hostmap_widget_1738642608","teams":[],"created_at":"2025-02-04T04:16:49.306022Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-04T04:16:49.306022Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2ph-z9s-3ma","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771019257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:37.816410Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:37.816410Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866076940564898}},{"id":"2qn-4hs-6nz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-06-06T18:28:02.296323Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-06T18:28:02.296323Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2rd-dc2-4qz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"delete-me","teams":[],"created_at":"2023-04-04T07:20:20.175651Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-04-04T07:25:00.141124Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2t6-ira-9sr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-26T16:19:46.726552Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-26T16:19:46.726552Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"2w5-uyn-tkh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771390145 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T04:49:05.674863Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T04:49:05.674863Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.30024590740843354}},{"id":"2wf-ez7-j7s","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771048050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:31.238278Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:31.238278Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28766647994426764}},{"id":"37f-p9m-n5a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_updateToRbac-local-1776085112","teams":[],"created_at":"2026-04-13T12:58:33.957713Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-13T12:58:33.957713Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.2067271396582174}},{"id":"37v-ks5-42n","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771019250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:31.237085Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:31.237085Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866074521225058}},{"id":"38e-jd2-pvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771033651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:32.276189Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:32.276189Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28713700422106986}},{"id":"3ag-svk-vks","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771379257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:37.819031Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:37.819031Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29984554137462616}},{"id":"3bd-yi5-t9f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned)","teams":[],"created_at":"2024-01-24T20:36:07.585183Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-24T20:36:07.585183Z","widget_count":42,"widget_count_by_type":{"query_value":21,"toplist":3,"note":5,"timeseries":9,"image":1,"hostmap":1,"heatmap":2},"dashboard_quality_score":0.0}},{"id":"3dh-twk-s46","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771364857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:37.812316Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:37.812316Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29931602723863215}},{"id":"3f9-4ni-c37","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + Ordered Layout Dashboard","teams":[],"created_at":"2024-10-04T18:55:30.384138Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":5,"viewed_at":"2025-08-19T14:16:27.955000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":5,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-18T19:22:40.421722Z","widget_count":19,"widget_count_by_type":{"alert_graph":2,"alert_value":2,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"query_table":1,"scatterplot":1,"servicemap":1,"timeseries":1,"toplist":1,"group":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"3gp-ihg-25a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:55:49.231714Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:55:49.231714Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3hx-aas-pkd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-09T01:07:47.665899Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-09T01:11:49.409229Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3ia-t26-3ny","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Powerpack + Test","teams":[],"created_at":"2023-09-12T17:24:07.448153Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2026-04-10T14:49:57.534000Z","viewer":{"id":"21235577","name":"Francesco + Pighi","handle":"francesco.pighi@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2023-09-12T17:24:07.448153Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.2026679121677571}},{"id":"3jf-enh-rvf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770889652 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:32.857235Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:32.857235Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2818418866977467}},{"id":"3jh-dek-qps","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-12-08T21:59:54.884830Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-08T22:00:29.988353Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"3jt-5cb-icy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-02-24T20:40:32.063650Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-02-24T20:40:33.482665Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"3kr-vna-uug","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:56:42.073944Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:56:42.073944Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3mh-eua-8gx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771264055 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T17:47:35.437223Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T17:47:35.437223Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2956093426792953}},{"id":"3nb-3ce-ckg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1771240877 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:17.935183Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:17.935183Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29475706425980197}},{"id":"3nb-t26-7yu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771105650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:31.428318Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:31.428318Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2897845424867695}},{"id":"3uh-fgj-iu9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_events_qu_1771155581","teams":[],"created_at":"2026-02-15T11:39:41.627411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T11:39:41.627411Z","widget_count":1,"widget_count_by_type":{"distribution":1},"dashboard_quality_score":0.38882742089832584}},{"id":"3uv-rz7-km5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Proxmox + Overview host dashboards","teams":[],"created_at":"2025-07-25T19:59:43.297508Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-07-25T19:59:43.579000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-25T20:00:11.931527Z","widget_count":40,"widget_count_by_type":{"group":8,"note":5,"query_value":10,"list_stream":1,"manage_status":1,"toplist":2,"timeseries":9,"query_table":4},"dashboard_quality_score":0.0}},{"id":"3xf-myy-c3f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createAdmin-local-1774386000","teams":[],"created_at":"2026-03-24T21:00:04.874787Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-24T21:00:04.874787Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.179413786344114}},{"id":"3y3-3x5-kq8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-11-09T16:03:35.113528Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-09T16:03:47.912796Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"43b-kw6-vqr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned)","teams":[],"created_at":"2023-09-20T09:37:10.513590Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-06T14:44:10.522900Z","widget_count":42,"widget_count_by_type":{"query_value":21,"toplist":3,"note":5,"timeseries":10,"image":1,"hostmap":1,"heatmap":1},"dashboard_quality_score":0.0}},{"id":"43k-xij-6fu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771393651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:32.095399Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:32.095399Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003748447936856}},{"id":"48h-7qq-cih","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Heather''s + Dashboard Mon, Jun 30, 11:32:33 am","teams":[],"created_at":"2025-06-30T15:32:33.156114Z","author":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-06-30T15:35:37.715000Z","viewer":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-06-30T15:33:00.626392Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"49w-wru-9r3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771336054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:35.021426Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:35.021426Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2982568968329764}},{"id":"4ai-qzh-uxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771192051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:32.249226Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:32.249226Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2929616560052716}},{"id":"4b5-8v7-rh2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771336050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:31.201562Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:31.201562Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29825675636962523}},{"id":"4ic-zm9-api","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardSpans_NoHideIncompleteCostData-local-1771030254","teams":[],"created_at":"2026-02-14T00:50:57.448221Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T00:50:57.448221Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.38268289372150466}},{"id":"4ig-4ks-6c8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770990454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T13:47:35.017644Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T13:47:35.017644Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28554856336037004}},{"id":"4j8-nbn-4gi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-09-28T01:37:23.346984Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-09-28T01:37:23.346984Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"4m8-kr3-ca4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771076850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T13:47:31.252396Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T13:47:31.252396Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2887255082386866}},{"id":"4mv-u7u-ysx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_shared_dashboard_with_a_group_template_variable_returns_OK_response_1771163253 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:33.853020Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:33.853020Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29190268720160345}},{"id":"4n7-s4g-dqv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"For + dashboard list tests - DO NOT DELETE","teams":[],"created_at":"2020-02-11T13:49:29.555334Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-04-08T17:54:25.574039Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"4nf-i9k-t87","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771379250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:31.220114Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:31.220114Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2998452987181588}},{"id":"4sx-tiz-2qu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770745657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:37.768200Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:37.768200Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765469283919025}},{"id":"4td-xzm-6yq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Create_a_new_dashboard_with_a_toplist_widget_sorted_by_group-1772531926","teams":[],"created_at":"2026-03-03T09:58:47.282663Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-03T09:58:47.282663Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.34223126986457164}},{"id":"4ud-du4-pi3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-17T08:32:02.449350Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-17T08:32:02.449350Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"4uk-xyr-myu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_funnel_widget_1775734738 + with funnel widget","teams":[],"created_at":"2026-04-09T11:38:59.468470Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-09T11:38:59.468470Z","widget_count":1,"widget_count_by_type":{"funnel":1},"dashboard_quality_score":0.4600044320788619}},{"id":"4vs-2aj-87j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770731251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:32.144492Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:32.144492Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27601720770897226}},{"id":"4wp-g9w-rqp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2021-01-06T16:34:52.946050Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-06T16:34:52.946050Z","widget_count":1,"widget_count_by_type":{"change":1},"dashboard_quality_score":0.0}},{"id":"4wy-ajm-bvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-10-04T18:35:18.554744Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:35:18.554744Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"4z7-iip-zrt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-07-07T17:09:12.214893Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T17:09:12.874904Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"4zw-ifc-4pv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770745651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:32.295694Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:32.295694Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765467271576857}},{"id":"55v-ka5-rne","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770745655 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:35.397058Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:35.397058Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765468412003758}},{"id":"59f-bun-r3c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"VMware + vSphere - Overview","teams":[],"created_at":"2024-01-17T15:17:19.954644Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-17T15:17:33.545302Z","widget_count":22,"widget_count_by_type":{"image":1,"list_stream":1,"toplist":5,"timeseries":6,"note":3,"query_value":5,"check_status":1},"dashboard_quality_score":0.0}},{"id":"5bg-c69-wq9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771062450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:31.220095Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:31.220095Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881959931613793}},{"id":"5cj-8j7-qpy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Octopus + Deploy Overview","teams":[],"created_at":"2024-12-11T20:48:25.007210Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":27,"viewed_at":"2025-01-16T20:42:51.598000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":27,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-01-16T20:12:02.010750Z","widget_count":31,"widget_count_by_type":{"group":6,"note":5,"query_value":8,"list_stream":2,"toplist":2,"timeseries":1,"query_table":7},"dashboard_quality_score":0.0}},{"id":"5gx-3pv-cwk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1771327301 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:41.852380Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:41.852380Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29793502706931224}},{"id":"5i4-3c5-qby","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Sherzod''s + Dashboard Wed, Dec 20, 1:37:28 pm","teams":[],"created_at":"2023-12-20T18:37:28.853122Z","author":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-20T18:37:28.853122Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"5mk-tv6-3wt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771321657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:47:37.701536Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:47:37.701536Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2977274814953296}},{"id":"5mr-xms-2qa","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-09T22:16:56.913567Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T22:16:57.568474Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"5qz-2i3-6cq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Free Layout Dashboard","teams":[],"created_at":"2023-08-02T14:14:41.648472Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T14:14:41.648472Z","widget_count":1,"widget_count_by_type":{"event_stream":1},"dashboard_quality_score":0.0}},{"id":"5r9-yr4-f7p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770970019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T08:06:59.825960Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T08:06:59.825960Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2847971246195878}},{"id":"5ti-jks-zwd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770832051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:32.154507Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:32.154507Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27972380529638946}},{"id":"5tp-tr6-93q","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-21T13:59:15.028164Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-21T13:59:15.028164Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"5uv-zxz-4r8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771004851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T17:47:32.259530Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T17:47:32.259530Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2860779758248462}},{"id":"5vp-fxm-s4j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"PCF + Testing","teams":[],"created_at":"2022-06-08T10:40:29.941695Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":161,"viewed_at":"2026-05-15T19:53:55.277000Z","viewer":{"id":"67399597","name":"Kyle + Neale","handle":"kyle.neale@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":161,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-05-15T21:03:07.093496Z","widget_count":22,"widget_count_by_type":{"group":4,"hostmap":2,"timeseries":5,"query_table":9,"trace_service":1,"list_stream":1},"dashboard_quality_score":0.7276695720872501}},{"id":"5yv-q5c-8m3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770737540 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T15:32:20.553171Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T15:32:20.553171Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2762484437983195}},{"id":"63v-49e-a7d","type":"dashboards-usages","attributes":{"org_id":321813,"title":"sarah + test","teams":[],"created_at":"2023-05-15T18:12:47.853642Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-05-15T18:25:28.895732Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"669-8wg-nfr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770803257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T09:47:37.746546Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T09:47:37.746546Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2786649831475839}},{"id":"679-8up-bf2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2022-04-14T13:40:43.116109Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-04-14T13:40:43.116109Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"67i-fs9-rzn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Teleport + Overview","teams":[],"created_at":"2024-04-03T15:04:15.262442Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-11-01T18:56:10.280000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2024-06-04T14:49:15.193580Z","widget_count":44,"widget_count_by_type":{"group":8,"note":3,"query_value":8,"timeseries":25},"dashboard_quality_score":0.0}},{"id":"67s-cju-w7w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770832057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:37.795289Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:37.795289Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2797240127174032}},{"id":"6by-h9d-gui","type":"dashboards-usages","attributes":{"org_id":321813,"title":"MM + RBAC Dashboard","teams":[],"created_at":"2021-04-23T16:14:13.820995Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-23T16:14:13.820995Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.0}},{"id":"6e7-n4p-tdp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771033657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:37.805777Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:37.805777Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28713720754741917}},{"id":"6ez-pq7-4zk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_shared_dashboard_returns_OK_response-1689999025 + with Profile Metrics Query","teams":[],"created_at":"2023-07-22T04:10:25.713775Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-22T04:10:25.713775Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"6md-r2g-kxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-17T03:08:25.445281Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-17T03:08:25.445281Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"6pm-2ad-2v8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-03-15T13:45:39.004786Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-15T13:45:40.299693Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"6qu-cxf-9jy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-13T12:31:40.237970Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-13T12:31:40.237970Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"6rw-fcg-izv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771105651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:32.200877Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:32.200877Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28978457088934567}},{"id":"6v2-52t-9m7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771091250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:31.249672Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:31.249672Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2892550220228939}},{"id":"6vb-yrz-ag6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770918450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:31.238722Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:31.238722Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2829008549535302}},{"id":"6vv-phh-8te","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770731257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:37.794992Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:37.794992Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2760174154837683}},{"id":"6xb-usd-min","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-12-04T15:37:35.427082Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-12-04T15:37:35.427082Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.06021835561049866}},{"id":"73p-kiw-ike","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771091251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:32.262566Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:32.262566Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2892550592686626}},{"id":"74v-m9u-yzs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Event Timeline Widget Dashboard","teams":[],"created_at":"2020-12-10T04:21:12.270024Z","author":null,"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-12-10T04:21:12.270024Z","widget_count":1,"widget_count_by_type":{"event_timeline":1},"dashboard_quality_score":0.0}},{"id":"76m-n9x-wd4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"DL + FF TF","teams":[],"created_at":"2021-02-02T13:54:05.514952Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-02-02T13:54:05.514952Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"795-wur-2am","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-14T14:17:13.784143Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-14T14:17:13.784143Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"7b3-yvp-mmq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Free Layout Dashboard","teams":[],"created_at":"2023-08-02T16:16:55.297530Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T16:16:55.297530Z","widget_count":1,"widget_count_by_type":{"event_stream":1},"dashboard_quality_score":0.0}},{"id":"7bt-mcb-a9f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2026-05-08T03:12:09.665811Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-05-08T03:12:09.665811Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.5510216256252313}},{"id":"7dp-46c-6tr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-07T16:37:56.369573Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-07T16:37:56.369573Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"7ia-ywt-ixn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770955619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T04:06:59.844956Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T04:06:59.844956Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28426761142753754}},{"id":"7j9-9in-7md","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770904051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:32.262502Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:32.262502Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2823713787104167}},{"id":"7kp-v5x-s54","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1771327312 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:52.754388Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:52.754388Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2979354279514505}},{"id":"7ns-vmc-rup","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardListStream-local-1772801028","teams":[],"created_at":"2026-03-06T12:43:50.956179Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-06T12:43:50.956179Z","widget_count":1,"widget_count_by_type":{"list_stream":1},"dashboard_quality_score":0.4695022609867474}},{"id":"7q2-h97-j2m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_items_of_a_Dashboard_List_returns_OK_response_1731709308 + with Profile Metrics Query","teams":[],"created_at":"2024-11-15T22:21:49.262821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-11-15T22:21:49.262821Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"7ui-ttk-rjb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771336051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:32.369190Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:32.369190Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2982567993000199}},{"id":"7v3-gfj-zzr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770760050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T21:47:31.212371Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T21:47:31.212371Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2770762012061138}},{"id":"7yi-rk7-7kw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770947250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:31.242266Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:31.242266Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28395988286092905}},{"id":"7ym-viw-7if","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + created using cloudformation template","teams":[],"created_at":"2024-09-27T18:25:34.741716Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-27T18:25:34.741716Z","widget_count":60,"widget_count_by_type":{"group":6,"timeseries":17,"toplist":17,"sunburst":1,"hostmap":1,"query_value":18},"dashboard_quality_score":0.0}},{"id":"823-wmx-kyk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-09T21:30:35.101006Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T21:30:36.200544Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"86h-24u-mwc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"vSphere + VM Property Metrics","teams":[],"created_at":"2023-07-18T18:13:38.804575Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-11T19:57:25.366422Z","widget_count":14,"widget_count_by_type":{"query_table":10,"treemap":1,"toplist":3},"dashboard_quality_score":0.0}},{"id":"884-jxj-d7f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Infrastructure Overview","teams":[],"created_at":"2024-01-04T11:25:42.564360Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-05T18:05:45.334010Z","widget_count":64,"widget_count_by_type":{"note":8,"timeseries":17,"hostmap":2,"query_value":32,"toplist":3,"query_table":2},"dashboard_quality_score":0.0}},{"id":"88m-nrr-j4c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_shared_dashboard_returns_OK_response_1720742852 + with Profile Metrics Query","teams":[],"created_at":"2024-07-12T00:07:33.291059Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-12T00:07:33.291059Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"89p-5x9-mfp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T04:09:45.848591Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T04:09:45.848591Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8d7-qz3-urj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771128419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T04:06:59.945411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T04:06:59.945411Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2906217817873656}},{"id":"8ev-2hz-9yh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771364854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:35.065546Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:35.065546Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2993159262270882}},{"id":"8fj-gzg-78v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770932854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:35.023675Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:35.023675Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2834305080206865}},{"id":"8kf-ip5-ict","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Heather''s + Dashboard Fri, Aug 1, 4:48:55 pm","teams":[],"created_at":"2025-08-01T20:48:55.649802Z","author":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-08-01T20:49:40.239000Z","viewer":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-01T20:49:22.242970Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"8mr-z8r-xaq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-14T14:17:22.284588Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-14T14:17:22.284588Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"8ny-iwn-ira","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardEventTimeline-local-1776820257","teams":[],"created_at":"2026-04-22T01:11:00.774052Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-22T01:11:00.774052Z","widget_count":1,"widget_count_by_type":{"event_timeline":1},"dashboard_quality_score":0.21854470035954052}},{"id":"8qn-sx4-6py","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-30T18:57:16.337700Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-30T18:57:16.337700Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8r3-fr7-g8h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-03T11:06:05.600888Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-03T18:00:35.762592Z","widget_count":3,"widget_count_by_type":{"hostmap":1,"timeseries":1,"toplist":1},"dashboard_quality_score":0.0}},{"id":"8rp-qrc-d72","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Java-Create_a_new_dashboard_with_geomap_widget-1737861024","teams":[],"created_at":"2025-01-26T03:10:24.707218Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-26T03:10:24.707218Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"8rq-w48-cav","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1770981477 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:57.935448Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:57.935448Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852184599023656}},{"id":"8v6-29d-g7r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Timeboard + Dashboard 1769733","teams":[],"created_at":"2024-10-04T18:49:59.050042Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:49:59.050042Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"8va-as3-xfj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771099619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T20:06:59.844113Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T20:06:59.844113Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28956275028407824}},{"id":"8vg-n3m-t2r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog''s + Dashboard Mon, Sep 18, 1:11:53 pm (cloned)","teams":[],"created_at":"2023-10-13T14:28:19.062400Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-13T14:28:19.062400Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"8w6-777-dbc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-03-03T15:12:52.825402Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-03T15:12:52.825402Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8wn-wbp-bpe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771243619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T12:06:59.843565Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T12:06:59.843565Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29485788915253947}},{"id":"8yn-6s7-pue","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T01:34:46.545176Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T01:34:46.545176Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8z4-u8g-ecy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771200419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T00:06:59.836148Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T00:06:59.836148Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2932693472130468}},{"id":"92s-2qq-7ib","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1776560567","teams":[],"created_at":"2026-04-19T01:02:52.517316Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":1,"viewed_at":"2026-05-06T16:41:02.642000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-04-19T01:02:52.517316Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.2388861655718952}},{"id":"92z-j9h-rpi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770745650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:31.175796Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:31.175796Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765466859707376}},{"id":"96c-d6b-txk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771134451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T05:47:32.238314Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T05:47:32.238314Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2908436000413892}},{"id":"986-sdj-7f5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770947257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:37.813715Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:37.813715Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28396012450329816}},{"id":"998-r9i-nmq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770889657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:37.810139Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:37.810139Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28184206881619533}},{"id":"9bz-xsh-sd4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770976054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T09:47:35.350772Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T09:47:35.350772Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28501906171413455}},{"id":"9cb-ici-wh9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770788857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:37.728846Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:37.728846Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2781354686045877}},{"id":"9dy-6d6-92u","type":"dashboards-usages","attributes":{"org_id":321813,"title":"KubeVirt + Overview (DEV)","teams":[],"created_at":"2025-01-07T07:17:49.547882Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":10,"viewed_at":"2025-01-07T15:05:57.088000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":10,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-01-07T07:18:50.881143Z","widget_count":48,"widget_count_by_type":{"group":6,"note":1,"query_value":4,"timeseries":31,"query_table":2,"toplist":4},"dashboard_quality_score":0.0}},{"id":"9fh-bsk-dez","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-01T06:21:51.929267Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-01T06:21:51.929267Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9gp-yca-ewc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-07-03T05:06:40.070179Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-03T05:06:40.070179Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9gw-nvp-fv8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:16:01.442667Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:16:01.442667Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"9hv-ptz-8ca","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770846451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:31.833721Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:31.833721Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.280253307385377}},{"id":"9j7-b7g-fmp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-07-07T17:12:20.570681Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T17:12:21.707927Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"9km-gj8-2rj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Screenboard Fri, Apr 16, 10:20:54 am","teams":[],"created_at":"2021-04-16T08:20:54.758861Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-16T08:21:08.649752Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"9kx-z8g-k6m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770867140 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T03:32:20.633759Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T03:32:20.633759Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28101407175773013}},{"id":"9nh-zpi-6qr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770904054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:35.018170Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:35.018170Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28237148003862317}},{"id":"9qq-fww-7dt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_event_stream_list_stream_widget_1736259735 + with list_stream widget","teams":[],"created_at":"2025-01-07T14:22:16.267384Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-07T14:22:16.267384Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"9ra-4tp-6x8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-08T22:30:44.267214Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-08T22:30:44.267214Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"9re-h8a-8tw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardStyle-local-1773413743","teams":[],"created_at":"2026-03-13T14:55:46.971416Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-13T14:55:46.971416Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3746573651820967}},{"id":"9td-t9c-kk7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"VMware + vSphere - Overview","teams":[],"created_at":"2024-01-17T14:04:12.968245Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-17T16:29:07.018541Z","widget_count":22,"widget_count_by_type":{"image":1,"event_stream":1,"toplist":5,"timeseries":6,"note":3,"query_value":5,"check_status":1},"dashboard_quality_score":0.0}},{"id":"9tw-t3j-j2j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:55:33.097538Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:55:33.097538Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"9wr-ifb-ks3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + for testing","teams":[],"created_at":"2024-06-28T14:32:31.419746Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-28T14:32:31.419746Z","widget_count":2,"widget_count_by_type":{"timeseries":1,"sunburst":1},"dashboard_quality_score":0.0}},{"id":"9ze-x5d-4uk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-10-02T10:21:50.272937Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-02T10:21:50.272937Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9zn-yrm-f5x","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + Timeboard Dashboard New1","teams":[],"created_at":"2025-08-18T19:43:21.235986Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-08-19T14:17:27.783000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-18T19:43:21.235986Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"a2m-4ke-pvn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771350450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:31.256739Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:31.256739Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2987862722785235}},{"id":"a4r-ixp-f77","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770981467 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:47.463943Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:47.463943Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852180748437294}},{"id":"aaq-h42-uug","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771292851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T01:47:32.150956Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T01:47:32.150956Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29666824960484295}},{"id":"ab7-eca-ywv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771206450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T01:47:31.251500Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T01:47:31.251500Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29349113319682957}},{"id":"anz-4xk-5rd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771163254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:35.016746Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:35.016746Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2919027299849888}},{"id":"arc-fsp-y6c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771364854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:34.823663Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:34.823663Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29931591732937646}},{"id":"asp-qkq-xha","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:47:56.046241Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:53:05.322597Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"asx-682-bd2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771019254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:35.043844Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:35.043844Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866075920923335}},{"id":"av3-b6t-5d4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771120057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:37.800815Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:37.800815Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2903142906932992}},{"id":"axt-yuk-b8k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771186019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T20:06:59.834652Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T20:06:59.834652Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2927398332665977}},{"id":"b2p-ixy-wbd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-01T02:22:19.767227Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-01T02:22:19.767227Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"b2x-2d8-smj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"vsphere + test","teams":[],"created_at":"2023-11-15T14:29:57.863141Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-17T15:09:09.324288Z","widget_count":10,"widget_count_by_type":{"note":2,"timeseries":8},"dashboard_quality_score":0.0}},{"id":"b3e-rar-7dg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771249657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:37.710012Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:37.710012Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2950799123541292}},{"id":"b6n-8j5-2iz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned) (cloned)","teams":[],"created_at":"2023-09-26T09:00:00.247208Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-05T14:50:19.276985Z","widget_count":42,"widget_count_by_type":{"image":1,"note":5,"hostmap":1,"timeseries":9,"query_value":21,"heatmap":2,"toplist":3},"dashboard_quality_score":0.0}},{"id":"b6n-d8r-7em","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OSLO: + splunk LB ","teams":[],"created_at":"2021-05-03T13:03:46.217614Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-03T13:03:46.217614Z","widget_count":12,"widget_count_by_type":{"note":3,"slo":1,"timeseries":8},"dashboard_quality_score":0.0}},{"id":"b8u-q5n-6xn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770766340 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T23:32:20.553044Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T23:32:20.553044Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27730747156551677}},{"id":"b9v-vd2-fq2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Etiennes + Dashboard Tue, Mar 18, 3:56:32 pm","teams":[],"created_at":"2025-03-18T14:56:32.569828Z","author":{"id":"21181844","name":"Etienne + Philippe Carriere","handle":"etienne.carriere@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-03-18T14:56:32.743000Z","viewer":{"id":"21181844","name":"Etienne + Philippe Carriere","handle":"etienne.carriere@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-03-18T14:57:27.767981Z","widget_count":1,"widget_count_by_type":{"query_value":1},"dashboard_quality_score":0.0}},{"id":"ba4-5j6-8be","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771324708 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T10:38:29.056240Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T10:38:29.056240Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29783968528489124}},{"id":"bby-apf-qxh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1770981464 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:44.522761Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:44.522761Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852179666902397}},{"id":"bcy-i9m-yk2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-26T09:52:25.783725Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-26T09:52:25.783725Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bde-dby-we2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770932850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:31.228195Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:31.228195Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2834303684500229}},{"id":"bgf-jzg-b7a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion] (shanel clone)","teams":[],"created_at":"2024-06-06T17:13:17.485112Z","author":{"id":"5620636","name":"Shanel + Huang","handle":"shanel.huang@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-06T17:28:16.789541Z","widget_count":156,"widget_count_by_type":{"group":11,"note":28,"check_status":8,"query_value":59,"query_table":24,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"bgp-uee-rt3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-03-03T15:12:51.418778Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-03T15:12:51.418778Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bjz-fmp-fv7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770774451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T01:47:32.146629Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T01:47:32.146629Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2776057494443591}},{"id":"bpc-yw5-2ai","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-11T05:06:09.509411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-11T05:06:09.509411Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bpj-ytu-fpt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T15:46:41.035816Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:48:05.847943Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"bru-u6k-rjq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Wisdom","teams":[],"created_at":"2021-12-15T14:39:24.510324Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-12-15T16:54:32.046189Z","widget_count":14,"widget_count_by_type":{"note":2,"timeseries":12},"dashboard_quality_score":0.0}},{"id":"brz-7z3-9w7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771027619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T00:06:59.982674Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T00:06:59.982674Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28691518593066434}},{"id":"bu8-gue-27p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bosh + AutoRelease Testing (cloned)","teams":[],"created_at":"2023-09-01T08:05:20.514088Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-08-01T12:48:01.368000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2023-09-01T08:08:49.528818Z","widget_count":11,"widget_count_by_type":{"note":1,"free_text":5,"query_table":3,"timeseries":2},"dashboard_quality_score":0.0}},{"id":"bvb-yc9-exe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"debian + (cloned)","teams":[],"created_at":"2025-08-06T16:25:39.628071Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":3,"viewed_at":"2025-08-06T16:27:42.045000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":3,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-06T16:28:13.557631Z","widget_count":4,"widget_count_by_type":{"timeseries":4},"dashboard_quality_score":0.0}},{"id":"bvm-3qi-iuq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771393654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:35.059151Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:35.059151Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003749537648578}},{"id":"byj-yvx-u34","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardTopologyMap-local-1772643592","teams":[],"created_at":"2026-03-04T16:59:55.987040Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-04T16:59:55.987040Z","widget_count":1,"widget_count_by_type":{"topology_map":1},"dashboard_quality_score":0.46178337183529905}},{"id":"c5w-bu2-9tj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1774284510","teams":[],"created_at":"2026-03-23T16:48:34.042558Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:48:34.042558Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.17778231076946094}},{"id":"c5z-eix-jck","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified_1742496578","teams":[],"created_at":"2025-03-20T18:49:39.343102Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-20T18:49:39.343102Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"c7v-rr4-syc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771048057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:37.791536Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:37.791536Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28766672090607276}},{"id":"ce2-rip-h9m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771235250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:31.226370Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:31.226370Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2945501600486306}},{"id":"cf8-ifs-4vf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Sherzod''s + Dashboard Wed, Dec 20, 10:34:03 am","teams":[],"created_at":"2023-12-20T15:34:03.307486Z","author":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-20T15:34:03.307486Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"ch3-ufm-3r3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771278457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T21:47:37.708347Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T21:47:37.708347Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29613894006908703}},{"id":"chp-364-vkw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770809020 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:40.360996Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:40.360996Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788768848339404}},{"id":"cmr-azj-aw6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-13T12:31:40.386452Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-13T12:31:40.386452Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"cpe-53e-zpe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1770895295 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:35.806052Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:35.806052Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2820493880579771}},{"id":"cph-7er-div","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771379251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:32.093932Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:32.093932Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.299845330839013}},{"id":"cpz-ukf-zgw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + Overview (cloned)","teams":[],"created_at":"2026-03-17T17:42:02.849648Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":3,"viewed_at":"2026-03-18T10:28:43.858000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":3,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-03-17T17:42:02.849648Z","widget_count":69,"widget_count_by_type":{"group":5,"image":1,"query_value":24,"note":5,"timeseries":27,"toplist":4,"query_table":3},"dashboard_quality_score":0.6818860470532752}},{"id":"cqe-tb8-kag","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770881540 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T07:32:20.535221Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T07:32:20.535221Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28154358201949387}},{"id":"cw4-irn-n79","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T21:55:02.601652Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T21:55:02.601652Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"cx2-6g6-mni","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_timeseries_widget_with_legacy_live_span_time_format_1739376942 + with legacy live span time","teams":[],"created_at":"2025-02-12T16:15:43.276834Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-12T16:15:43.276834Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"cxr-rw5-dfb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"frog''s + Dashboard Wed, Oct 11, 2:07:21 pm","teams":[],"created_at":"2023-10-11T18:07:21.856517Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-11T20:32:00.487697Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"d27-b4r-765","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1771240889 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:29.190827Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:29.190827Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2947574781371176}},{"id":"d44-daj-rt3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771235254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:35.291802Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:35.291802Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29455030954105843}},{"id":"d4c-zbf-ehz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771332545 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T12:49:05.720282Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T12:49:05.720282Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29812785350879384}},{"id":"d5e-dpd-umy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Infrastructure Overview","teams":[],"created_at":"2024-01-05T16:22:20.712589Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":24,"viewed_at":"2026-02-11T14:59:44.086000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":24,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-10-28T14:33:21.452494Z","widget_count":83,"widget_count_by_type":{"group":5,"note":14,"treemap":1,"hostmap":1,"query_value":39,"timeseries":18,"toplist":3,"query_table":2},"dashboard_quality_score":0.4884871419597444}},{"id":"d7b-d5m-7jw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Proxmox + Overview","teams":[],"created_at":"2025-07-10T13:46:05.531316Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":59,"viewed_at":"2025-07-25T17:15:01.679000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":59,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-16T13:37:42.454688Z","widget_count":40,"widget_count_by_type":{"group":8,"note":5,"query_value":10,"list_stream":1,"manage_status":1,"toplist":3,"timeseries":8,"query_table":4},"dashboard_quality_score":0.0}},{"id":"d9k-7wu-vwn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardTabUpdate-local-1774284040","teams":[],"created_at":"2026-03-23T16:40:44.085796Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:40:53.238271Z","widget_count":3,"widget_count_by_type":{"note":3},"dashboard_quality_score":0.17777490329256843}},{"id":"d9n-2k5-rjr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771120050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:31.229462Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:31.229462Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2903140490499855}},{"id":"dc4-sn4-x3c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771307251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T05:47:32.139096Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T05:47:32.139096Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2971977630543733}},{"id":"dea-tup-asp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-01-24T17:57:50.017145Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-24T17:57:50.017145Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"deh-2pa-jv8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Timeboard Wed, Mar 3, 10:57:28 am","teams":[],"created_at":"2021-03-03T09:57:28.304302Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-03-03T09:59:37.861240Z","widget_count":2,"widget_count_by_type":{"timeseries":2},"dashboard_quality_score":0.0}},{"id":"dep-fr9-h4z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771214819 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T04:06:59.939941Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T04:06:59.939941Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2937988649129915}},{"id":"dgv-rzf-sdg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771319423 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:10:23.922075Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:10:23.922075Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2976453413971817}},{"id":"dis-ra2-zyk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770918454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:35.362355Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:35.362355Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28290100657911676}},{"id":"dkd-m4y-nfc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-07-29T16:45:28.934525Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-07-29T16:45:31.392137Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"dmj-ttd-6fy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1771327303 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:43.612738Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:43.612738Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29793509178915295}},{"id":"dnm-hvh-9hw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771301219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T04:06:59.854762Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T04:06:59.854762Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2969759451139266}},{"id":"dvv-i5b-zbn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion] (cloned)","teams":[],"created_at":"2024-01-08T19:23:43.013799Z","author":{"id":"6515857","name":"Candace + Shamieh","handle":"candace.shamieh@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-08T19:42:17.791727Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"timeseries":26,"query_table":21},"dashboard_quality_score":0.0}},{"id":"dw4-m52-byx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter_1733350921 + with list_stream widget","teams":[],"created_at":"2024-12-04T22:22:01.830291Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-04T22:22:01.830291Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"dwv-37t-bd6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770846452 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:32.382782Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:32.382782Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28025332756994564}},{"id":"dyc-y4i-su4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771220851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T05:47:32.212811Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T05:47:32.212811Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29402068243087226}},{"id":"dzm-bwc-ean","type":"dashboards-usages","attributes":{"org_id":321813,"title":"ListStream","teams":[],"created_at":"2025-02-25T10:01:52.815694Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-25T10:01:52.815694Z","widget_count":1,"widget_count_by_type":{"list_stream":1},"dashboard_quality_score":0.0}},{"id":"e63-myc-uhh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Orchestrator + Writer [EP]","teams":[],"created_at":"2022-03-29T12:23:13.061726Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-03-29T12:23:13.061726Z","widget_count":57,"widget_count_by_type":{"group":7,"timeseries":47,"sunburst":3},"dashboard_quality_score":0.0}},{"id":"e7c-akg-fbj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1771327313 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:53.347737Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:53.347737Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2979354497619158}},{"id":"e7w-ted-kp5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-07-07T19:50:57.927100Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T19:50:58.454696Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"e84-h6q-8ru","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-02-03T14:05:45.526436Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-02-03T14:05:47.627593Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"e88-itr-s9c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardFreeText_import-local-1738715031","teams":[],"created_at":"2025-02-05T00:23:56.182926Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-05T00:23:56.182926Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"e8c-sk3-j9y","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-14T02:11:46.227958Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-14T02:11:46.227958Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"eg4-nui-f7r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-09T16:11:30.640663Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T16:11:31.171270Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"egd-5vg-rac","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-10T14:20:28.977761Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-10T14:20:29.512718Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"ehj-axw-7z7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T14:51:18.428821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:21:55.042874Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"ekk-7pk-gs8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771192054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:34.995462Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:34.995462Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29296175697558524}},{"id":"em8-i32-hk5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2026-04-07T14:54:38.987154Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-07T14:54:40.849696Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.1985057998232999}},{"id":"eq3-r74-a85","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T02:11:27.014458Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T02:11:27.014458Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"eqh-5b2-49v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771350454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:35.047347Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:35.047347Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29878641166115005}},{"id":"eup-drq-jnt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-03-01T16:07:22.663414Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-01T16:07:23.517492Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"exv-de7-2iw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770788850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:31.133313Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:31.133313Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27813522606833224}},{"id":"eyd-ivm-aaw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771177650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T17:47:31.208772Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T17:47:31.208772Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2924321038430591}},{"id":"ez7-i7k-kvy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardLogStream-local-1737547858","teams":[],"created_at":"2025-01-22T12:11:02.505903Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-22T12:11:02.505903Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"f2n-g2w-p8k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770838340 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T19:32:20.700785Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T19:32:20.700785Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27995504643845265}},{"id":"f3n-m8x-cyd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771148854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T09:47:35.020282Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T09:47:35.020282Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2913732162212341}},{"id":"f47-qxr-zry","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Merging + Tracking","teams":[],"created_at":"2024-08-29T15:44:56.266108Z","author":{"id":"7557262","name":"Anika + Maskara","handle":"anika.maskara@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-29T15:44:56.266108Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"f4a-76m-nbn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Screenboard Fri, Apr 16, 10:20:54 am","teams":[],"created_at":"2021-04-16T08:27:11.505665Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-16T08:49:08.310691Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"f4q-d9c-2nj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-11T14:44:24.984417Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-11T14:44:24.984417Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"f59-6bj-c7p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"[corpit] + Iroh License Check Dashboard","teams":[],"created_at":"2023-01-30T11:34:18.574271Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-30T11:34:30.591612Z","widget_count":57,"widget_count_by_type":{"query_value":28,"timeseries":11,"image":12,"list_stream":1,"toplist":2,"note":3},"dashboard_quality_score":0.0}},{"id":"f5q-i7e-ewj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"jeffallen + - pcf billing test","teams":[],"created_at":"2022-05-20T20:30:30.729505Z","author":{"id":"4053606","name":"Datadog + Support","handle":"support-ddintegrationtests321813-3920545","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-06-09T21:01:57.752118Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"f8a-ji7-qwq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1771240880 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:20.340141Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:20.340141Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2947571526788002}},{"id":"fap-y2h-r3r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771393650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:31.269914Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:31.269914Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003748144241205}},{"id":"fbk-p62-su3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770961657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T05:47:37.800370Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T05:47:37.800370Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2844896378940119}},{"id":"ffm-526-xz6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771062451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:32.260690Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:32.260690Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881960314122042}}],"meta":{"page":{"type":"offset_limit","offset":0,"first_offset":0,"limit":250,"prev_offset":null,"next_offset":250,"last_offset":500,"total":591}},"links":{"self":"https://api.datadoghq.com/api/v2/dashboards/usage","next":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=250&page[limit]=250","first":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=250","last":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=500&page[limit]=250"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v1/dashboard/wu3-x5g-reh + response: + body: '{"deleted_dashboard_id":"wu3-x5g-reh"}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..dd517513d44 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2026-05-18T14:40:30.111Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.yaml new file mode 100644 index 00000000000..85e0ca2f87a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Dashboards/Scenario_Get_usage_stats_for_all_dashboards_returns_OK_response_with_pagination.yaml @@ -0,0 +1,707 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/usage?page%5Blimit%5D=500 + response: + body: '{"data":[{"id":"22p-zw6-qia","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770895286 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:26.907249Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:26.907249Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28204906085021153}},{"id":"284-wiv-iqk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-10-21T21:02:03.739689Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-21T21:02:03.739689Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"287-waf-fua","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1770981465 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:45.310427Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:45.310427Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852179956698162}},{"id":"29x-55z-rt2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-09T22:20:08.019993Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T22:20:09.093470Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2be-q62-ep5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-06-23T00:04:08.199090Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-23T00:04:08.199090Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2cz-cim-bga","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771235251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:32.359535Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:32.359535Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2945502017336819}},{"id":"2fb-2xi-b3r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771048054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:35.029821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:35.029821Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2876666193692902}},{"id":"2fn-zr3-4jy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771249651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:32.319363Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:32.319363Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2950797141452782}},{"id":"2fp-uaa-dxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770904050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:31.270385Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:31.270385Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2823713422390794}},{"id":"2gn-qtd-zd9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:54:10.920756Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:54:57.107615Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"2m8-ht3-7kf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T02:11:27.660825Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T02:11:27.660825Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2n8-amr-8ws","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_hostmap_widget_1738642608","teams":[],"created_at":"2025-02-04T04:16:49.306022Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-04T04:16:49.306022Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2ph-z9s-3ma","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771019257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:37.816410Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:37.816410Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866076940564898}},{"id":"2qn-4hs-6nz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-06-06T18:28:02.296323Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-06T18:28:02.296323Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"2rd-dc2-4qz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"delete-me","teams":[],"created_at":"2023-04-04T07:20:20.175651Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-04-04T07:25:00.141124Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"2t6-ira-9sr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-26T16:19:46.726552Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-26T16:19:46.726552Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"2w5-uyn-tkh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771390145 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T04:49:05.674863Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T04:49:05.674863Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.30024590740843354}},{"id":"2wf-ez7-j7s","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771048050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:31.238278Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:31.238278Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28766647994426764}},{"id":"37f-p9m-n5a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_updateToRbac-local-1776085112","teams":[],"created_at":"2026-04-13T12:58:33.957713Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-13T12:58:33.957713Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.2067271396582174}},{"id":"37v-ks5-42n","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771019250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:31.237085Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:31.237085Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866074521225058}},{"id":"38e-jd2-pvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771033651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:32.276189Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:32.276189Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28713700422106986}},{"id":"3ag-svk-vks","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771379257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:37.819031Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:37.819031Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29984554137462616}},{"id":"3bd-yi5-t9f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned)","teams":[],"created_at":"2024-01-24T20:36:07.585183Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-24T20:36:07.585183Z","widget_count":42,"widget_count_by_type":{"query_value":21,"toplist":3,"note":5,"timeseries":9,"image":1,"hostmap":1,"heatmap":2},"dashboard_quality_score":0.0}},{"id":"3dh-twk-s46","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771364857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:37.812316Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:37.812316Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29931602723863215}},{"id":"3f9-4ni-c37","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + Ordered Layout Dashboard","teams":[],"created_at":"2024-10-04T18:55:30.384138Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":5,"viewed_at":"2025-08-19T14:16:27.955000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":5,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-18T19:22:40.421722Z","widget_count":19,"widget_count_by_type":{"alert_graph":2,"alert_value":2,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"query_table":1,"scatterplot":1,"servicemap":1,"timeseries":1,"toplist":1,"group":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"3gp-ihg-25a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:55:49.231714Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:55:49.231714Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3hx-aas-pkd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-09T01:07:47.665899Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-09T01:11:49.409229Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3ia-t26-3ny","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Powerpack + Test","teams":[],"created_at":"2023-09-12T17:24:07.448153Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2026-04-10T14:49:57.534000Z","viewer":{"id":"21235577","name":"Francesco + Pighi","handle":"francesco.pighi@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2023-09-12T17:24:07.448153Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.2026679121677571}},{"id":"3jf-enh-rvf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770889652 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:32.857235Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:32.857235Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2818418866977467}},{"id":"3jh-dek-qps","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-12-08T21:59:54.884830Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-08T22:00:29.988353Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"3jt-5cb-icy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-02-24T20:40:32.063650Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-02-24T20:40:33.482665Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"3kr-vna-uug","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:56:42.073944Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:56:42.073944Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"3mh-eua-8gx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771264055 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T17:47:35.437223Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T17:47:35.437223Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2956093426792953}},{"id":"3nb-3ce-ckg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1771240877 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:17.935183Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:17.935183Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29475706425980197}},{"id":"3nb-t26-7yu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771105650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:31.428318Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:31.428318Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2897845424867695}},{"id":"3uh-fgj-iu9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_events_qu_1771155581","teams":[],"created_at":"2026-02-15T11:39:41.627411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T11:39:41.627411Z","widget_count":1,"widget_count_by_type":{"distribution":1},"dashboard_quality_score":0.38882742089832584}},{"id":"3uv-rz7-km5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Proxmox + Overview host dashboards","teams":[],"created_at":"2025-07-25T19:59:43.297508Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-07-25T19:59:43.579000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-25T20:00:11.931527Z","widget_count":40,"widget_count_by_type":{"group":8,"note":5,"query_value":10,"list_stream":1,"manage_status":1,"toplist":2,"timeseries":9,"query_table":4},"dashboard_quality_score":0.0}},{"id":"3xf-myy-c3f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createAdmin-local-1774386000","teams":[],"created_at":"2026-03-24T21:00:04.874787Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-24T21:00:04.874787Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.179413786344114}},{"id":"3y3-3x5-kq8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-11-09T16:03:35.113528Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-09T16:03:47.912796Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"43b-kw6-vqr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned)","teams":[],"created_at":"2023-09-20T09:37:10.513590Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-06T14:44:10.522900Z","widget_count":42,"widget_count_by_type":{"query_value":21,"toplist":3,"note":5,"timeseries":10,"image":1,"hostmap":1,"heatmap":1},"dashboard_quality_score":0.0}},{"id":"43k-xij-6fu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771393651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:32.095399Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:32.095399Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003748447936856}},{"id":"48h-7qq-cih","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Heather''s + Dashboard Mon, Jun 30, 11:32:33 am","teams":[],"created_at":"2025-06-30T15:32:33.156114Z","author":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-06-30T15:35:37.715000Z","viewer":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-06-30T15:33:00.626392Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"49w-wru-9r3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771336054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:35.021426Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:35.021426Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2982568968329764}},{"id":"4ai-qzh-uxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771192051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:32.249226Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:32.249226Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2929616560052716}},{"id":"4b5-8v7-rh2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771336050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:31.201562Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:31.201562Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29825675636962523}},{"id":"4ic-zm9-api","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardSpans_NoHideIncompleteCostData-local-1771030254","teams":[],"created_at":"2026-02-14T00:50:57.448221Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T00:50:57.448221Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.38268289372150466}},{"id":"4ig-4ks-6c8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770990454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T13:47:35.017644Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T13:47:35.017644Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28554856336037004}},{"id":"4j8-nbn-4gi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-09-28T01:37:23.346984Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-09-28T01:37:23.346984Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"4m8-kr3-ca4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771076850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T13:47:31.252396Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T13:47:31.252396Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2887255082386866}},{"id":"4mv-u7u-ysx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_shared_dashboard_with_a_group_template_variable_returns_OK_response_1771163253 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:33.853020Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:33.853020Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29190268720160345}},{"id":"4n7-s4g-dqv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"For + dashboard list tests - DO NOT DELETE","teams":[],"created_at":"2020-02-11T13:49:29.555334Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-04-08T17:54:25.574039Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"4nf-i9k-t87","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771379250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:31.220114Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:31.220114Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2998452987181588}},{"id":"4sx-tiz-2qu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770745657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:37.768200Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:37.768200Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765469283919025}},{"id":"4td-xzm-6yq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Create_a_new_dashboard_with_a_toplist_widget_sorted_by_group-1772531926","teams":[],"created_at":"2026-03-03T09:58:47.282663Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-03T09:58:47.282663Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.34223126986457164}},{"id":"4ud-du4-pi3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-17T08:32:02.449350Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-17T08:32:02.449350Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"4uk-xyr-myu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_funnel_widget_1775734738 + with funnel widget","teams":[],"created_at":"2026-04-09T11:38:59.468470Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-09T11:38:59.468470Z","widget_count":1,"widget_count_by_type":{"funnel":1},"dashboard_quality_score":0.4600044320788619}},{"id":"4vs-2aj-87j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770731251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:32.144492Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:32.144492Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27601720770897226}},{"id":"4wp-g9w-rqp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2021-01-06T16:34:52.946050Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-06T16:34:52.946050Z","widget_count":1,"widget_count_by_type":{"change":1},"dashboard_quality_score":0.0}},{"id":"4wy-ajm-bvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-10-04T18:35:18.554744Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:35:18.554744Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"4z7-iip-zrt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-07-07T17:09:12.214893Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T17:09:12.874904Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"4zw-ifc-4pv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770745651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:32.295694Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:32.295694Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765467271576857}},{"id":"55v-ka5-rne","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770745655 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:35.397058Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:35.397058Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765468412003758}},{"id":"59f-bun-r3c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"VMware + vSphere - Overview","teams":[],"created_at":"2024-01-17T15:17:19.954644Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-17T15:17:33.545302Z","widget_count":22,"widget_count_by_type":{"image":1,"list_stream":1,"toplist":5,"timeseries":6,"note":3,"query_value":5,"check_status":1},"dashboard_quality_score":0.0}},{"id":"5bg-c69-wq9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771062450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:31.220095Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:31.220095Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881959931613793}},{"id":"5cj-8j7-qpy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Octopus + Deploy Overview","teams":[],"created_at":"2024-12-11T20:48:25.007210Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":27,"viewed_at":"2025-01-16T20:42:51.598000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":27,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-01-16T20:12:02.010750Z","widget_count":31,"widget_count_by_type":{"group":6,"note":5,"query_value":8,"list_stream":2,"toplist":2,"timeseries":1,"query_table":7},"dashboard_quality_score":0.0}},{"id":"5gx-3pv-cwk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1771327301 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:41.852380Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:41.852380Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29793502706931224}},{"id":"5i4-3c5-qby","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Sherzod''s + Dashboard Wed, Dec 20, 1:37:28 pm","teams":[],"created_at":"2023-12-20T18:37:28.853122Z","author":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-20T18:37:28.853122Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"5mk-tv6-3wt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771321657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:47:37.701536Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:47:37.701536Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2977274814953296}},{"id":"5mr-xms-2qa","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-09T22:16:56.913567Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T22:16:57.568474Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"5qz-2i3-6cq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Free Layout Dashboard","teams":[],"created_at":"2023-08-02T14:14:41.648472Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T14:14:41.648472Z","widget_count":1,"widget_count_by_type":{"event_stream":1},"dashboard_quality_score":0.0}},{"id":"5r9-yr4-f7p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770970019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T08:06:59.825960Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T08:06:59.825960Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2847971246195878}},{"id":"5ti-jks-zwd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770832051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:32.154507Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:32.154507Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27972380529638946}},{"id":"5tp-tr6-93q","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-21T13:59:15.028164Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-21T13:59:15.028164Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"5uv-zxz-4r8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771004851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T17:47:32.259530Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T17:47:32.259530Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2860779758248462}},{"id":"5vp-fxm-s4j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"PCF + Testing","teams":[],"created_at":"2022-06-08T10:40:29.941695Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":161,"viewed_at":"2026-05-15T19:53:55.277000Z","viewer":{"id":"67399597","name":"Kyle + Neale","handle":"kyle.neale@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":161,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-05-15T21:03:07.093496Z","widget_count":22,"widget_count_by_type":{"group":4,"hostmap":2,"timeseries":5,"query_table":9,"trace_service":1,"list_stream":1},"dashboard_quality_score":0.7276695720872501}},{"id":"5yv-q5c-8m3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770737540 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T15:32:20.553171Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T15:32:20.553171Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2762484437983195}},{"id":"63v-49e-a7d","type":"dashboards-usages","attributes":{"org_id":321813,"title":"sarah + test","teams":[],"created_at":"2023-05-15T18:12:47.853642Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-05-15T18:25:28.895732Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"669-8wg-nfr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770803257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T09:47:37.746546Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T09:47:37.746546Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2786649831475839}},{"id":"679-8up-bf2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2022-04-14T13:40:43.116109Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-04-14T13:40:43.116109Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"67i-fs9-rzn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Teleport + Overview","teams":[],"created_at":"2024-04-03T15:04:15.262442Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-11-01T18:56:10.280000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2024-06-04T14:49:15.193580Z","widget_count":44,"widget_count_by_type":{"group":8,"note":3,"query_value":8,"timeseries":25},"dashboard_quality_score":0.0}},{"id":"67s-cju-w7w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770832057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:37.795289Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:37.795289Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2797240127174032}},{"id":"6by-h9d-gui","type":"dashboards-usages","attributes":{"org_id":321813,"title":"MM + RBAC Dashboard","teams":[],"created_at":"2021-04-23T16:14:13.820995Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-23T16:14:13.820995Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.0}},{"id":"6e7-n4p-tdp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771033657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:37.805777Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:37.805777Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28713720754741917}},{"id":"6ez-pq7-4zk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_shared_dashboard_returns_OK_response-1689999025 + with Profile Metrics Query","teams":[],"created_at":"2023-07-22T04:10:25.713775Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-22T04:10:25.713775Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"6md-r2g-kxc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-17T03:08:25.445281Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-17T03:08:25.445281Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"6pm-2ad-2v8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-03-15T13:45:39.004786Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-15T13:45:40.299693Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"6qu-cxf-9jy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-13T12:31:40.237970Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-13T12:31:40.237970Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"6rw-fcg-izv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771105651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:32.200877Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:32.200877Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28978457088934567}},{"id":"6v2-52t-9m7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771091250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:31.249672Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:31.249672Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2892550220228939}},{"id":"6vb-yrz-ag6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770918450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:31.238722Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:31.238722Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2829008549535302}},{"id":"6vv-phh-8te","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770731257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:37.794992Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:37.794992Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2760174154837683}},{"id":"6xb-usd-min","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-12-04T15:37:35.427082Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-12-04T15:37:35.427082Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.06021835561049866}},{"id":"73p-kiw-ike","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771091251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:32.262566Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:32.262566Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2892550592686626}},{"id":"74v-m9u-yzs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Event Timeline Widget Dashboard","teams":[],"created_at":"2020-12-10T04:21:12.270024Z","author":null,"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-12-10T04:21:12.270024Z","widget_count":1,"widget_count_by_type":{"event_timeline":1},"dashboard_quality_score":0.0}},{"id":"76m-n9x-wd4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"DL + FF TF","teams":[],"created_at":"2021-02-02T13:54:05.514952Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-02-02T13:54:05.514952Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"795-wur-2am","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-14T14:17:13.784143Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-14T14:17:13.784143Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"7b3-yvp-mmq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Free Layout Dashboard","teams":[],"created_at":"2023-08-02T16:16:55.297530Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T16:16:55.297530Z","widget_count":1,"widget_count_by_type":{"event_stream":1},"dashboard_quality_score":0.0}},{"id":"7bt-mcb-a9f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2026-05-08T03:12:09.665811Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-05-08T03:12:09.665811Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.5510216256252313}},{"id":"7dp-46c-6tr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-07T16:37:56.369573Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-07T16:37:56.369573Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"7ia-ywt-ixn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770955619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T04:06:59.844956Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T04:06:59.844956Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28426761142753754}},{"id":"7j9-9in-7md","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770904051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:32.262502Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:32.262502Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2823713787104167}},{"id":"7kp-v5x-s54","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1771327312 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:52.754388Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:52.754388Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2979354279514505}},{"id":"7ns-vmc-rup","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardListStream-local-1772801028","teams":[],"created_at":"2026-03-06T12:43:50.956179Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-06T12:43:50.956179Z","widget_count":1,"widget_count_by_type":{"list_stream":1},"dashboard_quality_score":0.4695022609867474}},{"id":"7q2-h97-j2m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_items_of_a_Dashboard_List_returns_OK_response_1731709308 + with Profile Metrics Query","teams":[],"created_at":"2024-11-15T22:21:49.262821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-11-15T22:21:49.262821Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"7ui-ttk-rjb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771336051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:32.369190Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:32.369190Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2982567993000199}},{"id":"7v3-gfj-zzr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770760050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T21:47:31.212371Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T21:47:31.212371Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2770762012061138}},{"id":"7yi-rk7-7kw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770947250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:31.242266Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:31.242266Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28395988286092905}},{"id":"7ym-viw-7if","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + created using cloudformation template","teams":[],"created_at":"2024-09-27T18:25:34.741716Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-27T18:25:34.741716Z","widget_count":60,"widget_count_by_type":{"group":6,"timeseries":17,"toplist":17,"sunburst":1,"hostmap":1,"query_value":18},"dashboard_quality_score":0.0}},{"id":"823-wmx-kyk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-09T21:30:35.101006Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T21:30:36.200544Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"86h-24u-mwc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"vSphere + VM Property Metrics","teams":[],"created_at":"2023-07-18T18:13:38.804575Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-11T19:57:25.366422Z","widget_count":14,"widget_count_by_type":{"query_table":10,"treemap":1,"toplist":3},"dashboard_quality_score":0.0}},{"id":"884-jxj-d7f","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Infrastructure Overview","teams":[],"created_at":"2024-01-04T11:25:42.564360Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-05T18:05:45.334010Z","widget_count":64,"widget_count_by_type":{"note":8,"timeseries":17,"hostmap":2,"query_value":32,"toplist":3,"query_table":2},"dashboard_quality_score":0.0}},{"id":"88m-nrr-j4c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_shared_dashboard_returns_OK_response_1720742852 + with Profile Metrics Query","teams":[],"created_at":"2024-07-12T00:07:33.291059Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-12T00:07:33.291059Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"89p-5x9-mfp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T04:09:45.848591Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T04:09:45.848591Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8d7-qz3-urj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771128419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T04:06:59.945411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T04:06:59.945411Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2906217817873656}},{"id":"8ev-2hz-9yh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771364854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:35.065546Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:35.065546Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2993159262270882}},{"id":"8fj-gzg-78v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770932854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:35.023675Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:35.023675Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2834305080206865}},{"id":"8kf-ip5-ict","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Heather''s + Dashboard Fri, Aug 1, 4:48:55 pm","teams":[],"created_at":"2025-08-01T20:48:55.649802Z","author":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-08-01T20:49:40.239000Z","viewer":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-01T20:49:22.242970Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"8mr-z8r-xaq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-14T14:17:22.284588Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-14T14:17:22.284588Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"8ny-iwn-ira","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardEventTimeline-local-1776820257","teams":[],"created_at":"2026-04-22T01:11:00.774052Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-22T01:11:00.774052Z","widget_count":1,"widget_count_by_type":{"event_timeline":1},"dashboard_quality_score":0.21854470035954052}},{"id":"8qn-sx4-6py","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-30T18:57:16.337700Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-30T18:57:16.337700Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8r3-fr7-g8h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-03T11:06:05.600888Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-03T18:00:35.762592Z","widget_count":3,"widget_count_by_type":{"hostmap":1,"timeseries":1,"toplist":1},"dashboard_quality_score":0.0}},{"id":"8rp-qrc-d72","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Java-Create_a_new_dashboard_with_geomap_widget-1737861024","teams":[],"created_at":"2025-01-26T03:10:24.707218Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-26T03:10:24.707218Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"8rq-w48-cav","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1770981477 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:57.935448Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:57.935448Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852184599023656}},{"id":"8v6-29d-g7r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Timeboard + Dashboard 1769733","teams":[],"created_at":"2024-10-04T18:49:59.050042Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:49:59.050042Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"8va-as3-xfj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771099619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T20:06:59.844113Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T20:06:59.844113Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28956275028407824}},{"id":"8vg-n3m-t2r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog''s + Dashboard Mon, Sep 18, 1:11:53 pm (cloned)","teams":[],"created_at":"2023-10-13T14:28:19.062400Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-13T14:28:19.062400Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"8w6-777-dbc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-03-03T15:12:52.825402Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-03T15:12:52.825402Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8wn-wbp-bpe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771243619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T12:06:59.843565Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T12:06:59.843565Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29485788915253947}},{"id":"8yn-6s7-pue","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T01:34:46.545176Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T01:34:46.545176Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"8z4-u8g-ecy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771200419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T00:06:59.836148Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T00:06:59.836148Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2932693472130468}},{"id":"92s-2qq-7ib","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1776560567","teams":[],"created_at":"2026-04-19T01:02:52.517316Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":1,"viewed_at":"2026-05-06T16:41:02.642000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-04-19T01:02:52.517316Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.2388861655718952}},{"id":"92z-j9h-rpi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770745650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T17:47:31.175796Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T17:47:31.175796Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2765466859707376}},{"id":"96c-d6b-txk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771134451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T05:47:32.238314Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T05:47:32.238314Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2908436000413892}},{"id":"986-sdj-7f5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770947257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:37.813715Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:37.813715Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28396012450329816}},{"id":"998-r9i-nmq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770889657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:37.810139Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:37.810139Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28184206881619533}},{"id":"9bz-xsh-sd4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770976054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T09:47:35.350772Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T09:47:35.350772Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28501906171413455}},{"id":"9cb-ici-wh9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770788857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:37.728846Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:37.728846Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2781354686045877}},{"id":"9dy-6d6-92u","type":"dashboards-usages","attributes":{"org_id":321813,"title":"KubeVirt + Overview (DEV)","teams":[],"created_at":"2025-01-07T07:17:49.547882Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":10,"viewed_at":"2025-01-07T15:05:57.088000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":10,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-01-07T07:18:50.881143Z","widget_count":48,"widget_count_by_type":{"group":6,"note":1,"query_value":4,"timeseries":31,"query_table":2,"toplist":4},"dashboard_quality_score":0.0}},{"id":"9fh-bsk-dez","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-01T06:21:51.929267Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-01T06:21:51.929267Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9gp-yca-ewc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-07-03T05:06:40.070179Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-03T05:06:40.070179Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9gw-nvp-fv8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:16:01.442667Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:16:01.442667Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"9hv-ptz-8ca","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770846451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:31.833721Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:31.833721Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.280253307385377}},{"id":"9j7-b7g-fmp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-07-07T17:12:20.570681Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T17:12:21.707927Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"9km-gj8-2rj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Screenboard Fri, Apr 16, 10:20:54 am","teams":[],"created_at":"2021-04-16T08:20:54.758861Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-16T08:21:08.649752Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"9kx-z8g-k6m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770867140 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T03:32:20.633759Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T03:32:20.633759Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28101407175773013}},{"id":"9nh-zpi-6qr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770904054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:35.018170Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:35.018170Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28237148003862317}},{"id":"9qq-fww-7dt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_event_stream_list_stream_widget_1736259735 + with list_stream widget","teams":[],"created_at":"2025-01-07T14:22:16.267384Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-07T14:22:16.267384Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"9ra-4tp-6x8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-08T22:30:44.267214Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-08T22:30:44.267214Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"9re-h8a-8tw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardStyle-local-1773413743","teams":[],"created_at":"2026-03-13T14:55:46.971416Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-13T14:55:46.971416Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3746573651820967}},{"id":"9td-t9c-kk7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"VMware + vSphere - Overview","teams":[],"created_at":"2024-01-17T14:04:12.968245Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-17T16:29:07.018541Z","widget_count":22,"widget_count_by_type":{"image":1,"event_stream":1,"toplist":5,"timeseries":6,"note":3,"query_value":5,"check_status":1},"dashboard_quality_score":0.0}},{"id":"9tw-t3j-j2j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:55:33.097538Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:55:33.097538Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"9wr-ifb-ks3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + for testing","teams":[],"created_at":"2024-06-28T14:32:31.419746Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-28T14:32:31.419746Z","widget_count":2,"widget_count_by_type":{"timeseries":1,"sunburst":1},"dashboard_quality_score":0.0}},{"id":"9ze-x5d-4uk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-10-02T10:21:50.272937Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-02T10:21:50.272937Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"9zn-yrm-f5x","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + Timeboard Dashboard New1","teams":[],"created_at":"2025-08-18T19:43:21.235986Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-08-19T14:17:27.783000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-18T19:43:21.235986Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"a2m-4ke-pvn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771350450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:31.256739Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:31.256739Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2987862722785235}},{"id":"a4r-ixp-f77","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770981467 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:47.463943Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:47.463943Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852180748437294}},{"id":"aaq-h42-uug","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771292851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T01:47:32.150956Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T01:47:32.150956Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29666824960484295}},{"id":"ab7-eca-ywv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771206450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T01:47:31.251500Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T01:47:31.251500Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29349113319682957}},{"id":"anz-4xk-5rd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771163254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:35.016746Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:35.016746Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2919027299849888}},{"id":"arc-fsp-y6c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771364854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:34.823663Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:34.823663Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29931591732937646}},{"id":"asp-qkq-xha","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:47:56.046241Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:53:05.322597Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"asx-682-bd2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771019254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:35.043844Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:35.043844Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2866075920923335}},{"id":"av3-b6t-5d4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771120057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:37.800815Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:37.800815Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2903142906932992}},{"id":"axt-yuk-b8k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771186019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T20:06:59.834652Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T20:06:59.834652Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2927398332665977}},{"id":"b2p-ixy-wbd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-01T02:22:19.767227Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-01T02:22:19.767227Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"b2x-2d8-smj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"vsphere + test","teams":[],"created_at":"2023-11-15T14:29:57.863141Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-17T15:09:09.324288Z","widget_count":10,"widget_count_by_type":{"note":2,"timeseries":8},"dashboard_quality_score":0.0}},{"id":"b3e-rar-7dg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771249657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:37.710012Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:37.710012Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2950799123541292}},{"id":"b6n-8j5-2iz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned) (cloned)","teams":[],"created_at":"2023-09-26T09:00:00.247208Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-05T14:50:19.276985Z","widget_count":42,"widget_count_by_type":{"image":1,"note":5,"hostmap":1,"timeseries":9,"query_value":21,"heatmap":2,"toplist":3},"dashboard_quality_score":0.0}},{"id":"b6n-d8r-7em","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OSLO: + splunk LB ","teams":[],"created_at":"2021-05-03T13:03:46.217614Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-03T13:03:46.217614Z","widget_count":12,"widget_count_by_type":{"note":3,"slo":1,"timeseries":8},"dashboard_quality_score":0.0}},{"id":"b8u-q5n-6xn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770766340 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T23:32:20.553044Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T23:32:20.553044Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27730747156551677}},{"id":"b9v-vd2-fq2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Etiennes + Dashboard Tue, Mar 18, 3:56:32 pm","teams":[],"created_at":"2025-03-18T14:56:32.569828Z","author":{"id":"21181844","name":"Etienne + Philippe Carriere","handle":"etienne.carriere@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-03-18T14:56:32.743000Z","viewer":{"id":"21181844","name":"Etienne + Philippe Carriere","handle":"etienne.carriere@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-03-18T14:57:27.767981Z","widget_count":1,"widget_count_by_type":{"query_value":1},"dashboard_quality_score":0.0}},{"id":"ba4-5j6-8be","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771324708 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T10:38:29.056240Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T10:38:29.056240Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29783968528489124}},{"id":"bby-apf-qxh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1770981464 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:44.522761Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:44.522761Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852179666902397}},{"id":"bcy-i9m-yk2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-26T09:52:25.783725Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-26T09:52:25.783725Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bde-dby-we2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770932850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:31.228195Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:31.228195Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2834303684500229}},{"id":"bgf-jzg-b7a","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion] (shanel clone)","teams":[],"created_at":"2024-06-06T17:13:17.485112Z","author":{"id":"5620636","name":"Shanel + Huang","handle":"shanel.huang@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-06T17:28:16.789541Z","widget_count":156,"widget_count_by_type":{"group":11,"note":28,"check_status":8,"query_value":59,"query_table":24,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"bgp-uee-rt3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-03-03T15:12:51.418778Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-03T15:12:51.418778Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bjz-fmp-fv7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770774451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T01:47:32.146629Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T01:47:32.146629Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2776057494443591}},{"id":"bpc-yw5-2ai","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-11T05:06:09.509411Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-11T05:06:09.509411Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"bpj-ytu-fpt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T15:46:41.035816Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:48:05.847943Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"bru-u6k-rjq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Wisdom","teams":[],"created_at":"2021-12-15T14:39:24.510324Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-12-15T16:54:32.046189Z","widget_count":14,"widget_count_by_type":{"note":2,"timeseries":12},"dashboard_quality_score":0.0}},{"id":"brz-7z3-9w7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771027619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T00:06:59.982674Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T00:06:59.982674Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28691518593066434}},{"id":"bu8-gue-27p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bosh + AutoRelease Testing (cloned)","teams":[],"created_at":"2023-09-01T08:05:20.514088Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-08-01T12:48:01.368000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2023-09-01T08:08:49.528818Z","widget_count":11,"widget_count_by_type":{"note":1,"free_text":5,"query_table":3,"timeseries":2},"dashboard_quality_score":0.0}},{"id":"bvb-yc9-exe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"debian + (cloned)","teams":[],"created_at":"2025-08-06T16:25:39.628071Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":3,"viewed_at":"2025-08-06T16:27:42.045000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":3,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-08-06T16:28:13.557631Z","widget_count":4,"widget_count_by_type":{"timeseries":4},"dashboard_quality_score":0.0}},{"id":"bvm-3qi-iuq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771393654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:35.059151Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:35.059151Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003749537648578}},{"id":"byj-yvx-u34","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardTopologyMap-local-1772643592","teams":[],"created_at":"2026-03-04T16:59:55.987040Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-04T16:59:55.987040Z","widget_count":1,"widget_count_by_type":{"topology_map":1},"dashboard_quality_score":0.46178337183529905}},{"id":"c5w-bu2-9tj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1774284510","teams":[],"created_at":"2026-03-23T16:48:34.042558Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:48:34.042558Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.17778231076946094}},{"id":"c5z-eix-jck","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified_1742496578","teams":[],"created_at":"2025-03-20T18:49:39.343102Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-20T18:49:39.343102Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"c7v-rr4-syc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771048057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:37.791536Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:37.791536Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28766672090607276}},{"id":"ce2-rip-h9m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771235250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:31.226370Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:31.226370Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2945501600486306}},{"id":"cf8-ifs-4vf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Sherzod''s + Dashboard Wed, Dec 20, 10:34:03 am","teams":[],"created_at":"2023-12-20T15:34:03.307486Z","author":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-20T15:34:03.307486Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"ch3-ufm-3r3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771278457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T21:47:37.708347Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T21:47:37.708347Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29613894006908703}},{"id":"chp-364-vkw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1770809020 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:40.360996Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:40.360996Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788768848339404}},{"id":"cmr-azj-aw6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-13T12:31:40.386452Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-13T12:31:40.386452Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"cpe-53e-zpe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1770895295 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:35.806052Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:35.806052Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2820493880579771}},{"id":"cph-7er-div","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771379251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:32.093932Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:32.093932Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.299845330839013}},{"id":"cpz-ukf-zgw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + Overview (cloned)","teams":[],"created_at":"2026-03-17T17:42:02.849648Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":3,"viewed_at":"2026-03-18T10:28:43.858000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":3,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-03-17T17:42:02.849648Z","widget_count":69,"widget_count_by_type":{"group":5,"image":1,"query_value":24,"note":5,"timeseries":27,"toplist":4,"query_table":3},"dashboard_quality_score":0.6818860470532752}},{"id":"cqe-tb8-kag","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770881540 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T07:32:20.535221Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T07:32:20.535221Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28154358201949387}},{"id":"cw4-irn-n79","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T21:55:02.601652Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T21:55:02.601652Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"cx2-6g6-mni","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_timeseries_widget_with_legacy_live_span_time_format_1739376942 + with legacy live span time","teams":[],"created_at":"2025-02-12T16:15:43.276834Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-12T16:15:43.276834Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"cxr-rw5-dfb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"frog''s + Dashboard Wed, Oct 11, 2:07:21 pm","teams":[],"created_at":"2023-10-11T18:07:21.856517Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-11T20:32:00.487697Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"d27-b4r-765","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1771240889 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:29.190827Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:29.190827Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2947574781371176}},{"id":"d44-daj-rt3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771235254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:35.291802Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:35.291802Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29455030954105843}},{"id":"d4c-zbf-ehz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771332545 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T12:49:05.720282Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T12:49:05.720282Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29812785350879384}},{"id":"d5e-dpd-umy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Infrastructure Overview","teams":[],"created_at":"2024-01-05T16:22:20.712589Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":24,"viewed_at":"2026-02-11T14:59:44.086000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":24,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-10-28T14:33:21.452494Z","widget_count":83,"widget_count_by_type":{"group":5,"note":14,"treemap":1,"hostmap":1,"query_value":39,"timeseries":18,"toplist":3,"query_table":2},"dashboard_quality_score":0.4884871419597444}},{"id":"d7b-d5m-7jw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Proxmox + Overview","teams":[],"created_at":"2025-07-10T13:46:05.531316Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":59,"viewed_at":"2025-07-25T17:15:01.679000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":59,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-16T13:37:42.454688Z","widget_count":40,"widget_count_by_type":{"group":8,"note":5,"query_value":10,"list_stream":1,"manage_status":1,"toplist":3,"timeseries":8,"query_table":4},"dashboard_quality_score":0.0}},{"id":"d9k-7wu-vwn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardTabUpdate-local-1774284040","teams":[],"created_at":"2026-03-23T16:40:44.085796Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:40:53.238271Z","widget_count":3,"widget_count_by_type":{"note":3},"dashboard_quality_score":0.17777490329256843}},{"id":"d9n-2k5-rjr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771120050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:31.229462Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:31.229462Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2903140490499855}},{"id":"dc4-sn4-x3c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771307251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T05:47:32.139096Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T05:47:32.139096Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2971977630543733}},{"id":"dea-tup-asp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-01-24T17:57:50.017145Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-24T17:57:50.017145Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"deh-2pa-jv8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Timeboard Wed, Mar 3, 10:57:28 am","teams":[],"created_at":"2021-03-03T09:57:28.304302Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-03-03T09:59:37.861240Z","widget_count":2,"widget_count_by_type":{"timeseries":2},"dashboard_quality_score":0.0}},{"id":"dep-fr9-h4z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771214819 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T04:06:59.939941Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T04:06:59.939941Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2937988649129915}},{"id":"dgv-rzf-sdg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771319423 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:10:23.922075Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:10:23.922075Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2976453413971817}},{"id":"dis-ra2-zyk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770918454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:35.362355Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:35.362355Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28290100657911676}},{"id":"dkd-m4y-nfc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-07-29T16:45:28.934525Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-07-29T16:45:31.392137Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"dmj-ttd-6fy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1771327303 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:43.612738Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:43.612738Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29793509178915295}},{"id":"dnm-hvh-9hw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771301219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T04:06:59.854762Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T04:06:59.854762Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2969759451139266}},{"id":"dvv-i5b-zbn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion] (cloned)","teams":[],"created_at":"2024-01-08T19:23:43.013799Z","author":{"id":"6515857","name":"Candace + Shamieh","handle":"candace.shamieh@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-08T19:42:17.791727Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"timeseries":26,"query_table":21},"dashboard_quality_score":0.0}},{"id":"dw4-m52-byx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter_1733350921 + with list_stream widget","teams":[],"created_at":"2024-12-04T22:22:01.830291Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-04T22:22:01.830291Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"dwv-37t-bd6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770846452 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:32.382782Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:32.382782Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28025332756994564}},{"id":"dyc-y4i-su4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771220851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T05:47:32.212811Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T05:47:32.212811Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29402068243087226}},{"id":"dzm-bwc-ean","type":"dashboards-usages","attributes":{"org_id":321813,"title":"ListStream","teams":[],"created_at":"2025-02-25T10:01:52.815694Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-25T10:01:52.815694Z","widget_count":1,"widget_count_by_type":{"list_stream":1},"dashboard_quality_score":0.0}},{"id":"e63-myc-uhh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Orchestrator + Writer [EP]","teams":[],"created_at":"2022-03-29T12:23:13.061726Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-03-29T12:23:13.061726Z","widget_count":57,"widget_count_by_type":{"group":7,"timeseries":47,"sunburst":3},"dashboard_quality_score":0.0}},{"id":"e7c-akg-fbj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1771327313 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:53.347737Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:53.347737Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2979354497619158}},{"id":"e7w-ted-kp5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-07-07T19:50:57.927100Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T19:50:58.454696Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"e84-h6q-8ru","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-02-03T14:05:45.526436Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-02-03T14:05:47.627593Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"e88-itr-s9c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardFreeText_import-local-1738715031","teams":[],"created_at":"2025-02-05T00:23:56.182926Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-05T00:23:56.182926Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"e8c-sk3-j9y","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-14T02:11:46.227958Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-14T02:11:46.227958Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"eg4-nui-f7r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-09T16:11:30.640663Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T16:11:31.171270Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"egd-5vg-rac","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-10T14:20:28.977761Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-10T14:20:29.512718Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"ehj-axw-7z7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T14:51:18.428821Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:21:55.042874Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"ekk-7pk-gs8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771192054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:34.995462Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:34.995462Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29296175697558524}},{"id":"em8-i32-hk5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2026-04-07T14:54:38.987154Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-07T14:54:40.849696Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.1985057998232999}},{"id":"eq3-r74-a85","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T02:11:27.014458Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T02:11:27.014458Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"eqh-5b2-49v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771350454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:35.047347Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:35.047347Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29878641166115005}},{"id":"eup-drq-jnt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-03-01T16:07:22.663414Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-01T16:07:23.517492Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"exv-de7-2iw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770788850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:31.133313Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:31.133313Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27813522606833224}},{"id":"eyd-ivm-aaw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771177650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T17:47:31.208772Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T17:47:31.208772Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2924321038430591}},{"id":"ez7-i7k-kvy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardLogStream-local-1737547858","teams":[],"created_at":"2025-01-22T12:11:02.505903Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-22T12:11:02.505903Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"f2n-g2w-p8k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770838340 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T19:32:20.700785Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T19:32:20.700785Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27995504643845265}},{"id":"f3n-m8x-cyd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771148854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T09:47:35.020282Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T09:47:35.020282Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2913732162212341}},{"id":"f47-qxr-zry","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Merging + Tracking","teams":[],"created_at":"2024-08-29T15:44:56.266108Z","author":{"id":"7557262","name":"Anika + Maskara","handle":"anika.maskara@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-29T15:44:56.266108Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"f4a-76m-nbn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Hippolyte''s + Screenboard Fri, Apr 16, 10:20:54 am","teams":[],"created_at":"2021-04-16T08:27:11.505665Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-16T08:49:08.310691Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"f4q-d9c-2nj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog + API Clients CI","teams":[],"created_at":"2021-05-11T14:44:24.984417Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-05-11T14:44:24.984417Z","widget_count":10,"widget_count_by_type":{"manage_status":1,"note":3,"timeseries":3,"toplist":3},"dashboard_quality_score":0.0}},{"id":"f59-6bj-c7p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"[corpit] + Iroh License Check Dashboard","teams":[],"created_at":"2023-01-30T11:34:18.574271Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-30T11:34:30.591612Z","widget_count":57,"widget_count_by_type":{"query_value":28,"timeseries":11,"image":12,"list_stream":1,"toplist":2,"note":3},"dashboard_quality_score":0.0}},{"id":"f5q-i7e-ewj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"jeffallen + - pcf billing test","teams":[],"created_at":"2022-05-20T20:30:30.729505Z","author":{"id":"4053606","name":"Datadog + Support","handle":"support-ddintegrationtests321813-3920545","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-06-09T21:01:57.752118Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"f8a-ji7-qwq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK_response-1771240880 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:20.340141Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:20.340141Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2947571526788002}},{"id":"fap-y2h-r3r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771393650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:31.269914Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:31.269914Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3003748144241205}},{"id":"fbk-p62-su3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770961657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T05:47:37.800370Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T05:47:37.800370Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2844896378940119}},{"id":"ffm-526-xz6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771062451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:32.260690Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:32.260690Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881960314122042}},{"id":"fha-aib-dfs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771157219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T12:06:59.841448Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T12:06:59.841448Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2916807519149361}},{"id":"fhq-aq5-4nu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770947251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:32.452373Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:32.452373Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28395987353085084}},{"id":"fim-fgh-t55","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_run_workflow_widget_1737023351","teams":[],"created_at":"2025-01-16T10:29:11.940056Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-16T10:29:11.940056Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"fin-kn9-wc2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"proxmox","teams":[],"created_at":"2025-07-01T14:20:58.467945Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":25,"viewed_at":"2025-07-12T07:45:32.574000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":25,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-11T18:31:37.464487Z","widget_count":29,"widget_count_by_type":{"group":4,"timeseries":25},"dashboard_quality_score":0.0}},{"id":"fny-85t-qat","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Python-Create_a_new_dashboard_with_split_graph_widget-1734399089","teams":[],"created_at":"2024-12-17T01:31:30.428183Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-17T01:31:30.428183Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"fpr-kus-ryj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770731250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:31.224075Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:31.224075Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2760171200292463}},{"id":"frk-ke6-iy8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1770809016 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:36.982121Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:36.982121Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788767067628957}},{"id":"fs5-ib5-p7i","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771249650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:31.258110Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:31.258110Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29507962128067217}},{"id":"fst-vg2-dax","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770803254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T09:47:35.106620Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T09:47:35.106620Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2786648322416967}},{"id":"fua-njm-8vw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771321650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:47:31.273391Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:47:31.273391Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2977271912869281}},{"id":"fx7-fqc-mvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Layout Dashboard","teams":[],"created_at":"2023-08-02T16:16:55.510850Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T16:16:55.510850Z","widget_count":1,"widget_count_by_type":{"alert_graph":1},"dashboard_quality_score":0.0}},{"id":"g3b-pak-mf9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771033650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:31.232292Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:31.232292Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28713691199775704}},{"id":"g5y-dp6-qvu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-27T00:04:42.266863Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-27T00:04:42.266863Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"g9c-xme-5c8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Powerpack + Dashboard","teams":[],"created_at":"2023-09-13T20:02:37.796210Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-08T17:33:09.413127Z","widget_count":5,"widget_count_by_type":{"resolved_powerpack":2,"note":3},"dashboard_quality_score":0.0}},{"id":"g9d-nja-s56","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-12-07T15:11:01.265429Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-07T15:27:24.603106Z","widget_count":124,"widget_count_by_type":{"group":7,"note":27,"check_status":6,"query_value":37,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"gci-4wq-yzg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771134454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T05:47:34.999039Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T05:47:34.999039Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2908436477296429}},{"id":"gfb-9yf-q24","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770875257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T05:47:37.815121Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T05:47:37.815121Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2813125012819947}},{"id":"gir-v3a-33j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1771327301 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T11:21:41.184043Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T11:21:41.184043Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29793494865864156}},{"id":"gqh-m5i-xmb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771278454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T21:47:35.029109Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T21:47:35.029109Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29613878772412333}},{"id":"gr4-3zp-g2z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2025-08-12T18:23:29.890854Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-08-12T18:23:29.890854Z","widget_count":19,"widget_count_by_type":{"alert_graph":2,"alert_value":2,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"query_table":1,"scatterplot":1,"servicemap":1,"timeseries":1,"toplist":1,"group":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"gve-p9q-ij8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardSplitGraphWithStaticSplits-local-1770943736","teams":[],"created_at":"2026-02-13T00:48:58.509408Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T00:48:58.509408Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.378440879370712}},{"id":"gvv-33k-pvk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_a_timeseries_widget_and_an_overlay_request_1772912350","teams":[],"created_at":"2026-03-07T19:39:10.530359Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-07T19:39:10.530359Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3562200627868155}},{"id":"h35-e77-y7b","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-08-29T19:53:19.113620Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-29T19:54:10.579886Z","widget_count":130,"widget_count_by_type":{"group":7,"note":29,"check_status":7,"query_value":41,"query_table":20,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"h39-2vx-x5t","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}} + fooo","teams":[],"created_at":"2024-09-23T17:13:29.658664Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-23T17:13:29.658664Z","widget_count":1,"widget_count_by_type":{"query_table":1},"dashboard_quality_score":0.0}},{"id":"h4n-bfi-dg5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"KubeVirt + Overview","teams":[],"created_at":"2024-07-25T09:17:13.681827Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":11,"viewed_at":"2026-03-17T11:13:57.801000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":11,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2024-08-27T10:34:25.951925Z","widget_count":47,"widget_count_by_type":{"group":6,"note":1,"query_value":3,"timeseries":31,"query_table":2,"toplist":4},"dashboard_quality_score":0.6765049050287929}},{"id":"h7j-v4q-aeu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-23T13:34:48.246025Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-23T13:34:49.033289Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"h8e-vwj-uy8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-07-29T16:48:46.701592Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-07-29T16:48:49.599967Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"hbt-4iu-bgf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771364851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:32.088198Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:32.088198Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29931576291374656}},{"id":"hci-dg5-pcw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770860850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T01:47:31.233299Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T01:47:31.233299Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28078274536641984}},{"id":"hgg-6id-sxi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771364850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T21:47:31.252025Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T21:47:31.252025Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2993157321660844}},{"id":"hhk-abu-qhx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770846454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:35.072464Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:35.072464Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28025337265045125}},{"id":"hiu-7x9-6yd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_dashboard_with_tags_returns_OK_response_1737087532 + with Profile Metrics Query","teams":[],"created_at":"2025-01-17T04:18:53.051598Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-17T04:18:53.051598Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"hj6-ipc-vnt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771375745 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T00:49:05.688419Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T00:49:05.688419Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2997163401786084}},{"id":"hkf-az9-56r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771278451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T21:47:32.143583Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T21:47:32.143583Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29613868161678025}},{"id":"hmq-j67-sh4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770760057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T21:47:37.753017Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T21:47:37.753017Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27707638788572336}},{"id":"hn6-a2w-7fv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Restore_deleted_dashboards_returns_No_Content_response_1686850305 + with Profile Metrics Query","teams":[],"created_at":"2023-06-15T17:31:45.390220Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-15T17:31:45.390220Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"hnu-4qe-fvz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1770895296 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:36.453529Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:36.453529Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28204935804093045}},{"id":"hs8-tys-qhc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771361345 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T20:49:05.678998Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T20:49:05.678998Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29918682594310025}},{"id":"hsz-pvn-gie","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2021-01-21T11:01:38.594211Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-21T11:01:39.149109Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"hur-yk4-4ey","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-12-08T20:49:20.928521Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-08T21:46:33.784247Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"hva-8qq-6uj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770941219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T00:06:59.976316Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T00:06:59.976316Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28373804853660095}},{"id":"hxi-98c-yqx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770939349 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T23:35:50.276296Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T23:35:50.276296Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2836692963054088}},{"id":"hyq-he9-mmv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-11-16T14:53:07.236859Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-11-16T14:53:08.023820Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"i39-nvs-35n","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-02T05:06:26.825469Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-02T05:06:26.825469Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"i3a-pej-zyf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_items_of_a_dashboard_list_returns_OK_response_1775396854 + with Profile Metrics Query","teams":[],"created_at":"2026-04-05T13:47:35.961706Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-05T13:47:35.961706Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.4475797942376382}},{"id":"i4v-bun-dyh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770875254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T05:47:35.059786Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T05:47:35.059786Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2813123999612713}},{"id":"i69-4v4-2bm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771042019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T04:06:59.847433Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T04:06:59.847433Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2874446410192663}},{"id":"i6q-quy-cn2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:23:19.837734Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:34:00.011483Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"ia3-mtz-d4e","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Timeboard","teams":[],"created_at":"2020-12-09T04:18:00.388550Z","author":null,"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-12-09T04:18:00.388550Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"ici-7ph-caf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Sherzod''s + Dashboard Tue, Jul 22, 4:11:18 pm","teams":[],"created_at":"2025-07-22T20:11:18.893031Z","author":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-07-22T20:11:18.990000Z","viewer":{"id":"1725336","name":"Sherzod + Karimov","handle":"sherzod.karimov@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-07-22T20:11:18.893031Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"icm-2nb-fqa","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_powerpack_widget_1777491570 + with powerpack widget","teams":[],"created_at":"2026-04-29T19:39:31.637538Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-29T19:39:31.637538Z","widget_count":2,"widget_count_by_type":{"resolved_powerpack":1,"note":1},"dashboard_quality_score":0.22933606802183215}},{"id":"iic-aki-a5y","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2022-05-22T00:22:49.406365Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-05-22T00:22:49.406365Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"iju-c6t-i9w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1776344469","teams":[],"created_at":"2026-04-16T13:01:12.379351Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-16T13:01:12.379351Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.21089632943211262}},{"id":"ikj-7sf-urr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Send_shared_dashboard_invitation_email_returns_OK-1777635146 + with Profile Metrics Query","teams":[],"created_at":"2026-05-01T11:32:26.883662Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-05-01T11:32:26.883662Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.5298857755250498}},{"id":"ims-k7p-2yr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770774450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T01:47:31.177165Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T01:47:31.177165Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27760565996732883}},{"id":"iqb-wzk-7ab","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_new_dashboard_with_powerpack_widget-1745381568 + with powerpack widget","teams":[],"created_at":"2025-04-23T04:12:49.950553Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-04-23T04:12:49.950553Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"it8-zmc-esc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-03-01T16:10:54.233168Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-01T16:10:55.754868Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"itk-kp7-hnt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1775042684","teams":[],"created_at":"2026-04-01T11:24:44.486017Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-01T11:24:44.486017Z","widget_count":1,"widget_count_by_type":{"geomap":1},"dashboard_quality_score":0.5794083631095576}},{"id":"ivx-9cb-hq6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-03-01T15:32:14.718423Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-01T15:32:15.878992Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"ixb-r7f-4t7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1770895284 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:24.472378Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:24.472378Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28204891747099853}},{"id":"j5f-c53-m7h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771264051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T17:47:32.134656Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T17:47:32.134656Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2956091673979945}},{"id":"j6w-fex-8fn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2021-04-15T16:42:07.677880Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-15T16:42:08.423227Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"j7n-hzp-9g6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770961650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T05:47:31.236004Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T05:47:31.236004Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2844893426862045}},{"id":"j82-fmx-4nd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-23T10:21:50.450445Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-23T10:21:50.450445Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"jad-5wi-r7k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-06T20:25:05.406527Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T20:25:05.406527Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"jcd-pci-xxw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Datadog''s + 111222333, Sep 18, 1:11:53 pm (cloned)","teams":[],"created_at":"2023-10-13T15:06:17.052642Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-13T15:10:51.018368Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"jdg-iyk-u68","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771013219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T20:06:59.835930Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T20:06:59.835930Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28638561281738173}},{"id":"je2-bwi-ces","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OSLO: + systemid LB on c2c","teams":[],"created_at":"2021-04-26T09:58:20.982778Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-26T09:58:20.982778Z","widget_count":12,"widget_count_by_type":{"slo":2,"timeseries":8,"note":2},"dashboard_quality_score":0.0}},{"id":"jjb-268-6ty","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770990450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T13:47:31.216346Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T13:47:31.216346Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2855483697408571}},{"id":"jjp-ch8-h4j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"VMware + vSphere - Overview (cloned)","teams":[],"created_at":"2024-05-20T15:14:34.623626Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-20T15:14:34.623626Z","widget_count":22,"widget_count_by_type":{"image":1,"list_stream":1,"toplist":5,"timeseries":6,"note":3,"query_value":5,"check_status":1},"dashboard_quality_score":0.0}},{"id":"jmm-8iu-zxy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771105657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:37.798321Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:37.798321Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28978472288289914}},{"id":"jv5-3t6-dhm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770803251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T09:47:32.134035Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T09:47:32.134035Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27866472293021327}},{"id":"jzw-2ff-srb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2022-04-14T13:40:43.341283Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-04-14T13:40:43.341283Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"k64-a3e-t6p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-03-15T13:39:50.094390Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-15T13:39:51.376388Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"k6t-qmr-suz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770817657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T13:47:37.815602Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T13:47:37.815602Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2791944457404275}},{"id":"k7b-e3u-xry","type":"dashboards-usages","attributes":{"org_id":321813,"title":"ESXi + Overview","teams":[],"created_at":"2024-05-02T18:54:09.468977Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-02T18:54:09.468977Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"k7z-635-c9t","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1771240878 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:18.552603Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:18.552603Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29475703312282225}},{"id":"k8e-pk3-v62","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771350457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:37.719339Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:37.719339Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2987864560894199}},{"id":"kb8-ypz-n53","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_updateToOpen-local-1774386000","teams":[],"created_at":"2026-03-24T21:00:04.835505Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-24T21:00:04.835505Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.1794137621758809}},{"id":"kbs-rk4-duq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2026-04-07T15:00:45.235569Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-07T15:00:47.169389Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.198511664919629}},{"id":"kf4-nik-f6k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-30T18:19:33.856132Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-30T18:19:33.856132Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"knt-yhu-hpm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771134457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T05:47:37.798656Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T05:47:37.798656Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29084375067256013}},{"id":"kpx-rp2-pku","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Applications Overview","teams":[],"created_at":"2023-12-27T11:09:57.984811Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":25,"viewed_at":"2026-03-13T16:18:30.149000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":25,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-02-26T14:43:47.176438Z","widget_count":18,"widget_count_by_type":{"note":3,"query_table":3,"query_value":4,"toplist":1,"group":2,"list_stream":4,"timeseries":1},"dashboard_quality_score":0.5751010212464215}},{"id":"kqz-yw2-egk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"PCF + Nozzle Testing (cloned)","teams":[],"created_at":"2023-09-07T11:31:05.567145Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":4,"viewed_at":"2025-09-25T08:30:09.388000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":4,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2023-11-13T15:10:51.833223Z","widget_count":13,"widget_count_by_type":{"note":1,"timeseries":12},"dashboard_quality_score":0.0}},{"id":"kr8-sth-skv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-07-13T16:47:06.137747Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-07-13T16:47:09.905432Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"kuh-3m3-gjz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770832054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:35.341020Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:35.341020Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2797238686339754}},{"id":"kuj-pxv-rqh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"MM + RBAC Dashboard [0.11]","teams":[],"created_at":"2021-04-23T16:04:56.337388Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-23T16:04:56.337388Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.0}},{"id":"kuy-fjj-ehs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771163251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:32.262798Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:32.262798Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29190257488659394}},{"id":"kvk-jwi-37u","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771307257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T05:47:37.709786Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T05:47:37.709786Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29719791407098844}},{"id":"kxa-sp2-74z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770852740 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T23:32:20.551060Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T23:32:20.551060Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2804845009956925}},{"id":"kzt-umz-d58","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771235257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T09:47:37.758294Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T09:47:37.758294Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2945503464101968}},{"id":"m2z-nxy-gng","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_hostmap_widget_1771875473","teams":[],"created_at":"2026-02-23T19:37:54.214806Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-23T19:37:54.214806Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.3180922565225343}},{"id":"m3a-qxx-d6r","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Timeboard + Dashboard 1769733","teams":[],"created_at":"2024-10-04T18:54:20.931820Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:54:20.931820Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"m4c-fbu-app","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770889650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:31.239988Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:31.239988Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28184177338691263}},{"id":"m6j-yxy-63i","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770984419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T12:06:59.945352Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T12:06:59.945352Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2853265890620343}},{"id":"m6r-3ej-jxw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770774455 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T01:47:35.427195Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T01:47:35.427195Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2776058162468569}},{"id":"m7f-z42-mqz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771171619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T16:06:59.825340Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T16:06:59.825340Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2922102652044626}},{"id":"m9r-ahk-jvv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770961651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T05:47:32.227054Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T05:47:32.227054Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2844893791274094}},{"id":"m9y-ypx-vnq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771076851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T13:47:32.231433Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T13:47:32.231433Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2887254903995061}},{"id":"md9-pz9-6b4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771019251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T21:47:32.213094Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T21:47:32.213094Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28660743416955375}},{"id":"mga-3eq-huq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770904057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T13:47:37.792529Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T13:47:37.792529Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28237152822426376}},{"id":"mi5-sqr-9m2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + - Overview","teams":[],"created_at":"2026-05-04T11:19:35.299294Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":23,"viewed_at":"2026-05-06T09:01:53.686000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":23,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-05-05T10:03:49.098842Z","widget_count":70,"widget_count_by_type":{"group":5,"image":1,"query_value":24,"note":5,"timeseries":27,"toplist":4,"query_table":4},"dashboard_quality_score":0.9537731589444708}},{"id":"mjt-uva-tcy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-24T08:09:00.562026Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-24T08:09:01.756390Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"mjz-cki-kb2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771315619 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T08:06:59.860427Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T08:06:59.860427Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29750540538316317}},{"id":"mmd-vfp-cq4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Python-Create_a_new_dashboard_with_slo_widget-1738632660","teams":[],"created_at":"2025-02-04T01:31:02.435234Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-04T01:31:02.435234Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"mn2-fep-8nf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771229219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T08:06:59.848817Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T08:06:59.848817Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29432832162282835}},{"id":"mv6-3rt-tc2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2025-03-26T09:52:26.162275Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-03-26T09:52:26.162275Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"mvr-w9x-3k3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + Overview (cloned)","teams":[],"created_at":"2026-03-18T16:59:48.879523Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2026-03-18T16:59:49.425000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-03-18T17:01:10.201405Z","widget_count":68,"widget_count_by_type":{"group":5,"image":1,"query_value":24,"note":5,"timeseries":26,"toplist":4,"query_table":3},"dashboard_quality_score":0.68339479853999}},{"id":"mwq-dft-mdy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771292854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T01:47:35.360130Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T01:47:35.360130Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2966683137799872}},{"id":"mwr-ife-dth","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{ + unique }} with list_stream widget","teams":[],"created_at":"2023-03-02T20:48:56.368879Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-02T20:48:56.368879Z","widget_count":1,"widget_count_by_type":{"list_stream":1},"dashboard_quality_score":0.0}},{"id":"mzm-ewd-b4z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1770981477 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T11:17:57.206693Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T11:17:57.206693Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2852183792700707}},{"id":"n34-ds2-bgt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771177655 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T17:47:35.566388Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T17:47:35.566388Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2924322102532195}},{"id":"n3s-7ng-nig","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770924949 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T19:35:49.807231Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T19:35:49.807231Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2831397651645579}},{"id":"n4f-d26-7fs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T15:28:08.943107Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:28:08.943107Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"n54-fmb-2fu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771091254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:35.028797Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:35.028797Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28925510715155417}},{"id":"n5x-wj3-tt8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-11-16T14:55:32.325509Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-11-16T14:55:33.604225Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"n78-tuq-8vj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770817651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T13:47:32.082521Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T13:47:32.082521Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2791942349227222}},{"id":"n86-f3u-tw7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-09-12T15:21:09.903112Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-12T15:21:55.038682Z","widget_count":7,"widget_count_by_type":{"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"note":1,"alert_graph":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"n9p-fvb-t9h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Restore_deleted_dashboards_returns_No_Content_response_1774870746 + with Profile Metrics Query","teams":[],"created_at":"2026-03-30T11:39:06.469986Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-30T11:39:06.469986Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.42823380236295056}},{"id":"nb6-uk2-r2p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + created using cloudformation template","teams":[],"created_at":"2024-09-27T18:21:01.500799Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-27T18:21:01.500799Z","widget_count":60,"widget_count_by_type":{"group":6,"timeseries":17,"toplist":17,"sunburst":1,"hostmap":1,"query_value":18},"dashboard_quality_score":0.0}},{"id":"ncn-sgy-3ck","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771206451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T01:47:32.262378Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T01:47:32.262378Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2934911165362011}},{"id":"ncv-h4k-4it","type":"dashboards-usages","attributes":{"org_id":321813,"title":"ESXi + Overview","teams":[],"created_at":"2024-05-02T19:01:10.511984Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-24T15:00:11.787094Z","widget_count":30,"widget_count_by_type":{"group":6,"note":3,"query_value":2,"query_table":5,"toplist":4,"timeseries":10},"dashboard_quality_score":0.0}},{"id":"nea-tsg-ni5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771336057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T13:47:37.764018Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T13:47:37.764018Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29825694384129997}},{"id":"neh-3bi-sgi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-01T00:04:03.352407Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-01T00:04:03.352407Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"ng3-gvu-zgp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Add_custom_timeboard_dashboard_to_an_existing_dashboard_list_returns_OK_response_1765720055 + with Profile Metrics Query","teams":[],"created_at":"2025-12-14T13:47:36.122990Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-12-14T13:47:36.122990Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.04010774506273651}},{"id":"ngv-2vy-9s7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Heather''s + Dashboard Mon, Jun 30, 11:35:52 am","teams":[],"created_at":"2025-06-30T15:35:52.842719Z","author":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views":2,"viewed_at":"2025-06-30T15:36:00.513000Z","viewer":{"id":"36842569","name":"Heather + Dinh","handle":"heather.dinh@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":2,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-06-30T15:35:58.767438Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"ni6-8fj-4qa","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-09T01:31:58.083575Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-09T01:31:58.083575Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"nng-79x-qi9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770860855 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T01:47:35.375200Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T01:47:35.375200Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2807828976665561}},{"id":"ntb-xfa-b76","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771177657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T17:47:37.876953Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T17:47:37.876953Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29243229521603464}},{"id":"ntb-zhs-zc6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OSLO: + systemid LB on starbug","teams":[],"created_at":"2021-04-26T09:59:02.371956Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-26T09:59:02.371956Z","widget_count":12,"widget_count_by_type":{"slo":2,"timeseries":8,"note":2},"dashboard_quality_score":0.0}},{"id":"ntg-i6e-bg3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-02-29T22:03:38.377385Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-02-29T22:03:38.377385Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"nw4-esx-am2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_manage_status_widget_1769297872","teams":[],"created_at":"2026-01-24T23:37:52.540898Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-01-24T23:37:52.540898Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.09762151206855735}},{"id":"nwk-33e-rqs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771076857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T13:47:37.807097Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T13:47:37.807097Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28872569542492}},{"id":"ny8-n52-tqc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771163250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:31.349591Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:31.349591Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2919025413041095}},{"id":"p3k-7zr-wpr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenTelemetry + Collector Metrics Dashboard (with equiv_otel)","teams":[],"created_at":"2025-04-10T13:39:12.520913Z","author":{"id":"5620636","name":"Shanel + Huang","handle":"shanel.huang@datadoghq.com","is_disabled":false},"total_views":2,"viewed_at":"2025-04-10T13:39:22.716000Z","viewer":{"id":"5620636","name":"Shanel + Huang","handle":"shanel.huang@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":2,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-04-10T13:39:21.857795Z","widget_count":75,"widget_count_by_type":{"group":8,"note":10,"timeseries":50,"query_table":6,"query_value":1},"dashboard_quality_score":0.0}},{"id":"p3v-g5w-f7h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-06T20:25:05.998637Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T20:25:05.998637Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"p64-8q6-as6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-09T01:44:16.923835Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-09T02:23:31.421819Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"p6f-bt4-6mx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-30T18:19:34.472771Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-30T18:19:34.472771Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"p76-664-fjj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771379255 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T01:47:35.411620Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T01:47:35.411620Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2998453990053086}},{"id":"p7m-uv2-k7z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770947254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T01:47:35.344786Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T01:47:35.344786Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28395997988100113}},{"id":"p8w-deq-k6x","type":"dashboards-usages","attributes":{"org_id":321813,"title":"CRP-176","teams":[],"created_at":"2022-08-24T14:10:40.232901Z","author":{"id":"4326960","name":"Datadog + Support","handle":"support-ddintegrationtests321813-4240449","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-08-24T14:10:47.209726Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"pdr-4wh-22s","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771278450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T21:47:31.239863Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T21:47:31.239863Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29613864837997744}},{"id":"pj7-aps-g42","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-10-04T18:54:21.314190Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:54:21.314190Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"pkn-mfc-873","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Delete_a_dashboard_returns_OK_response_1757101036 + with Profile Metrics Query","teams":[],"created_at":"2025-09-05T19:37:16.888719Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-09-05T19:37:16.888719Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"pn7-37s-qca","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771321651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:47:32.156871Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:47:32.156871Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2977272237665472}},{"id":"pq5-uya-4if","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770823940 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T15:32:20.497756Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T15:32:20.497756Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.279425471255169}},{"id":"pra-83a-gm3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Fly.io + Overview ","teams":[],"created_at":"2024-07-17T18:16:25.227238Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-30T22:03:35.055528Z","widget_count":33,"widget_count_by_type":{"group":6,"note":3,"query_value":2,"check_status":1,"toplist":2,"query_table":5,"hostmap":1,"treemap":1,"timeseries":12},"dashboard_quality_score":0.0}},{"id":"ps4-z69-pes","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771056419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T08:06:59.946094Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T08:06:59.946094Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2879741585311765}},{"id":"pt8-4pn-jw6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-03-01T15:29:54.911262Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-01T15:29:55.700607Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"ptm-3j4-ivd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770774457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T01:47:37.749070Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T01:47:37.749070Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2776059016237446}},{"id":"pu8-4pr-9v2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2021-01-21T14:01:08.820798Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-21T14:01:09.882536Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"pv5-p65-yis","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-12-11T18:22:19.897944Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-11T18:22:19.897944Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"pwp-jjs-reu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771091257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T17:47:37.800704Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T17:47:37.800704Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2892552090778554}},{"id":"pzz-ksp-bip","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Scaphandre + Overview","teams":[],"created_at":"2024-05-16T19:33:20.983978Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-16T19:33:20.983978Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"q5j-nti-fv6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"For + dashboard list tests - DO NOT DELETE","teams":[],"created_at":"2020-02-11T13:48:52.362473Z","author":{"id":"1379828","name":"Hippolyte + Henry","handle":"hippolyte.henry@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2020-02-11T13:49:16.919666Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"q5p-k9m-btm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-07-22T18:22:19.757565Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-22T18:22:19.757565Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"q5z-8cr-k7v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Run + workflow terraform dashboard","teams":[],"created_at":"2023-02-15T20:13:30.498477Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-02-15T20:13:30.498477Z","widget_count":1,"widget_count_by_type":{"run_workflow":1},"dashboard_quality_score":0.0}},{"id":"q94-hec-aga","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771142819 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T08:07:00.320172Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T08:07:00.320172Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29115125561964306}},{"id":"q9c-n75-4rq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-12-13T22:22:19.842417Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-13T22:22:19.842417Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"q9q-cgi-xfz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771220854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T05:47:35.075347Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T05:47:35.075347Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.294020733861316}},{"id":"qbi-qnr-yz8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771114019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T00:07:00.339807Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T00:07:00.339807Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29009222856376027}},{"id":"qc7-v9m-xqv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2023-12-08T19:58:04.706734Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-12-08T23:55:47.131235Z","widget_count":2,"widget_count_by_type":{"resolved_powerpack":1,"note":1},"dashboard_quality_score":0.0}},{"id":"qcr-t4m-v3k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Kepler + Overview ","teams":[],"created_at":"2024-05-23T18:18:30.546120Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-23T19:17:16.197535Z","widget_count":8,"widget_count_by_type":{"group":2,"note":2,"query_table":1,"query_value":2,"sunburst":1},"dashboard_quality_score":0.0}},{"id":"qd5-u4z-i8z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-12-27T04:11:24.143503Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-27T04:11:24.143503Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"qdx-v94-g8h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771346945 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T16:49:05.714864Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T16:49:05.714864Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2986573133668909}},{"id":"qhf-em6-2i3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-23T13:37:35.644378Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-23T13:37:36.923776Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"qhn-9tk-agd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771307250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T05:47:31.247004Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T05:47:31.247004Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29719767641932715}},{"id":"qi6-q9m-tpv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-08T22:31:11.506879Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-08T22:31:11.506879Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"qmz-925-umx","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-10T14:22:53.864848Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-10T14:22:54.795680Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"qn2-but-2r8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2021-03-01T08:29:54.466356Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-03-01T08:29:54.466356Z","widget_count":2,"widget_count_by_type":{"event_stream":1,"image":1},"dashboard_quality_score":0.0}},{"id":"qpy-d9b-2bv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2021-01-06T10:48:02.242118Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-06T10:48:02.242118Z","widget_count":1,"widget_count_by_type":{"alert_graph":1},"dashboard_quality_score":0.0}},{"id":"qqq-dfc-xdw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770860851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T01:47:32.344538Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T01:47:32.344538Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2807827862219004}},{"id":"qr4-kgv-2qp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770832050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T17:47:31.250081Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T17:47:31.250081Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27972371819893393}},{"id":"qup-ydj-93n","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_new_dashboard_with_manage_status_widget_and_show_priority_parameter-1738728686","teams":[],"created_at":"2025-02-05T04:11:26.503360Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-02-05T04:11:26.503360Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"qxx-jfk-v42","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-24T15:14:41.219203Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-24T15:14:41.219203Z","widget_count":1,"widget_count_by_type":{"distribution":1},"dashboard_quality_score":0.0}},{"id":"qyf-43n-ett","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771120051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:32.346172Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:32.346172Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2903140362818289}},{"id":"qzi-r5y-r98","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771004857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T17:47:37.831140Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T17:47:37.831140Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28607812686281603}},{"id":"qzq-ecf-9wt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + test dashboard","teams":[],"created_at":"2024-10-04T18:55:30.675257Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-09-17T20:47:39.224000Z","viewer":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-09-17T21:22:14.874791Z","widget_count":3,"widget_count_by_type":{"toplist":3},"dashboard_quality_score":0.0}},{"id":"rcn-b3p-kkk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-03-04T17:35:14.272142Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-03-04T17:35:16.152659Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"rcn-mvm-599","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1770809033 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:53.649798Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:53.649798Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788773196542815}},{"id":"riw-awx-8jb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771292850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T01:47:31.297463Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T01:47:31.297463Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.296668164385366}},{"id":"rj7-qir-ztd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-11-24T04:11:51.944178Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-11-24T04:11:51.944178Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"rm8-k6t-8m4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-10-04T18:49:59.470703Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:49:59.470703Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"rmu-unn-gcq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-07-13T16:50:32.341526Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-07-13T16:50:35.610164Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"rn6-u8f-7yk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_sunburst_widget_and_metrics_data_1734531717","teams":[],"created_at":"2024-12-18T14:21:57.983817Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-18T14:21:57.983817Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"rpj-3af-hiy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_returns_OK_response-1770809032 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:52.461448Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:52.461448Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.278877275956298}},{"id":"rrq-mav-byg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:16:29.780792Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:18:38.540849Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"rsw-epy-tv6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Bruce + test","teams":[],"created_at":"2024-10-10T20:26:42.166692Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-11T20:04:05.520446Z","widget_count":1,"widget_count_by_type":{"distribution":1},"dashboard_quality_score":0.0}},{"id":"rt5-yit-kkz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Octopus + Deploy Overview","teams":[],"created_at":"2024-12-02T17:57:23.397063Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-01-03T18:22:09.527000Z","viewer":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2024-12-11T14:54:48.862172Z","widget_count":7,"widget_count_by_type":{"query_value":1,"timeseries":4,"query_table":2},"dashboard_quality_score":0.0}},{"id":"rvp-h5j-zhk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-08T22:25:11.372571Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-08T22:26:34.329161Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"rvw-uxs-a32","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-03T19:56:05.033591Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T21:38:18.943692Z","widget_count":3,"widget_count_by_type":{"toplist":3},"dashboard_quality_score":0.0}},{"id":"rxn-bgr-4pd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771070819 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T12:06:59.927905Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T12:06:59.927905Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28850367174954267}},{"id":"rxz-fpe-m5m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770803250 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T09:47:31.134011Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T09:47:31.134011Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2786646861522748}},{"id":"s2z-dpr-nch","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771062457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:37.794367Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:37.794367Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881961810654695}},{"id":"s45-bgf-vnz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771004854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T17:47:35.042730Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T17:47:35.042730Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28607802432722373}},{"id":"s63-52i-i2s","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_items_of_a_dashboard_list_returns_OK_response-1776857985 + with Profile Metrics Query","teams":[],"created_at":"2026-04-22T11:39:46.468170Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-22T11:39:46.468170Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.5013081898315233}},{"id":"s9x-ukk-vg8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770896149 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:35:49.798670Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:35:49.798670Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28208073706847986}},{"id":"se5-psv-5aq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_a_shared_dashboard_returns_OK_response-1770809015 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:23:35.759895Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:23:35.759895Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788766618096723}},{"id":"sev-b86-nvt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771134450 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T05:47:31.208619Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T05:47:31.208619Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2908435083399243}},{"id":"sjj-bbz-4fh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770961654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T05:47:35.013916Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T05:47:35.013916Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.284489481600835}},{"id":"smz-8nn-fq9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770795140 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T07:32:20.558975Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T07:32:20.558975Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27836644572635333}},{"id":"sn2-z5s-m48","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1772651802","teams":[],"created_at":"2026-03-04T19:16:45.379010Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-04T19:16:45.379010Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.1515363274948051}},{"id":"snm-5mz-keg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770788851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:32.172835Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:32.172835Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2781352104623911}},{"id":"spn-xej-z4k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771004850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T17:47:31.244678Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T17:47:31.244678Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28607788466568695}},{"id":"ssh-b9p-hyp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770932851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:32.249149Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:32.249149Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2834303521574139}},{"id":"stu-5eb-fje","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-02-24T20:37:44.551755Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-02-24T20:37:45.473803Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"su8-kbt-qqk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"frog''s + Dashboard Mon, Oct 23, 12:43:30 pm","teams":[],"created_at":"2023-10-23T16:43:31.132952Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-23T16:43:31.132952Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"suf-n3q-967","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-05-03T02:13:09.132180Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-03T02:13:09.132180Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"suy-p6f-w4x","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardImage-local-1774283696","teams":[],"created_at":"2026-03-23T16:34:59.925611Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:34:59.925611Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.1777692002216646}},{"id":"sv6-maw-zx9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-11-28T01:44:57.326488Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-11-28T01:44:57.326488Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"sz9-v6m-pfd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771085219 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T16:06:59.829425Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T16:06:59.829425Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2890331820163507}},{"id":"t23-rdu-axh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770760051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T21:47:32.131630Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T21:47:32.131630Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2770761811690509}},{"id":"t3h-vti-thz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770889654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T09:47:35.346619Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T09:47:35.346619Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28184192438993766}},{"id":"t4p-5tf-m3v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770932857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T21:47:37.802978Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T21:47:37.802978Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28343055638130416}},{"id":"t4y-ejp-6je","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Get_all_invitations_for_a_shared_dashboard_returns_OK_response-1770895285 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:21:25.115315Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:21:25.115315Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2820489411062356}},{"id":"t5a-y6c-yr8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-12-27T04:11:24.943377Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-27T04:11:24.943377Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"t66-nfh-e25","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2022-09-12T19:54:19.969611Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-09-12T19:57:12.275290Z","widget_count":1,"widget_count_by_type":{"topology_map":1},"dashboard_quality_score":0.0}},{"id":"t7i-u49-9p6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Noueman''s + Dashboard Thu, Nov 9, 5:03:34 pm","teams":[],"created_at":"2023-11-09T16:03:34.595627Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-09T16:03:34.595627Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"t7u-438-bc3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770846457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T21:47:37.800716Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T21:47:37.800716Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2802534729645247}},{"id":"t96-xj5-uby","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_items_of_a_dashboard_list_returns_OK_response_1773395254 + with Profile Metrics Query","teams":[],"created_at":"2026-03-13T09:49:06.691575Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-13T09:49:06.691575Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.3739806999745111}},{"id":"taf-afu-akt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-23T07:59:08.905416Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-23T07:59:09.903936Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"tah-74k-qkj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771177651 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T17:47:32.276807Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T17:47:32.276807Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29243208928480124}},{"id":"tfa-ti2-2bf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771264050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T17:47:31.243948Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T17:47:31.243948Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2956091346380063}},{"id":"tgf-iq6-ujs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-30T18:22:19.797309Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-30T18:22:19.797309Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"tk5-sp2-ckj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardQueryTable-local-1776042164","teams":[],"created_at":"2026-04-13T01:02:48.283396Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-13T01:02:48.283396Z","widget_count":2,"widget_count_by_type":{"query_table":2},"dashboard_quality_score":0.5588747114596979}},{"id":"tkn-wg4-sr3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_returns_OK_response_1718648515 + with Profile Metrics Query","teams":[],"created_at":"2024-06-17T18:21:55.846134Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-06-17T18:21:55.846134Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"tmu-kzd-aez","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770976050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T09:47:31.245861Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T09:47:31.245861Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2850188569304273}},{"id":"tpx-acq-vck","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770998819 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T16:06:59.820827Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T16:06:59.820827Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2858560983661291}},{"id":"tpx-f7m-z57","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{ + unique }}","teams":[],"created_at":"2023-09-12T19:44:24.710209Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-09-12T19:44:24.710209Z","widget_count":1,"widget_count_by_type":{"heatmap":1},"dashboard_quality_score":0.0}},{"id":"tx6-46v-wzw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-19T03:11:04.352440Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-19T03:11:04.352440Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"tyg-8ef-5du","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771148850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T09:47:31.210504Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T09:47:31.210504Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2913730222968041}},{"id":"u4x-txd-uf6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-08T22:26:48.362206Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-08T22:26:48.362206Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"u6k-8ra-z4w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770817650 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T13:47:31.230094Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T13:47:31.230094Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27919420357265373}},{"id":"u83-pun-a9b","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771321655 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T09:47:35.385380Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T09:47:35.385380Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29772734248106114}},{"id":"uba-qwg-578","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + - Activity Monitoring","teams":[],"created_at":"2026-03-17T11:35:05.168296Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":37,"viewed_at":"2026-05-06T14:46:50.041000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":37,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-04-22T11:05:57.581463Z","widget_count":35,"widget_count_by_type":{"group":5,"image":1,"query_value":12,"note":5,"timeseries":8,"list_stream":4},"dashboard_quality_score":0.9551039430779807}},{"id":"ubg-7fr-tdr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771393657 + with Profile Metrics Query","teams":[],"created_at":"2026-02-18T05:47:37.834232Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-18T05:47:37.834232Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.30037500197405}},{"id":"uc8-ykp-3c7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Fly.io + Overview (cloned)","teams":[],"created_at":"2024-08-13T17:58:15.161434Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-14T21:07:55.940923Z","widget_count":36,"widget_count_by_type":{"group":6,"note":3,"query_value":2,"check_status":1,"toplist":2,"query_table":4,"hostmap":1,"treemap":1,"timeseries":16},"dashboard_quality_score":0.0}},{"id":"uci-9wg-zjd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771264057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T17:47:37.711705Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T17:47:37.711705Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29560937246840263}},{"id":"udi-jgj-55m","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1770875251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T05:47:31.551208Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T05:47:31.551208Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28131227093581224}},{"id":"ug4-a8z-jva","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-07T16:37:55.238444Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-07T16:37:55.238444Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"ug6-j5q-8mm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-01-09T16:13:44.101907Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T16:13:45.105031Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"unw-hwk-68w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-02T02:31:03.437671Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-02T02:31:03.437671Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"upb-689-i8b","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770976057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T09:47:37.795529Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T09:47:37.795529Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2850190977727647}},{"id":"uq2-urd-dzu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Scaphandre + Overview ","teams":[],"created_at":"2024-05-16T19:33:47.986664Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-23T19:50:58.459791Z","widget_count":24,"widget_count_by_type":{"group":5,"note":4,"query_value":5,"timeseries":8,"toplist":1,"query_table":1},"dashboard_quality_score":0.0}},{"id":"uqe-kqz-p6j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-11-17T18:42:10.349402Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-11-17T18:42:11.457516Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"uqx-qwy-i5y","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770990457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T13:47:37.798194Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T13:47:37.798194Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28554861175952617}},{"id":"urw-rep-zs5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1771240889 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T11:21:29.899724Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T11:21:29.899724Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.294757450369468}},{"id":"uu8-cxu-zea","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Beacon + Service","teams":[],"created_at":"2023-10-10T18:45:29.276049Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-10-10T18:45:29.276049Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"uw4-48e-88t","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-30T18:59:31.861704Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-30T18:59:31.861704Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"ux5-fxw-5cf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"frog''s + Screenboard Thu, Jan 26, 9:35:17 am","teams":[],"created_at":"2023-01-26T08:35:17.499834Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-26T08:35:36.597872Z","widget_count":1,"widget_count_by_type":{"run_workflow":1},"dashboard_quality_score":0.0}}],"meta":{"page":{"type":"offset_limit","offset":0,"first_offset":0,"limit":500,"prev_offset":null,"next_offset":500,"last_offset":500,"total":590}},"links":{"self":"https://api.datadoghq.com/api/v2/dashboards/usage?page%5Blimit%5D=500","next":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=500&page[limit]=500","first":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=500","last":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=500&page[limit]=500"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/dashboards/usage?page%5Blimit%5D=500&page%5Boffset%5D=500 + response: + body: '{"data":[{"id":"ux8-fvf-2t2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboard_import-local-1774386000","teams":["foobar"],"created_at":"2026-03-24T21:00:09.496200Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-24T21:00:09.496200Z","widget_count":18,"widget_count_by_type":{"alert_graph":2,"alert_value":1,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"slo":1,"query_table":2},"dashboard_quality_score":0.6122496869776752}},{"id":"uxq-tpu-pzd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771258019 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T16:06:59.841715Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T16:06:59.841715Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29538732761228936}},{"id":"uy6-4fe-nqd","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:07:21.855524Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:08:42.636698Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"uzv-9tr-d3c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771033654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T01:47:35.021065Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T01:47:35.021065Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.287137029784934}},{"id":"v2t-32y-azs","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771048051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T05:47:32.213150Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T05:47:32.213150Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28766644042113615}},{"id":"v37-yyy-9ym","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-03-30T02:06:59.053289Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-03-30T02:06:59.053289Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"v3w-u4i-tww","type":"dashboards-usages","attributes":{"org_id":321813,"title":"TF + Test Layout Dashboard","teams":[],"created_at":"2023-08-02T14:14:41.723635Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-08-02T14:14:41.723635Z","widget_count":1,"widget_count_by_type":{"alert_graph":1},"dashboard_quality_score":0.0}},{"id":"v4p-fwd-mjf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771272419 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T20:06:59.911152Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T20:06:59.911152Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2959168440535831}},{"id":"v74-xyc-vd4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-09T21:28:00.315443Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-09T21:28:01.033524Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"vdt-sff-xrf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"kevinzou_sandbox","teams":[],"created_at":"2023-10-10T18:20:08.538567Z","author":{"id":"4348810","name":"Kevin + Zou","handle":"kevin.zou@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-01T15:26:52.470946Z","widget_count":4,"widget_count_by_type":{"timeseries":1,"resolved_powerpack":1,"note":2},"dashboard_quality_score":0.0}},{"id":"vfn-gvr-cxk","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-25T18:21:50.656210Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-25T18:21:50.656210Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"vg2-fg8-7vh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog-api-spec + Automerging","teams":[],"created_at":"2024-09-23T16:27:24.646048Z","author":{"id":"7359812","name":"Jack + Edmonds","handle":"jack.edmonds@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-01-14T22:53:10.616000Z","viewer":{"id":"21011231","name":"Datadog + Support","handle":"support-ddintegrationtests321813-jahanzeb.hassan@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2024-09-24T21:27:33.180160Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"vgn-f2f-zr3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion] (cloned)","teams":[],"created_at":"2023-11-21T20:19:09.753235Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-21T20:19:09.753235Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"vma-hxa-ma8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770809540 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T11:32:21.170814Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:32:21.170814Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2788959605891137}},{"id":"vq5-vug-huw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771206454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T01:47:35.094922Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T01:47:35.094922Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2934911991660391}},{"id":"vs4-szr-mtr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770860857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T01:47:37.797214Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T01:47:37.797214Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2807829652007914}},{"id":"vs6-9qu-vur","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-03-15T13:37:22.574326Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-15T13:37:23.238265Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"vv8-3hp-sxj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1773846313","teams":[],"created_at":"2026-03-18T15:05:16.540940Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-18T15:05:16.540940Z","widget_count":1,"widget_count_by_type":{"note":1},"dashboard_quality_score":0.17073820790521346}},{"id":"vvn-nwe-23z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2024-03-01T00:18:38.736689Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-03-01T00:18:38.736689Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"w2e-x2y-3vt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_returns_OK_response_1775590678 + with Profile Metrics Query","teams":[],"created_at":"2026-04-07T19:37:58.565413Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-07T19:37:58.565413Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.4547069783059085}},{"id":"w69-gn2-yx7","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771062454 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T09:47:35.025667Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T09:47:35.025667Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2881960577302342}},{"id":"w8n-x44-t2p","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770990451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T13:47:32.224268Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T13:47:32.224268Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2855483852732668}},{"id":"wb7-w9w-yt8","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770780740 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T03:32:20.760262Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T03:32:20.760262Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27783691771415275}},{"id":"wbr-dug-df9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771350451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T17:47:32.174584Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T17:47:32.174584Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2987862306684219}},{"id":"wce-cqf-nhh","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2022-05-22T00:22:51.925033Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-05-22T00:22:51.925033Z","widget_count":2,"widget_count_by_type":{"log_stream":2},"dashboard_quality_score":0.0}},{"id":"wcp-6ik-3wf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-12-29T01:44:20.834836Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-29T01:44:20.834836Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"wds-47g-3uz","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770788854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T05:47:35.089841Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T05:47:35.089841Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2781352962008547}},{"id":"wke-6z5-wyq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770910549 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T15:35:49.842435Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T15:35:49.842435Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2826102310413242}},{"id":"wmh-6sq-386","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770918451 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:32.261724Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:32.261724Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2829008172058231}},{"id":"wpj-thq-g93","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Cloud + Foundry - Overview (cloned) 2025","teams":[],"created_at":"2025-06-30T08:53:17.268411Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-06-30T08:53:17.901000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-06-30T08:53:17.268411Z","widget_count":83,"widget_count_by_type":{"group":5,"note":14,"treemap":1,"hostmap":1,"query_value":39,"timeseries":18,"toplist":3,"query_table":2},"dashboard_quality_score":0.0}},{"id":"wrg-gv3-3hf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Delete_custom_timeboard_dashboard_from_an_existing_dashboard_list_returns_OK_response_1720880516 + with Profile Metrics Query","teams":[],"created_at":"2024-07-13T14:21:57.467620Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-07-13T14:21:57.467620Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"wse-7yb-mn5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771249654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T13:47:35.050265Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T13:47:35.050265Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2950797391895901}},{"id":"wsr-yee-qm5","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-30T18:59:31.598171Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-30T18:59:31.598171Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"x3m-fv4-6ux","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771076854 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T13:47:35.001197Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T13:47:35.001197Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2887255707185161}},{"id":"x45-5fs-594","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-03-15T13:43:02.051856Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-03-15T13:43:02.798289Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"x4t-vem-u26","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771148857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T09:47:37.806747Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T09:47:37.806747Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2913732433279884}},{"id":"x77-xd6-a6v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"OpenStack + Controller Overview [Default Microversion]","teams":[],"created_at":"2023-10-23T19:59:39.468599Z","author":{"id":"4594522","name":"Sarah + Witt","handle":"sarah.witt@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-01-05T20:38:35.743635Z","widget_count":133,"widget_count_by_type":{"group":7,"note":29,"check_status":6,"query_value":44,"query_table":21,"timeseries":26},"dashboard_quality_score":0.0}},{"id":"xc8-h6m-gyt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2021-04-13T11:50:10.192480Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-04-13T11:50:38.881933Z","widget_count":3,"widget_count_by_type":{"slo":3},"dashboard_quality_score":0.0}},{"id":"xcu-6yc-kms","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1771148851 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T09:47:32.332380Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T09:47:32.332380Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2913730420253869}},{"id":"xdp-wbm-5rj","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T21:50:56.241695Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T21:50:56.241695Z","widget_count":2,"widget_count_by_type":{"toplist":2},"dashboard_quality_score":0.0}},{"id":"xfe-kap-e5y","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-06-21T13:59:15.683388Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-06-21T13:59:15.683388Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"xgg-369-k9w","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-05-13T01:28:36.563248Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-13T01:28:36.563248Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"xgk-vue-3qe","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboard_update-local-1774386000","teams":["foobar"],"created_at":"2026-03-24T21:00:09.313665Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-24T21:00:09.313665Z","widget_count":18,"widget_count_by_type":{"alert_graph":2,"alert_value":1,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"scatterplot":1,"timeseries":1,"toplist":1,"group":1,"slo":1,"query_table":2},"dashboard_quality_score":0.61224967695959}},{"id":"xik-jrv-mdc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770751940 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T19:32:20.784646Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T19:32:20.784646Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27677789083171905}},{"id":"xiz-y8z-chv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardAlertValue-local-1774284759","teams":[],"created_at":"2026-03-23T16:52:43.134570Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:52:43.134570Z","widget_count":2,"widget_count_by_type":{"alert_value":2},"dashboard_quality_score":0.17778628200479657}},{"id":"xkq-2cm-fed","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-09-30T18:57:16.687093Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-30T18:57:16.687093Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"xm8-dhx-hhp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardQueryValueFormula-local-1772671938","teams":[],"created_at":"2026-03-05T00:52:21.132803Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-05T00:52:21.132803Z","widget_count":2,"widget_count_by_type":{"query_value":2},"dashboard_quality_score":0.35307450557572834}},{"id":"xu2-dmz-vbu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770875251 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T05:47:32.100546Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T05:47:32.100546Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2813122696097398}},{"id":"xue-5t2-hzf","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Acceptance + Test Log Stream Widget Dashboard","teams":[],"created_at":"2021-01-06T10:40:07.910997Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2021-01-06T10:40:07.910997Z","widget_count":1,"widget_count_by_type":{"log_stream":1},"dashboard_quality_score":0.0}},{"id":"xuj-rfk-ipn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771307254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T05:47:35.024803Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T05:47:35.024803Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2971977938065021}},{"id":"xxj-ch8-d5z","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_a_timeseries_widget_using_formulas_and_functions_cloud_cost_query_1773243479","teams":[],"created_at":"2026-03-11T15:38:00.121654Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-11T15:38:00.121654Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.4911950288528393}},{"id":"xyw-vsq-3mn","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Nutanix + - Overview (cloned)","teams":[],"created_at":"2026-03-23T17:04:40.240552Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":2,"viewed_at":"2026-03-24T02:18:54.740000Z","viewer":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":2,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2026-03-23T17:04:40.240552Z","widget_count":69,"widget_count_by_type":{"group":5,"image":1,"query_value":24,"note":5,"timeseries":27,"toplist":4,"query_table":3},"dashboard_quality_score":0.7133295162251634}},{"id":"xz5-qbs-c89","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771163257 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T13:47:37.808401Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T13:47:37.808401Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29190275727522796}},{"id":"xz6-mat-r9c","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_check_status_widget_1736101311","teams":[],"created_at":"2025-01-05T18:21:52.120117Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-01-05T18:21:52.120117Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"y25-ya8-jdc","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771120054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T01:47:35.359677Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T01:47:35.359677Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29031412556447567}},{"id":"y2q-dni-cqm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771220857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T05:47:37.711542Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T05:47:37.711542Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2940208092689621}},{"id":"y3a-44d-84n","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771192050 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:31.285869Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:31.285869Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2929615452075585}},{"id":"y3r-ajw-7pr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770817654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-11T13:47:35.057664Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T13:47:35.057664Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2791943227920918}},{"id":"y3t-eqa-763","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2024-08-14T06:21:50.287887Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-08-14T06:21:50.287887Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"y6m-dsb-3uq","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2022-11-17T18:39:28.101260Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-11-17T18:39:28.748416Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"y7m-csd-ady","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770731254 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T13:47:35.087124Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T13:47:35.087124Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2760172405419328}},{"id":"ya2-tzk-zyw","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2023-07-07T19:53:37.805020Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-07-07T19:53:38.731282Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"ycg-nrd-xhy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1770895940 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T11:32:20.624176Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T11:32:20.624176Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2820730238174243}},{"id":"ycy-u36-z2k","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response_1771220850 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T05:47:31.282996Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T05:47:31.282996Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2940205728794115}},{"id":"ydt-8ah-kfv","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Noueman''s + Dashboard Thu, May 9, 11:49:33 pm","teams":[],"created_at":"2024-05-09T21:49:33.558354Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-05-09T21:49:33.558354Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"yes-s6q-j58","type":"dashboards-usages","attributes":{"org_id":321813,"title":"new_title","teams":[],"created_at":"2022-02-02T15:50:14.521415Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-02-02T15:50:16.741690Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"yj5-q5m-u3v","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Rust-Update_a_shared_dashboard_with_selectable_template_vars_returns_OK_response-1770096876 + with Profile Metrics Query","teams":[],"created_at":"2026-02-03T05:34:36.923025Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-03T05:34:36.923025Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.11046558030045606}},{"id":"yj9-r52-is2","type":"dashboards-usages","attributes":{"org_id":321813,"title":"datadog + test","teams":[],"created_at":"2023-01-24T08:06:24.291924Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-24T08:06:25.020191Z","widget_count":1,"widget_count_by_type":{"image":1},"dashboard_quality_score":0.0}},{"id":"ymj-b3m-xy9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_powerpack_widget_1778125170 + with powerpack widget","teams":[],"created_at":"2026-05-07T03:39:31.704516Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-05-07T03:39:31.704516Z","widget_count":2,"widget_count_by_type":{"resolved_powerpack":1,"note":1},"dashboard_quality_score":0.23952124486914217}},{"id":"ynt-7re-g5t","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Dashboard + with Powerpack","teams":[],"created_at":"2023-09-13T20:04:26.921191Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-09-13T20:04:26.921191Z","widget_count":3,"widget_count_by_type":{"resolved_powerpack":1,"note":2},"dashboard_quality_score":0.0}},{"id":"yp5-cx9-vdp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1771105654 + with Profile Metrics Query","teams":[],"created_at":"2026-02-14T21:47:35.004691Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-14T21:47:35.004691Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.28978459862108663}},{"id":"yq7-7uz-gr9","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2024-10-04T18:40:12.197797Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-10-04T18:40:12.197797Z","widget_count":19,"widget_count_by_type":{"alert_graph":2,"alert_value":2,"change":1,"distribution":1,"check_status":1,"heatmap":1,"hostmap":1,"note":2,"query_value":1,"query_table":1,"scatterplot":1,"servicemap":1,"timeseries":1,"toplist":1,"group":1,"slo":1},"dashboard_quality_score":0.0}},{"id":"yr9-iwb-sye","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771192057 + with Profile Metrics Query","teams":[],"created_at":"2026-02-15T21:47:37.808442Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-15T21:47:37.808442Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2929617850532688}},{"id":"ytd-nd3-bxu","type":"dashboards-usages","attributes":{"org_id":321813,"title":"","teams":[],"created_at":"2023-11-19T01:32:56.908916Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-11-19T01:32:56.908916Z","widget_count":1,"widget_count_by_type":{"hostmap":1},"dashboard_quality_score":0.0}},{"id":"ywe-vtz-gf3","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_dashboard_with_apm_dependency_stats_widget_1775389170","teams":[],"created_at":"2026-04-05T11:39:30.959125Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-04-05T11:39:30.959125Z","widget_count":1,"widget_count_by_type":{"query_table":1},"dashboard_quality_score":0.4472971813396155}},{"id":"ywh-67w-ngi","type":"dashboards-usages","attributes":{"org_id":321813,"title":"{{uniq}}","teams":[],"created_at":"2024-09-06T22:01:42.426084Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-09-06T22:02:16.920717Z","widget_count":1,"widget_count_by_type":{"toplist":1},"dashboard_quality_score":0.0}},{"id":"z3n-t5n-ukp","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardQueryTable_import-local-1774283697","teams":[],"created_at":"2026-03-23T16:35:00.455252Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-03-23T16:35:00.455252Z","widget_count":2,"widget_count_by_type":{"query_table":2},"dashboard_quality_score":0.4821989531662612}},{"id":"z68-mvw-2q4","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Test-Typescript-Create_a_new_dashboard_with_a_timeseries_widget_and_an_overlay_request-1770808902","teams":[],"created_at":"2026-02-11T11:21:42.825036Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-11T11:21:42.825036Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27887248746203835}},{"id":"z6s-z5h-2gm","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1770918457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-12T17:47:37.818865Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-12T17:47:37.818865Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2829010215473871}},{"id":"z76-ig8-iba","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1757645959 + with Profile Metrics Query","teams":[],"created_at":"2025-09-12T02:59:19.475472Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-09-12T02:59:19.475472Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"zfd-a24-thy","type":"dashboards-usages","attributes":{"org_id":321813,"title":"PCF + Cloud Controller","teams":[],"created_at":"2022-04-15T08:57:00.852815Z","author":{"id":"2475411","name":"Noueman + Khalikine","handle":"noueman.khalikine@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2022-04-21T09:55:03.424538Z","widget_count":8,"widget_count_by_type":{"group":2,"timeseries":6},"dashboard_quality_score":0.0}},{"id":"zpe-eix-52j","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_a_shared_dashboard_returns_OK_response_1770976051 + with Profile Metrics Query","teams":[],"created_at":"2026-02-13T09:47:32.315914Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-13T09:47:32.315914Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2850188747494127}},{"id":"zsm-t5r-gqb","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Send_shared_dashboard_invitation_email_returns_OK_response_1771286820 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T00:07:00.389782Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T00:07:00.389782Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29644637553662456}},{"id":"zsp-mfz-rnt","type":"dashboards-usages","attributes":{"org_id":321813,"title":"updated + api timeboard","teams":[],"created_at":"2023-01-23T07:59:06.665310Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2023-01-23T07:59:07.322412Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"zst-bcm-gq6","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Ordered + Layout Dashboard","teams":[],"created_at":"2023-12-08T08:08:54.613783Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":1,"viewed_at":"2025-01-14T22:53:12.978000Z","viewer":{"id":"21011231","name":"Datadog + Support","handle":"support-ddintegrationtests321813-jahanzeb.hassan@datadoghq.com","is_disabled":false},"total_views_by_type":{"embed":0,"in_app":1,"public":0,"shared":0,"api":0,"unknown":0},"edited_at":"2025-01-14T22:53:33.484565Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.0}},{"id":"zu4-qn7-y39","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771292857 + with Profile Metrics Query","teams":[],"created_at":"2026-02-17T01:47:37.712122Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-17T01:47:37.712122Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.29666837873306773}},{"id":"zwr-bi3-xzg","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Update_a_shared_dashboard_returns_OK_response_1771206457 + with Profile Metrics Query","teams":[],"created_at":"2026-02-16T01:47:37.822629Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-16T01:47:37.822629Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.2934912994632327}},{"id":"zwx-uk8-q6h","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Get_all_invitations_for_a_shared_dashboard_returns_OK_response_1770760054 + with Profile Metrics Query","teams":[],"created_at":"2026-02-10T21:47:35.076033Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2026-02-10T21:47:35.076033Z","widget_count":1,"widget_count_by_type":{"timeseries":1},"dashboard_quality_score":0.27707626791036843}},{"id":"zy8-8tg-sxr","type":"dashboards-usages","attributes":{"org_id":321813,"title":"tf-TestAccDatadogDashboardRbac_createRbac-local-1734697397","teams":[],"created_at":"2024-12-20T12:23:21.850235Z","author":{"id":"2320499","name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2024-12-20T12:23:21.850235Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}},{"id":"zyb-k3y-n42","type":"dashboards-usages","attributes":{"org_id":321813,"title":"Example-Create_a_new_timeseries_widget_with_ci_pipelines_data_source_1761795515 + with ci_pipelines datasource","teams":[],"created_at":"2025-10-30T03:38:36.061518Z","author":{"id":"1445416","name":"frog","handle":"frog@datadoghq.com","is_disabled":false},"total_views":0,"viewed_at":null,"viewer":null,"total_views_by_type":null,"edited_at":"2025-10-30T03:38:36.061518Z","widget_count":0,"widget_count_by_type":{},"dashboard_quality_score":0.0}}],"meta":{"page":{"type":"offset_limit","offset":500,"first_offset":0,"limit":500,"prev_offset":0,"next_offset":null,"last_offset":500,"total":590}},"links":{"self":"https://api.datadoghq.com/api/v2/dashboards/usage?page%5Blimit%5D=500&page%5Boffset%5D=500","prev":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=500","first":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=500","last":"https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=500&page[limit]=500"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.yaml new file mode 100644 index 00000000000..c2207f0d823 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_No_Content_response.yaml @@ -0,0 +1,17 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158 + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..ef814f2d867 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Delete_a_Model_Lab_run_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/999999 + response: + body: '{"errors":[{"title":"Generic Error","detail":"run not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.yaml new file mode 100644 index 00000000000..9ad09209180 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Download_artifact_content_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/octet-stream, application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/artifacts/content?project_id=2387&artifact_path=f635c73b70594ab6bb6e212cdf87d0d5%2Fartifacts%2Flora_model%2Fadapter_config.json + response: + body: data + code: 200 + duration: 0ms + headers: + Content-Type: + - application/octet-stream + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..5c8b6643498 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/999999 + response: + body: '{"errors":[{"title":"Generic Error","detail":"project not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.yaml new file mode 100644 index 00000000000..36df0622c12 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_project_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/2387 + response: + body: '{"data":{"id":"2387","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76421","created_at":"2026-05-15T02:54:52.457827Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76421","is_starred":false,"name":"ft-gpt2-smoke-1778812860","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T02:54:52.468614Z"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..d9f8c863f36 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/999999 + response: + body: '{"errors":[{"title":"Generic Error","detail":"run not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.yaml new file mode 100644 index 00000000000..eaccef3b7e0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Get_a_Model_Lab_run_returns_OK_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158 + response: + body: '{"data":{"id":"70158","type":"runs","attributes":{"completed_at":"2026-05-15T02:57:03.079Z","created_at":"2026-05-15T02:54:52.684452Z","descendant_match":false,"description":"","duration":130.498,"external_url":"https://mlflow.us1.staging.dog/#/runs/f635c73b70594ab6bb6e212cdf87d0d5","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"eval_loss","min":3.214665412902832,"max":3.9457361698150635,"mean":3.5802007913589478,"latest":3.214665412902832,"count":4,"first_step":0,"last_step":204},{"key":"learning_rate","min":0,"max":0.0001,"mean":4.9999999999999996e-05,"latest":5.154639175257732e-07,"count":408,"first_step":1,"last_step":204},{"key":"train_steps_per_second","min":1.951,"max":1.951,"mean":1.951,"latest":1.951,"count":1,"first_step":204,"last_step":204},{"key":"entropy","min":3.1330020427703857,"max":4.252453327178955,"mean":3.6496509979752934,"latest":3.1330020427703857,"count":204,"first_step":1,"last_step":204},{"key":"eval_runtime","min":6.3487,"max":6.7308,"mean":6.53975,"latest":6.3487,"count":2,"first_step":0,"last_step":204},{"key":"grad_norm","min":0.4185899794101715,"max":1.697460651397705,"mean":0.9965703097336432,"latest":1.3113601207733154,"count":204,"first_step":1,"last_step":204},{"key":"total_flos","min":31781629558784,"max":31781629558784,"mean":31781629558784,"latest":31781629558784,"count":1,"first_step":204,"last_step":204},{"key":"training_runtime_seconds","min":106.08,"max":106.08,"mean":106.08,"latest":106.08,"count":1,"first_step":0,"last_step":0},{"key":"train_loss","min":3.10653018951416,"max":4.4325761795043945,"mean":3.6260507060032263,"latest":3.6260507060032263,"count":205,"first_step":1,"last_step":204},{"key":"train_runtime","min":104.5855,"max":104.5855,"mean":104.5855,"latest":104.5855,"count":1,"first_step":204,"last_step":204},{"key":"train_samples_per_second","min":7.802,"max":7.802,"mean":7.802,"latest":7.802,"count":1,"first_step":204,"last_step":204},{"key":"eval_mean_token_accuracy","min":0.3437899912104887,"max":0.40528977969113517,"mean":0.37453988545081196,"latest":0.40528977969113517,"count":2,"first_step":0,"last_step":204},{"key":"eval_num_tokens","min":0,"max":115650,"mean":57825,"latest":115650,"count":2,"first_step":0,"last_step":204},{"key":"eval_samples_per_second","min":30.308,"max":32.133,"mean":31.2205,"latest":32.133,"count":2,"first_step":0,"last_step":204},{"key":"eval_steps_per_second","min":7.577,"max":8.033,"mean":7.805,"latest":8.033,"count":2,"first_step":0,"last_step":204},{"key":"final_train_loss","min":3.6260507060032263,"max":3.6260507060032263,"mean":3.6260507060032263,"latest":3.6260507060032263,"count":1,"first_step":0,"last_step":0},{"key":"mean_token_accuracy","min":0.2756052017211914,"max":0.4394785761833191,"mean":0.36340271316322625,"latest":0.4110320210456848,"count":204,"first_step":1,"last_step":204},{"key":"epoch","min":0,"max":1,"mean":0.5048309178743962,"latest":1,"count":207,"first_step":0,"last_step":204},{"key":"eval_entropy","min":3.4261409394881306,"max":3.795459279827043,"mean":3.610800109657587,"latest":3.4261409394881306,"count":2,"first_step":0,"last_step":204},{"key":"loss","min":3.10653018951416,"max":4.4325761795043945,"mean":3.6260507060032263,"latest":3.171748638153076,"count":204,"first_step":1,"last_step":204},{"key":"num_tokens","min":602,"max":115650,"mean":58002.029411764706,"latest":115650,"count":204,"first_step":1,"last_step":204},{"key":"total_steps","min":204,"max":204,"mean":204,"latest":204,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2387/70158/artifacts","name":"ft-gpt2-smoke-1778812860-1778813692","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"_name_or_path","value":"gpt2"},{"key":"activation_function","value":"gelu_new"},{"key":"adam_beta1","value":"0.9"},{"key":"adam_beta2","value":"0.999"},{"key":"adam_epsilon","value":"1e-08"},{"key":"add_cross_attention","value":"False"},{"key":"architectures","value":"[''GPT2LMHeadModel'']"},{"key":"attn_pdrop","value":"0.1"},{"key":"auto_find_batch_size","value":"False"},{"key":"average_tokens_across_devices","value":"True"},{"key":"bf16","value":"True"},{"key":"bf16_full_eval","value":"False"},{"key":"bos_token_id","value":"50256"},{"key":"chunk_size_feed_forward","value":"0"},{"key":"dataset","value":"s3://aip-long-running-jobs/savita.manghnani/train_amplified.zip"},{"key":"disable_tqdm","value":"False"},{"key":"dtype","value":"bfloat16"},{"key":"embd_pdrop","value":"0.1"},{"key":"eos_token_id","value":"50256"},{"key":"eval_accumulation_steps","value":"None"},{"key":"eval_delay","value":"0"},{"key":"eval_do_concat_batches","value":"True"},{"key":"eval_on_start","value":"True"},{"key":"eval_steps","value":"None"},{"key":"eval_strategy","value":"epoch"},{"key":"eval_use_gather_object","value":"False"},{"key":"fp16","value":"False"},{"key":"fp16_full_eval","value":"False"},{"key":"gradient_accumulation_steps","value":"1"},{"key":"gradient_checkpointing","value":"False"},{"key":"gradient_checkpointing_kwargs","value":"None"},{"key":"id2label","value":"{0: + ''LABEL_0'', 1: ''LABEL_1''}"},{"key":"include_for_metrics","value":"[]"},{"key":"include_num_input_tokens_seen","value":"no"},{"key":"initializer_range","value":"0.02"},{"key":"is_encoder_decoder","value":"False"},{"key":"label2id","value":"{''LABEL_0'': + 0, ''LABEL_1'': 1}"},{"key":"label_smoothing_factor","value":"0.0"},{"key":"layer_norm_epsilon","value":"1e-05"},{"key":"learning_rate","value":"0.0001"},{"key":"liger_kernel_config","value":"None"},{"key":"log_level","value":"passive"},{"key":"log_level_replica","value":"warning"},{"key":"log_on_each_node","value":"True"},{"key":"logging_first_step","value":"False"},{"key":"logging_nan_inf_filter","value":"True"},{"key":"logging_steps","value":"1"},{"key":"logging_strategy","value":"steps"},{"key":"lora_alpha","value":"16"},{"key":"lora_dropout","value":"0.1"},{"key":"lora_rank","value":"8"},{"key":"lr_scheduler_kwargs","value":"None"},{"key":"lr_scheduler_type","value":"linear"},{"key":"max_grad_norm","value":"1.0"},{"key":"max_length","value":"2048"},{"key":"max_steps","value":"-1"},{"key":"method","value":"lora"},{"key":"model_name","value":"gpt2"},{"key":"model_type","value":"gpt2"},{"key":"n_ctx","value":"1024"},{"key":"n_embd","value":"768"},{"key":"n_head","value":"12"},{"key":"n_inner","value":"None"},{"key":"n_layer","value":"12"},{"key":"n_positions","value":"1024"},{"key":"neftune_noise_alpha","value":"None"},{"key":"num_epochs","value":"1"},{"key":"num_train_epochs","value":"1"},{"key":"optim","value":"adamw_torch_fused"},{"key":"optim_args","value":"None"},{"key":"optim_target_modules","value":"None"},{"key":"optimizer","value":"adamw_8bit"},{"key":"output_attentions","value":"False"},{"key":"output_dir","value":"./lora_output"},{"key":"output_hidden_states","value":"False"},{"key":"packing","value":"False"},{"key":"pad_token_id","value":"50256"},{"key":"per_device_batch_size","value":"2"},{"key":"per_device_eval_batch_size","value":"2"},{"key":"per_device_train_batch_size","value":"2"},{"key":"precision","value":"bf16"},{"key":"prediction_loss_only","value":"False"},{"key":"problem_type","value":"None"},{"key":"project","value":"huggingface"},{"key":"reorder_and_upcast_attn","value":"False"},{"key":"report_to","value":"[''mlflow'']"},{"key":"resid_pdrop","value":"0.1"},{"key":"return_dict","value":"True"},{"key":"run_name","value":"None"},{"key":"scale_attn_by_inverse_layer_idx","value":"False"},{"key":"scale_attn_weights","value":"True"},{"key":"summary_activation","value":"None"},{"key":"summary_first_dropout","value":"0.1"},{"key":"summary_proj_to_labels","value":"True"},{"key":"summary_type","value":"cls_index"},{"key":"summary_use_proj","value":"True"},{"key":"task_specific_params","value":"{''text-generation'': + {''do_sample'': True, ''max_length'': 50}}"},{"key":"tf32","value":"None"},{"key":"tie_word_embeddings","value":"True"},{"key":"torch_compile","value":"False"},{"key":"torch_compile_backend","value":"None"},{"key":"torch_compile_mode","value":"None"},{"key":"torch_empty_cache_steps","value":"None"},{"key":"trackio_bucket_id","value":"None"},{"key":"trackio_space_id","value":"None"},{"key":"trackio_static_space_id","value":"None"},{"key":"trainer","value":"trl-sft-raytrain"},{"key":"transformers_version","value":"5.8.1"},{"key":"use_cache","value":"False"},{"key":"use_liger_kernel","value":"False"},{"key":"vocab_size","value":"50257"},{"key":"warmup_steps","value":"10"},{"key":"weight_decay","value":"0.0"}],"project_id":2387,"started_at":"2026-05-15T02:54:52.581Z","status":"completed","tags":[{"key":"mlflow.runName","value":"ft-gpt2-smoke-1778812860-1778813692"},{"key":"mlflow.source.name","value":"/home/ray/.venv/lib/python3.12/site-packages/ray/_private/workers/default_worker.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"resumed","value":"false"}],"updated_at":"2026-05-15T02:57:03.257618Z"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.yaml new file mode 100644 index 00000000000..8dd2869cd8b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_artifacts_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/2387/artifacts + response: + body: '{"data":{"id":"2387","type":"project_files","attributes":{"files":[{"filename":"README.md","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/README.md","created_at":"2026-05-15T02:57:00Z","file_size":1389},{"filename":"adapter_config.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/adapter_config.json","created_at":"2026-05-15T02:57:01Z","file_size":1015},{"filename":"adapter_model.safetensors","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/adapter_model.safetensors","created_at":"2026-05-15T02:57:01Z","file_size":4730632},{"filename":"README.md","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/README.md","created_at":"2026-05-15T02:57:02Z","file_size":5174},{"filename":"adapter_config.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/adapter_config.json","created_at":"2026-05-15T02:57:02Z","file_size":1015},{"filename":"adapter_model.safetensors","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/adapter_model.safetensors","created_at":"2026-05-15T02:57:03Z","file_size":4730632},{"filename":"optimizer.bin","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/optimizer.bin","created_at":"2026-05-15T02:57:02Z","file_size":9534155},{"filename":"pytorch_model_fsdp.bin","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/pytorch_model_fsdp.bin","created_at":"2026-05-15T02:57:03Z","file_size":4754405},{"filename":"rng_state_0.pth","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/rng_state_0.pth","created_at":"2026-05-15T02:57:03Z","file_size":14725},{"filename":"scheduler.pt","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/scheduler.pt","created_at":"2026-05-15T02:57:02Z","file_size":1465},{"filename":"tokenizer.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/tokenizer.json","created_at":"2026-05-15T02:57:03Z","file_size":3557680},{"filename":"tokenizer_config.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/tokenizer_config.json","created_at":"2026-05-15T02:57:02Z","file_size":326},{"filename":"trainer_state.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/trainer_state.json","created_at":"2026-05-15T02:57:02Z","file_size":62194},{"filename":"training_args.bin","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/checkpoint-204/training_args.bin","created_at":"2026-05-15T02:57:03Z","file_size":6097},{"filename":"run_config.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/run_config.json","created_at":"2026-05-15T02:57:00Z","file_size":991},{"filename":"tokenizer.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/tokenizer.json","created_at":"2026-05-15T02:57:01Z","file_size":3557680},{"filename":"tokenizer_config.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/tokenizer_config.json","created_at":"2026-05-15T02:57:01Z","file_size":326},{"filename":"training_args.bin","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/training_args.bin","created_at":"2026-05-15T02:57:02Z","file_size":6097},{"filename":"training_metrics.json","artifact_path":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/training_metrics.json","created_at":"2026-05-15T02:57:01Z","file_size":55890}]}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.yaml new file mode 100644 index 00000000000..f5a9abe9572 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_keys_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/project-facet-keys + response: + body: '{"data":{"id":"2","type":"facet_keys","attributes":{"metrics":null,"parameters":[],"tags":["age","beatings","mlflow.experimentKind","mlflow.experiment.ownerID","morale","team","usecase","weather"]}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.yaml new file mode 100644 index 00000000000..577b2502daa --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_project_facet_values_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/project-facet-values?facet_type=tag&facet_name=model + response: + body: '{"data":{"id":"tag:model","type":"facet_values","attributes":{"facet_name":"model","facet_type":"tag","values":[]}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.yaml new file mode 100644 index 00000000000..f45a3398326 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_projects_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/projects + response: + body: '{"data":[{"id":"2439","type":"projects","attributes":{"artifact_storage_location":"model-lab:///2439","created_at":"2026-05-18T16:44:48.672513Z","description":"","is_starred":false,"name":"test-bdd-recording-1779122688","tags":[],"updated_at":"2026-05-18T16:44:48.684473Z"}},{"id":"2438","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76991","created_at":"2026-05-18T15:55:50.180276Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76991","is_starred":false,"name":"qwen36-27b-qlora-fsdp-1779119158","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T15:55:50.188677Z"}},{"id":"2437","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76989","created_at":"2026-05-18T15:46:35.705961Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76989","is_starred":false,"name":"qwen36-27b-lora-bf16-fsdp-1779118712","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T15:46:35.715063Z"}},{"id":"2436","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76981","created_at":"2026-05-18T14:36:11.355331Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76981","is_starred":false,"name":"llm-benchmark/gpt-oss-20b","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T14:36:11.363352Z"}},{"id":"2435","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76980","created_at":"2026-05-18T14:36:06.310431Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76980","is_starred":false,"name":"llm-benchmark/Qwen3.5-4B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T14:36:06.318305Z"}},{"id":"2434","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76979","created_at":"2026-05-18T14:36:00.539314Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76979","is_starred":false,"name":"llm-benchmark/Qwen3-4B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T14:36:00.546338Z"}},{"id":"2433","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76978","created_at":"2026-05-18T14:35:55.610359Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76978","is_starred":false,"name":"llm-benchmark/Qwen2.5-Coder-7B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T14:35:55.618194Z"}},{"id":"2432","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76977","created_at":"2026-05-18T14:35:50.418713Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76977","is_starred":false,"name":"llm-benchmark/Qwen3-8B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-18T14:35:50.428634Z"}},{"id":"2399","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76545","created_at":"2026-05-15T21:26:54.883458Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76545","is_starred":false,"name":"ft-qwen36-27b-lora-bf16-fsdp-1778879891","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T21:26:54.894726Z"}},{"id":"2398","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76541","created_at":"2026-05-15T21:00:45.799634Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76541","is_starred":false,"name":"ft-qwen36-27b-qlora-fsdp-a100-1778878296","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T21:00:45.812402Z"}},{"id":"2397","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76540","created_at":"2026-05-15T20:59:43.336624Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76540","is_starred":false,"name":"ft-qwen36-27b-qlora-a100-1778878293","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T20:59:43.346736Z"}},{"id":"2396","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76534","created_at":"2026-05-15T20:16:47.48412Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76534","is_starred":false,"name":"ft-qwen36-27b-qlora-1gpu-1778873109","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T20:16:47.494291Z"}},{"id":"2395","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76533","created_at":"2026-05-15T20:12:05.975402Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76533","is_starred":false,"name":"ft-qwen36-27b-qlora-fsdp-1778873254","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T20:12:05.984538Z"}},{"id":"2394","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76531","created_at":"2026-05-15T19:59:46.814886Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76531","is_starred":false,"name":"ft-qwen36-27b-qlora-1gpu-1778872828","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T19:59:46.824596Z"}},{"id":"2393","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76528","created_at":"2026-05-15T19:43:03.893417Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76528","is_starred":false,"name":"ft-qwen36-27b-qlora-fsdp-1778873442","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T19:43:03.901909Z"}},{"id":"2392","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76527","created_at":"2026-05-15T19:41:00.782593Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76527","is_starred":false,"name":"ft-qwen36-27b-qlora-1778872484","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T19:41:00.792616Z"}},{"id":"2391","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76522","created_at":"2026-05-15T18:58:22.785747Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76522","is_starred":false,"name":"ft-qwen35-9b-qlora-1778870929","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T18:58:22.79593Z"}},{"id":"2390","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76514","created_at":"2026-05-15T17:49:04.684478Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76514","is_starred":false,"name":"ft-qwen35-9b-qlora-1778866175","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T17:49:04.694823Z"}},{"id":"2389","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76483","created_at":"2026-05-15T12:52:28.046954Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76483","is_starred":false,"name":"ft-qwen35-9b-qlora-1778848889","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T12:52:28.057141Z"}},{"id":"2388","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76425","created_at":"2026-05-15T03:18:25.363827Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76425","is_starred":false,"name":"ft-qwen35-9b-qlora-1778814244","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T03:18:25.375252Z"}},{"id":"2387","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76421","created_at":"2026-05-15T02:54:52.457827Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76421","is_starred":false,"name":"ft-gpt2-smoke-1778812860","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-15T02:54:52.468614Z"}},{"id":"2386","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76396","created_at":"2026-05-14T23:30:56.250532Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76396","is_starred":false,"name":"gpt2-smoke-1778800651","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-14T23:30:56.261218Z"}},{"id":"2385","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76393","created_at":"2026-05-14T23:10:18.350308Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76393","is_starred":false,"name":"gpt2-smoke-1778799710","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-14T23:10:18.361036Z"}},{"id":"2352","type":"projects","attributes":{"artifact_storage_location":"model-lab:///76357","created_at":"2026-05-14T17:21:01.714616Z","description":"","external_url":"https://mlflow.us1.staging.dog/#/experiments/76357","is_starred":false,"name":"qwen3-4b-thinking-false-1778778667","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","tags":[],"updated_at":"2026-05-14T17:21:01.724501Z"}},{"id":"2351","type":"projects","attributes":{"artifact_storage_location":"model-lab:///2351","created_at":"2026-05-14T13:24:26.439419Z","description":"","is_starred":false,"name":"40-model-lab-online-rlaif","owner_id":"11e6980a-089e-49ea-be5c-c821408af46d","tags":[],"updated_at":"2026-05-14T13:24:26.452049Z"}}],"meta":{"page":{"type":"number_size","number":0,"size":25,"total":403,"first_number":0,"prev_number":null,"next_number":1,"last_number":16}},"links":{"self":"https://api.datad0g.com/api/v2/model-lab-api/projects","first":"https://api.datad0g.com/api/v2/model-lab-api/projects?page[number]=0&page[size]=25","last":"https://api.datad0g.com/api/v2/model-lab-api/projects?page[number]=16&page[size]=25","next":"https://api.datad0g.com/api/v2/model-lab-api/projects?page[number]=1&page[size]=25"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.yaml new file mode 100644 index 00000000000..2c94d5a7cdf --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_artifacts_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158/artifacts + response: + body: '{"data":{"id":"70158","type":"artifacts","attributes":{"files":[{"path":"lora_model/","is_dir":true}],"path_in_project":"f635c73b70594ab6bb6e212cdf87d0d5/artifacts"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.yaml new file mode 100644 index 00000000000..0d7e0e35153 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_keys_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/facet-keys?filter%5Bproject_id%5D=2387 + response: + body: '{"data":{"id":"2387","type":"facet_keys","attributes":{"metrics":["entropy","epoch","eval_entropy","eval_loss","eval_mean_token_accuracy","eval_num_tokens","eval_runtime","eval_samples_per_second","eval_steps_per_second","final_train_loss","grad_norm","learning_rate","loss","mean_token_accuracy","num_tokens","total_flos","total_steps","training_runtime_seconds","train_loss","train_runtime","train_samples_per_second","train_steps_per_second"],"parameters":["activation_function","adam_beta1","adam_beta2","adam_epsilon","add_cross_attention","architectures","attn_pdrop","auto_find_batch_size","average_tokens_across_devices","bf16","bf16_full_eval","bos_token_id","chunk_size_feed_forward","dataset","disable_tqdm","dtype","embd_pdrop","eos_token_id","eval_accumulation_steps","eval_delay","eval_do_concat_batches","eval_on_start","eval_steps","eval_strategy","eval_use_gather_object","fp16","fp16_full_eval","gradient_accumulation_steps","gradient_checkpointing","gradient_checkpointing_kwargs","id2label","include_for_metrics","include_num_input_tokens_seen","initializer_range","is_encoder_decoder","label2id","label_smoothing_factor","layer_norm_epsilon","learning_rate","liger_kernel_config","logging_first_step","logging_nan_inf_filter","logging_steps","logging_strategy","log_level","log_level_replica","log_on_each_node","lora_alpha","lora_dropout","lora_rank","lr_scheduler_kwargs","lr_scheduler_type","max_grad_norm","max_length","max_steps","method","model_name","model_type","_name_or_path","n_ctx","neftune_noise_alpha","n_embd","n_head","n_inner","n_layer","n_positions","num_epochs","num_train_epochs","optim","optim_args","optimizer","optim_target_modules","output_attentions","output_dir","output_hidden_states","packing","pad_token_id","per_device_batch_size","per_device_eval_batch_size","per_device_train_batch_size","precision","prediction_loss_only","problem_type","project","reorder_and_upcast_attn","report_to","resid_pdrop","return_dict","run_name","scale_attn_by_inverse_layer_idx","scale_attn_weights","summary_activation","summary_first_dropout","summary_proj_to_labels","summary_type","summary_use_proj","task_specific_params","tf32","tie_word_embeddings","torch_compile","torch_compile_backend","torch_compile_mode","torch_empty_cache_steps","trackio_bucket_id","trackio_space_id","trackio_static_space_id","trainer","transformers_version","use_cache","use_liger_kernel","vocab_size","warmup_steps","weight_decay"],"tags":["mlflow.runName","mlflow.source.name","mlflow.source.type","mlflow.user","resumed"]}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.yaml new file mode 100644 index 00000000000..d596e0c5165 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_run_facet_values_returns_OK_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/facet-values?filter%5Bproject_id%5D=2387&facet_type=tag&facet_name=model + response: + body: '{"data":{"id":"tag:model:2387","type":"facet_values","attributes":{"facet_name":"model","facet_type":"tag","values":[]}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.yaml new file mode 100644 index 00000000000..f39d517a516 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_List_Model_Lab_runs_returns_OK_response.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/model-lab-api/runs + response: + body: '{"data":[{"id":"71355","type":"runs","attributes":{"created_at":"2026-05-18T15:55:50.38705Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/967b528b3e994b34a67348b790f5faba","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///2438/71355/artifacts","name":"qwen36-27b-qlora-fsdp-1779119158-1779119750","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"config_max_length","value":"512"},{"key":"dataset","value":"s3://aip-long-running-jobs/savita.manghnani/qwen3_without_thinking.zip"},{"key":"gradient_accumulation_steps","value":"1"},{"key":"learning_rate","value":"0.0001"},{"key":"lora_alpha","value":"16"},{"key":"lora_dropout","value":"0.1"},{"key":"lora_rank","value":"8"},{"key":"method","value":"qlora-4bit"},{"key":"model_name","value":"Qwen/Qwen3.6-27B"},{"key":"num_epochs","value":"1"},{"key":"optimizer","value":"adamw_8bit"},{"key":"packing","value":"False"},{"key":"per_device_batch_size","value":"2"},{"key":"precision","value":"bf16"},{"key":"trainer","value":"trl-sft-raytrain"}],"project_id":2438,"started_at":"2026-05-18T15:55:50.275Z","status":"running","tags":[{"key":"mlflow.runName","value":"qwen36-27b-qlora-fsdp-1779119158-1779119750"},{"key":"mlflow.source.name","value":"/home/ray/.venv/lib/python3.12/site-packages/ray/_private/workers/default_worker.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"resumed","value":"false"}],"updated_at":"2026-05-18T15:55:50.399903Z"}},{"id":"71354","type":"runs","attributes":{"created_at":"2026-05-18T15:46:35.963967Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/018cbd19633e47f7b57d140b63f2f99e","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///2437/71354/artifacts","name":"qwen36-27b-lora-bf16-fsdp-1779118712-1779119195","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"config_max_length","value":"512"},{"key":"dataset","value":"s3://aip-long-running-jobs/savita.manghnani/qwen3_without_thinking.zip"},{"key":"gradient_accumulation_steps","value":"1"},{"key":"learning_rate","value":"0.0001"},{"key":"lora_alpha","value":"16"},{"key":"lora_dropout","value":"0.1"},{"key":"lora_rank","value":"8"},{"key":"method","value":"lora"},{"key":"model_name","value":"Qwen/Qwen3.6-27B"},{"key":"num_epochs","value":"1"},{"key":"optimizer","value":"adamw_8bit"},{"key":"packing","value":"False"},{"key":"per_device_batch_size","value":"2"},{"key":"precision","value":"bf16"},{"key":"trainer","value":"trl-sft-raytrain"}],"project_id":2437,"started_at":"2026-05-18T15:46:35.799Z","status":"running","tags":[{"key":"mlflow.runName","value":"qwen36-27b-lora-bf16-fsdp-1779118712-1779119195"},{"key":"mlflow.source.name","value":"/home/ray/.venv/lib/python3.12/site-packages/ray/_private/workers/default_worker.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"resumed","value":"false"}],"updated_at":"2026-05-18T15:46:35.980176Z"}},{"id":"71353","type":"runs","attributes":{"created_at":"2026-05-18T14:36:11.550137Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/7ea36d29bbaf4e74abd124f08abe514e","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"system/total_input_tokens","min":10240,"max":10240,"mean":10240,"latest":10240,"count":1,"first_step":0,"last_step":0},{"key":"system/total_token_throughput","min":1627.7501525189548,"max":1627.7501525189548,"mean":1627.7501525189548,"latest":1627.7501525189548,"count":1,"first_step":0,"last_step":0},{"key":"system/median_itl_ms","min":35.59626202331856,"max":35.59626202331856,"mean":35.59626202331856,"latest":35.59626202331856,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_decode","min":0.048628,"max":0.048628,"mean":0.048628,"latest":0.048628,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_e2el_ms","min":6844.651613000315,"max":6844.651613000315,"mean":6844.651613000315,"latest":6844.651613000315,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_itl_ms","min":42.46556939943183,"max":42.46556939943183,"mean":42.46556939943183,"latest":42.46556939943183,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_itl_ms","min":224.5777664042544,"max":224.5777664042544,"mean":224.5777664042544,"latest":224.5777664042544,"count":1,"first_step":0,"last_step":0},{"key":"system/completion_rate","min":1,"max":1,"mean":1,"latest":0,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_ttft_ms","min":1720.476923091337,"max":1720.476923091337,"mean":1720.476923091337,"latest":1720.476923091337,"count":1,"first_step":0,"last_step":0},{"key":"system/median_tpot_ms","min":41.04991006301936,"max":41.04991006301936,"mean":41.04991006301936,"latest":41.04991006301936,"count":1,"first_step":0,"last_step":0},{"key":"system/num_prompts","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_e2el_ms","min":7012.529445069376,"max":7012.529445069376,"mean":7012.529445069376,"latest":7012.529445069376,"count":1,"first_step":0,"last_step":0},{"key":"system/request_throughput","min":1.4227341600550256,"max":1.4227341600550256,"mean":1.4227341600550256,"latest":1.4227341600550256,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_per_hour","min":0.5,"max":0.5,"mean":0.5,"latest":0.5,"count":1,"first_step":0,"last_step":0},{"key":"cost/input_cost_per_mtok","min":0.037,"max":0.037,"mean":0.037,"latest":0.037,"count":1,"first_step":0,"last_step":0},{"key":"cost/output_cost_per_mtok","min":0.6449,"max":0.6449,"mean":0.6449,"latest":0.6449,"count":1,"first_step":0,"last_step":0},{"key":"system/duration","min":7.028719968046062,"max":7.028719968046062,"mean":7.028719968046062,"latest":7.028719968046062,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_tpot_ms","min":46.36904549927383,"max":46.36904549927383,"mean":46.36904549927383,"latest":46.36904549927383,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_tpot_ms","min":92.36138276634182,"max":92.36138276634182,"mean":92.36138276634182,"latest":92.36138276634182,"count":1,"first_step":0,"last_step":0},{"key":"system/total_output_tokens","min":1201,"max":1201,"mean":1201,"latest":1201,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_prefill","min":0.117495,"max":0.117495,"mean":0.117495,"latest":0.117495,"count":1,"first_step":0,"last_step":0},{"key":"system/completed","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"system/median_e2el_ms","min":6965.079715999309,"max":6965.079715999309,"mean":6965.079715999309,"latest":6965.079715999309,"count":1,"first_step":0,"last_step":0},{"key":"system/median_ttft_ms","min":1751.7411379958503,"max":1751.7411379958503,"mean":1751.7411379958503,"latest":1751.7411379958503,"count":1,"first_step":0,"last_step":0},{"key":"system/output_throughput","min":170.87037262260858,"max":170.87037262260858,"mean":170.87037262260858,"latest":170.87037262260858,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_ttft_ms","min":2365.1834659359884,"max":2365.1834659359884,"mean":2365.1834659359884,"latest":2365.1834659359884,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2436/71353/artifacts","name":"L4-gpt-oss-20b","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"enable_chunked_prefill","value":"True"},{"key":"enable_prefix_caching","value":"False"},{"key":"gpu_memory_utilization","value":"0.95"},{"key":"gpu_type","value":"L4"},{"key":"model","value":"openai/gpt-oss-20b"},{"key":"model.basename","value":"gpt-oss-20b"},{"key":"service_name","value":"gpt-oss-20b-bench-bgtu"},{"key":"tensor_parallel_size","value":"1"},{"key":"vllm.image","value":"727006795293.dkr.ecr.us-east-1.amazonaws.com/dd-source/domains/data_science/llm/apps/ray-llm-service:vllm-bleeding-edge-nydus"}],"project_id":2436,"started_at":"2026-05-18T14:36:11.37Z","status":"completed","tags":[{"key":"leaderboard","value":"true"}],"updated_at":"2026-05-18T14:36:16.155066Z"}},{"id":"71352","type":"runs","attributes":{"created_at":"2026-05-18T14:36:06.518157Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/b7cc8492b38748a68e591dc0a39b7a22","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"system/mean_tpot_ms","min":43.4315888917873,"max":43.4315888917873,"mean":43.4315888917873,"latest":43.4315888917873,"count":1,"first_step":0,"last_step":0},{"key":"system/median_tpot_ms","min":43.51078476765978,"max":43.51078476765978,"mean":43.51078476765978,"latest":43.51078476765978,"count":1,"first_step":0,"last_step":0},{"key":"system/output_throughput","min":149.83232267595528,"max":149.83232267595528,"mean":149.83232267595528,"latest":149.83232267595528,"count":1,"first_step":0,"last_step":0},{"key":"system/request_throughput","min":1.1705650209059006,"max":1.1705650209059006,"mean":1.1705650209059006,"latest":1.1705650209059006,"count":1,"first_step":0,"last_step":0},{"key":"system/median_itl_ms","min":40.42643454158679,"max":40.42643454158679,"mean":40.42643454158679,"latest":40.42643454158679,"count":1,"first_step":0,"last_step":0},{"key":"cost/output_cost_per_mtok","min":0.4206,"max":0.4206,"mean":0.4206,"latest":0.4206,"count":1,"first_step":0,"last_step":0},{"key":"system/duration","min":6.834306388045661,"max":6.834306388045661,"mean":6.834306388045661,"latest":6.834306388045661,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_itl_ms","min":43.060154871227496,"max":43.060154871227496,"mean":43.060154871227496,"latest":43.060154871227496,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_ttft_ms","min":1236.150400378392,"max":1236.150400378392,"mean":1236.150400378392,"latest":1236.150400378392,"count":1,"first_step":0,"last_step":0},{"key":"system/median_ttft_ms","min":1221.9488615519367,"max":1221.9488615519367,"mean":1221.9488615519367,"latest":1221.9488615519367,"count":1,"first_step":0,"last_step":0},{"key":"system/num_prompts","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_tpot_ms","min":48.08998211418044,"max":48.08998211418044,"mean":48.08998211418044,"latest":48.08998211418044,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_decode","min":0.064611,"max":0.064611,"mean":0.064611,"latest":0.064611,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_prefill","min":0.083986,"max":0.083986,"mean":0.083986,"latest":0.083986,"count":1,"first_step":0,"last_step":0},{"key":"system/completed","min":8,"max":8,"mean":8,"latest":8,"count":1,"first_step":0,"last_step":0},{"key":"system/median_e2el_ms","min":6749.058461980894,"max":6749.058461980894,"mean":6749.058461980894,"latest":6749.058461980894,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_itl_ms","min":123.0954357003793,"max":123.0954357003793,"mean":123.0954357003793,"latest":123.0954357003793,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_ttft_ms","min":1679.515644611092,"max":1679.515644611092,"mean":1679.515644611092,"latest":1679.515644611092,"count":1,"first_step":0,"last_step":0},{"key":"system/total_input_tokens","min":8192,"max":8192,"mean":8192,"latest":8192,"count":1,"first_step":0,"last_step":0},{"key":"system/total_output_tokens","min":1024,"max":1024,"mean":1024,"latest":1024,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_per_hour","min":0.5,"max":0.5,"mean":0.5,"latest":0.5,"count":1,"first_step":0,"last_step":0},{"key":"cost/input_cost_per_mtok","min":0.0263,"max":0.0263,"mean":0.0263,"latest":0.0263,"count":1,"first_step":0,"last_step":0},{"key":"system/completion_rate","min":0.8,"max":0.8,"mean":0.8,"latest":0.8,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_e2el_ms","min":6751.962189635378,"max":6751.962189635378,"mean":6751.962189635378,"latest":6751.962189635378,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_e2el_ms","min":6818.673504971666,"max":6818.673504971666,"mean":6818.673504971666,"latest":6818.673504971666,"count":1,"first_step":0,"last_step":0},{"key":"system/total_token_throughput","min":1348.4909040835976,"max":1348.4909040835976,"mean":1348.4909040835976,"latest":1348.4909040835976,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2435/71352/artifacts","name":"L4-Qwen3.5-4B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"enable_chunked_prefill","value":"True"},{"key":"enable_prefix_caching","value":"False"},{"key":"gpu_memory_utilization","value":"0.95"},{"key":"gpu_type","value":"L4"},{"key":"model","value":"Qwen/Qwen3.5-4B"},{"key":"model.basename","value":"Qwen3.5-4B"},{"key":"service_name","value":"qwen3-5-4b-bench-3t8u"},{"key":"tensor_parallel_size","value":"1"},{"key":"vllm.image","value":"727006795293.dkr.ecr.us-east-1.amazonaws.com/dd-source/domains/data_science/llm/apps/ray-llm-service:vllm-bleeding-edge-nydus"}],"project_id":2435,"started_at":"2026-05-18T14:36:06.322Z","status":"completed","tags":[{"key":"leaderboard","value":"true"}],"updated_at":"2026-05-18T14:36:11.155341Z"}},{"id":"71351","type":"runs","attributes":{"created_at":"2026-05-18T14:36:01.262504Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/1a7acda0ecc04ca280b77c2f5bef8dc2","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"system/mean_itl_ms","min":10.056404993260262,"max":10.056404993260262,"mean":10.056404993260262,"latest":10.056404993260262,"count":1,"first_step":0,"last_step":0},{"key":"system/median_tpot_ms","min":10.248206653008898,"max":10.248206653008898,"mean":10.248206653008898,"latest":10.248206653008898,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_itl_ms","min":59.449308563488955,"max":59.449308563488955,"mean":59.449308563488955,"latest":59.449308563488955,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_tpot_ms","min":10.799848160644128,"max":10.799848160644128,"mean":10.799848160644128,"latest":10.799848160644128,"count":1,"first_step":0,"last_step":0},{"key":"system/total_output_tokens","min":896,"max":896,"mean":896,"latest":896,"count":1,"first_step":0,"last_step":0},{"key":"system/total_token_throughput","min":4736.073511532153,"max":4736.073511532153,"mean":4736.073511532153,"latest":4736.073511532153,"count":1,"first_step":0,"last_step":0},{"key":"cost/input_cost_per_mtok","min":0.0238,"max":0.0238,"mean":0.0238,"latest":0.0238,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_e2el_ms","min":1663.88821718283,"max":1663.88821718283,"mean":1663.88821718283,"latest":1663.88821718283,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_tpot_ms","min":10.16328207094587,"max":10.16328207094587,"mean":10.16328207094587,"latest":10.16328207094587,"count":1,"first_step":0,"last_step":0},{"key":"system/output_throughput","min":526.2303901702393,"max":526.2303901702393,"mean":526.2303901702393,"latest":526.2303901702393,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_e2el_ms","min":1673.3655747771263,"max":1673.3655747771263,"mean":1673.3655747771263,"latest":1673.3655747771263,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_per_hour","min":1.35,"max":1.35,"mean":1.35,"latest":1.35,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_decode","min":0.035789,"max":0.035789,"mean":0.035789,"latest":0.035789,"count":1,"first_step":0,"last_step":0},{"key":"cost/output_cost_per_mtok","min":0.2962,"max":0.2962,"mean":0.2962,"latest":0.2962,"count":1,"first_step":0,"last_step":0},{"key":"system/completion_rate","min":0.7,"max":0.7,"mean":0.7,"latest":0.7,"count":1,"first_step":0,"last_step":0},{"key":"system/median_itl_ms","min":9.22439800342545,"max":9.22439800342545,"mean":9.22439800342545,"latest":9.22439800342545,"count":1,"first_step":0,"last_step":0},{"key":"system/median_ttft_ms","min":370.5793390981853,"max":370.5793390981853,"mean":370.5793390981853,"latest":370.5793390981853,"count":1,"first_step":0,"last_step":0},{"key":"system/num_prompts","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"system/total_input_tokens","min":7168,"max":7168,"mean":7168,"latest":7168,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_prefill","min":0.076802,"max":0.076802,"mean":0.076802,"latest":0.076802,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_ttft_ms","min":373.15139417270467,"max":373.15139417270467,"mean":373.15139417270467,"latest":373.15139417270467,"count":1,"first_step":0,"last_step":0},{"key":"system/median_e2el_ms","min":1666.9419680256397,"max":1666.9419680256397,"mean":1666.9419680256397,"latest":1666.9419680256397,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_ttft_ms","min":442.06858904799446,"max":442.06858904799446,"mean":442.06858904799446,"latest":442.06858904799446,"count":1,"first_step":0,"last_step":0},{"key":"system/request_throughput","min":4.111174923204994,"max":4.111174923204994,"mean":4.111174923204994,"latest":4.111174923204994,"count":1,"first_step":0,"last_step":0},{"key":"system/completed","min":7,"max":7,"mean":7,"latest":7,"count":1,"first_step":0,"last_step":0},{"key":"system/duration","min":1.7026762739988044,"max":1.7026762739988044,"mean":1.7026762739988044,"latest":1.7026762739988044,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2434/71351/artifacts","name":"A100-Qwen3-4B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"enable_chunked_prefill","value":"True"},{"key":"enable_prefix_caching","value":"False"},{"key":"gpu_memory_utilization","value":"0.95"},{"key":"gpu_type","value":"A100"},{"key":"model","value":"Qwen/Qwen3-4B"},{"key":"model.basename","value":"Qwen3-4B"},{"key":"service_name","value":"qwen3-4b-bench-95qm"},{"key":"tensor_parallel_size","value":"1"},{"key":"vllm.image","value":"727006795293.dkr.ecr.us-east-1.amazonaws.com/dd-source/domains/data_science/llm/apps/ray-llm-service:vllm-bleeding-edge-nydus"}],"project_id":2434,"started_at":"2026-05-18T14:36:00.552Z","status":"completed","tags":[{"key":"leaderboard","value":"true"}],"updated_at":"2026-05-18T14:36:06.038833Z"}},{"id":"71350","type":"runs","attributes":{"created_at":"2026-05-18T14:35:55.810039Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/bcf3d94123df44e1b94c4d3b441f8660","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"cost/gpu_cost_usd_decode","min":0.051152,"max":0.051152,"mean":0.051152,"latest":0.051152,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_e2el_ms","min":1780.398302944377,"max":1780.398302944377,"mean":1780.398302944377,"latest":1780.398302944377,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_tpot_ms","min":12.372558590439038,"max":12.372558590439038,"mean":12.372558590439038,"latest":12.372558590439038,"count":1,"first_step":0,"last_step":0},{"key":"system/median_ttft_ms","min":209.0833619586192,"max":209.0833619586192,"mean":209.0833619586192,"latest":209.0833619586192,"count":1,"first_step":0,"last_step":0},{"key":"system/num_prompts","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_per_hour","min":1.35,"max":1.35,"mean":1.35,"latest":1.35,"count":1,"first_step":0,"last_step":0},{"key":"cost/input_cost_per_mtok","min":0.0294,"max":0.0294,"mean":0.0294,"latest":0.0294,"count":1,"first_step":0,"last_step":0},{"key":"system/completion_rate","min":0.2,"max":0.2,"mean":0.2,"latest":0.2,"count":1,"first_step":0,"last_step":0},{"key":"system/duration","min":1.8296654969453812,"max":1.8296654969453812,"mean":1.8296654969453812,"latest":1.8296654969453812,"count":1,"first_step":0,"last_step":0},{"key":"system/median_e2el_ms","min":1780.398302944377,"max":1780.398302944377,"mean":1780.398302944377,"latest":1780.398302944377,"count":1,"first_step":0,"last_step":0},{"key":"system/median_itl_ms","min":11.988877027761191,"max":11.988877027761191,"mean":11.988877027761191,"latest":11.988877027761191,"count":1,"first_step":0,"last_step":0},{"key":"system/output_throughput","min":139.91628547807832,"max":139.91628547807832,"mean":139.91628547807832,"latest":139.91628547807832,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_e2el_ms","min":1805.3105722554028,"max":1805.3105722554028,"mean":1805.3105722554028,"latest":1805.3105722554028,"count":1,"first_step":0,"last_step":0},{"key":"system/completed","min":2,"max":2,"mean":2,"latest":2,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_ttft_ms","min":209.0833619586192,"max":209.0833619586192,"mean":209.0833619586192,"latest":209.0833619586192,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_itl_ms","min":25.041629734914697,"max":25.041629734914697,"mean":25.041629734914697,"latest":25.041629734914697,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_ttft_ms","min":257.9028429754544,"max":257.9028429754544,"mean":257.9028429754544,"latest":257.9028429754544,"count":1,"first_step":0,"last_step":0},{"key":"system/request_throughput","min":1.093095980297487,"max":1.093095980297487,"mean":1.093095980297487,"latest":1.093095980297487,"count":1,"first_step":0,"last_step":0},{"key":"system/total_output_tokens","min":256,"max":256,"mean":256,"latest":256,"count":1,"first_step":0,"last_step":0},{"key":"system/total_token_throughput","min":1259.246569302705,"max":1259.246569302705,"mean":1259.246569302705,"latest":1259.246569302705,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_prefill","min":0.095492,"max":0.095492,"mean":0.095492,"latest":0.095492,"count":1,"first_step":0,"last_step":0},{"key":"cost/output_cost_per_mtok","min":0.333,"max":0.333,"mean":0.333,"latest":0.333,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_itl_ms","min":12.273241152342962,"max":12.273241152342962,"mean":12.273241152342962,"latest":12.273241152342962,"count":1,"first_step":0,"last_step":0},{"key":"system/median_tpot_ms","min":12.372558590439038,"max":12.372558590439038,"mean":12.372558590439038,"latest":12.372558590439038,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_tpot_ms","min":12.560804351902105,"max":12.560804351902105,"mean":12.560804351902105,"latest":12.560804351902105,"count":1,"first_step":0,"last_step":0},{"key":"system/total_input_tokens","min":2048,"max":2048,"mean":2048,"latest":2048,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2433/71350/artifacts","name":"A100-Qwen2.5-Coder-7B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"enable_chunked_prefill","value":"True"},{"key":"enable_prefix_caching","value":"False"},{"key":"gpu_memory_utilization","value":"0.95"},{"key":"gpu_type","value":"A100"},{"key":"model","value":"Qwen/Qwen2.5-Coder-7B"},{"key":"model.basename","value":"Qwen2.5-Coder-7B"},{"key":"service_name","value":"qwen2-5-coder-7b-bench-py78"},{"key":"tensor_parallel_size","value":"1"},{"key":"vllm.image","value":"727006795293.dkr.ecr.us-east-1.amazonaws.com/dd-source/domains/data_science/llm/apps/ray-llm-service:vllm-bleeding-edge-nydus"}],"project_id":2433,"started_at":"2026-05-18T14:35:55.625Z","status":"completed","tags":[{"key":"leaderboard","value":"true"}],"updated_at":"2026-05-18T14:36:00.339161Z"}},{"id":"71349","type":"runs","attributes":{"created_at":"2026-05-18T14:35:50.654902Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/56ad4005ff9e40d1a0e106d5b60130c6","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"system/duration","min":2.3674380170414224,"max":2.3674380170414224,"mean":2.3674380170414224,"latest":2.3674380170414224,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_itl_ms","min":14.932849314997535,"max":14.932849314997535,"mean":14.932849314997535,"latest":14.932849314997535,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_tpot_ms","min":15.084737073538427,"max":15.084737073538427,"mean":15.084737073538427,"latest":15.084737073538427,"count":1,"first_step":0,"last_step":0},{"key":"system/median_e2el_ms","min":2337.1160394744948,"max":2337.1160394744948,"mean":2337.1160394744948,"latest":2337.1160394744948,"count":1,"first_step":0,"last_step":0},{"key":"system/median_tpot_ms","min":14.985868310845479,"max":14.985868310845479,"mean":14.985868310845479,"latest":14.985868310845479,"count":1,"first_step":0,"last_step":0},{"key":"system/output_throughput","min":324.40131250395586,"max":324.40131250395586,"mean":324.40131250395586,"latest":324.40131250395586,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_itl_ms","min":44.13257779670086,"max":44.13257779670086,"mean":44.13257779670086,"latest":44.13257779670086,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_decode","min":0.08031,"max":0.08031,"mean":0.08031,"latest":0.08031,"count":1,"first_step":0,"last_step":0},{"key":"system/completion_rate","min":0.6,"max":0.6,"mean":0.6,"latest":0.6,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_ttft_ms","min":418.6328283588712,"max":418.6328283588712,"mean":418.6328283588712,"latest":418.6328283588712,"count":1,"first_step":0,"last_step":0},{"key":"system/request_throughput","min":2.534385253937155,"max":2.534385253937155,"mean":2.534385253937155,"latest":2.534385253937155,"count":1,"first_step":0,"last_step":0},{"key":"system/total_output_tokens","min":768,"max":768,"mean":768,"latest":768,"count":1,"first_step":0,"last_step":0},{"key":"system/total_token_throughput","min":2919.6118125356024,"max":2919.6118125356024,"mean":2919.6118125356024,"latest":2919.6118125356024,"count":1,"first_step":0,"last_step":0},{"key":"cost/output_cost_per_mtok","min":0.3921,"max":0.3921,"mean":0.3921,"latest":0.3921,"count":1,"first_step":0,"last_step":0},{"key":"system/completed","min":6,"max":6,"mean":6,"latest":6,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_e2el_ms","min":2351.7342927632853,"max":2351.7342927632853,"mean":2351.7342927632853,"latest":2351.7342927632853,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_tpot_ms","min":15.822381030412492,"max":15.822381030412492,"mean":15.822381030412492,"latest":15.822381030412492,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_usd_prefill","min":0.112268,"max":0.112268,"mean":0.112268,"latest":0.112268,"count":1,"first_step":0,"last_step":0},{"key":"cost/input_cost_per_mtok","min":0.0343,"max":0.0343,"mean":0.0343,"latest":0.0343,"count":1,"first_step":0,"last_step":0},{"key":"system/mean_e2el_ms","min":2334.394436698252,"max":2334.394436698252,"mean":2334.394436698252,"latest":2334.394436698252,"count":1,"first_step":0,"last_step":0},{"key":"system/median_itl_ms","min":14.451904979068786,"max":14.451904979068786,"mean":14.451904979068786,"latest":14.451904979068786,"count":1,"first_step":0,"last_step":0},{"key":"system/median_ttft_ms","min":433.9107639971189,"max":433.9107639971189,"mean":433.9107639971189,"latest":433.9107639971189,"count":1,"first_step":0,"last_step":0},{"key":"system/num_prompts","min":10,"max":10,"mean":10,"latest":10,"count":1,"first_step":0,"last_step":0},{"key":"system/p99_ttft_ms","min":513.0678390269168,"max":513.0678390269168,"mean":513.0678390269168,"latest":513.0678390269168,"count":1,"first_step":0,"last_step":0},{"key":"system/total_input_tokens","min":6144,"max":6144,"mean":6144,"latest":6144,"count":1,"first_step":0,"last_step":0},{"key":"cost/gpu_cost_per_hour","min":1.35,"max":1.35,"mean":1.35,"latest":1.35,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///2432/71349/artifacts","name":"A100-Qwen3-8B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"enable_chunked_prefill","value":"True"},{"key":"enable_prefix_caching","value":"False"},{"key":"gpu_memory_utilization","value":"0.95"},{"key":"gpu_type","value":"A100"},{"key":"model","value":"Qwen/Qwen3-8B"},{"key":"model.basename","value":"Qwen3-8B"},{"key":"service_name","value":"qwen3-8b-bench-n3rw"},{"key":"tensor_parallel_size","value":"1"},{"key":"vllm.image","value":"727006795293.dkr.ecr.us-east-1.amazonaws.com/dd-source/domains/data_science/llm/apps/ray-llm-service:vllm-bleeding-edge-nydus"}],"project_id":2432,"started_at":"2026-05-18T14:35:50.433Z","status":"completed","tags":[{"key":"leaderboard","value":"true"}],"updated_at":"2026-05-18T14:35:55.408334Z"}},{"id":"71348","type":"runs","attributes":{"completed_at":"2026-05-18T11:11:41.612Z","created_at":"2026-05-18T11:11:40.928813Z","descendant_match":false,"description":"","duration":0.794,"external_url":"https://mlflow.us1.staging.dog/#/runs/202b5372db464aa28c3ddcca74cb7432","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///1017/71348/artifacts","name":"user_service_ranker_2026-05-17","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"early_stopping_rounds","value":"20"},{"key":"features","value":"[''similarity_score'', + ''nb_page_views'', ''nb_days_with_page_view'', ''nb_views_since_last_page_view'', + ''nb_explorer_searches'', ''nb_days_with_explorer_search'', ''nb_searches_since_last_explorer_search'', + ''nb_cmdk_searches'', ''nb_days_with_cmdk_search'', ''nb_searches_since_last_cmdk_search'', + ''is_faves'', ''similarity_score_rank'', ''nb_page_views_rank'', ''nb_days_with_page_view_rank'', + ''nb_views_since_last_page_view_rank'', ''nb_explorer_searches_rank'', ''nb_days_with_explorer_search_rank'', + ''nb_searches_since_last_explorer_search_rank'', ''nb_cmdk_searches_rank'', + ''nb_days_with_cmdk_search_rank'', ''nb_searches_since_last_cmdk_search_rank'']"},{"key":"learning_rate","value":"0.2"},{"key":"max_depth","value":"3"},{"key":"metric","value":"ndcg"},{"key":"min_child_samples","value":"20"},{"key":"n_estimators","value":"500"},{"key":"n_groups_train","value":"242"},{"key":"n_groups_val","value":"27"},{"key":"num_leaves","value":"8"},{"key":"num_samples","value":"23883"},{"key":"objective","value":"lambdarank"},{"key":"random_state","value":"42"},{"key":"reg_alpha","value":"0.0"},{"key":"reg_lambda","value":"0.0"}],"project_id":1017,"started_at":"2026-05-18T11:11:40.818Z","status":"completed","tags":[{"key":"mlflow.runName","value":"user_service_ranker_2026-05-17"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"}],"updated_at":"2026-05-18T11:11:41.758491Z"}},{"id":"71347","type":"runs","attributes":{"created_at":"2026-05-18T09:53:57.946125Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/a35df0b9b9b84b35a2e88ac087379036","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///1742/71347/artifacts","name":"QWEN3.5-9B","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"benchmark_type","value":"system"},{"key":"gpu_type","value":"A100"},{"key":"model","value":"QWEN/QWEN3.5-9B"}],"project_id":1742,"started_at":"2026-05-18T09:53:57.706Z","status":"running","tags":[{"key":"experiment_name","value":"qwen3-5-9b-exp"}],"updated_at":"2026-05-18T09:53:57.959737Z"}},{"id":"71346","type":"runs","attributes":{"created_at":"2026-05-18T09:53:42.9892Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/80746aeb3147419f90ded5fc615a80aa","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///1742/71346/artifacts","name":"nonexistent-model-xyz","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"benchmark_type","value":"system"},{"key":"gpu_type","value":"L4"},{"key":"model","value":"FakeOrg/nonexistent-model-xyz"}],"project_id":1742,"started_at":"2026-05-18T09:53:42.738Z","status":"running","tags":[],"updated_at":"2026-05-18T09:53:43.000724Z"}},{"id":"71345","type":"runs","attributes":{"completed_at":"2026-05-18T08:45:15.968Z","created_at":"2026-05-18T08:45:07.586505Z","descendant_match":false,"description":"","duration":8.752,"external_url":"https://mlflow.us1.staging.dog/#/runs/203405f363da49529372474f59453dcd","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"gold_accuracy","min":0.8941176470588236,"max":0.8941176470588236,"mean":0.8941176470588236,"latest":0.8941176470588236,"count":1,"first_step":0,"last_step":0},{"key":"gold_recall","min":0.5,"max":0.5,"mean":0.5,"latest":0.5,"count":1,"first_step":0,"last_step":0},{"key":"gold_tn","min":74,"max":74,"mean":74,"latest":74,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_fn","min":238,"max":238,"mean":238,"latest":238,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_fp","min":5,"max":5,"mean":5,"latest":5,"count":1,"first_step":0,"last_step":0},{"key":"sweep_gold_fp","min":0,"max":81,"mean":16.235294117647058,"latest":18,"count":17,"first_step":0,"last_step":86},{"key":"sweep_snorkel_tp","min":115,"max":828,"mean":549.4,"latest":828,"count":15,"first_step":0,"last_step":99},{"key":"gold_f1_score","min":0.3076923076923077,"max":0.3076923076923077,"mean":0.3076923076923077,"latest":0.3076923076923077,"count":1,"first_step":0,"last_step":0},{"key":"gold_roc_auc","min":0.95679012345679,"max":0.95679012345679,"mean":0.95679012345679,"latest":0.95679012345679,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_accuracy","min":0.942376096751245,"max":0.942376096751245,"mean":0.942376096751245,"latest":0.942376096751245,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_tp","min":590,"max":590,"mean":590,"latest":590,"count":1,"first_step":0,"last_step":0},{"key":"sweep_snorkel_fn","min":0,"max":713,"mean":278.6,"latest":30,"count":15,"first_step":0,"last_step":99},{"key":"gold_precision","min":0.2222222222222222,"max":0.2222222222222222,"mean":0.2222222222222222,"latest":0.2222222222222222,"count":1,"first_step":0,"last_step":0},{"key":"gold_tp","min":2,"max":2,"mean":2,"latest":2,"count":1,"first_step":0,"last_step":0},{"key":"sweep_gold_f1_score","min":0.0898876404494382,"max":0.6666666666666666,"mean":0.35542231104842736,"latest":0.30769230769230765,"count":17,"first_step":0,"last_step":86},{"key":"sweep_snorkel_precision","min":0.1963481147735357,"max":1,"mean":0.8833905951822458,"latest":0.9978401727861771,"count":15,"first_step":0,"last_step":99},{"key":"sweep_snorkel_fp","min":0,"max":3389,"mean":290.8,"latest":6,"count":15,"first_step":0,"last_step":99},{"key":"snorkel_precision","min":0.9915966386554622,"max":0.9915966386554622,"mean":0.9915966386554622,"latest":0.9915966386554622,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_roc_auc","min":0.9928354095304073,"max":0.9928354095304073,"mean":0.9928354095304073,"latest":0.9928354095304073,"count":1,"first_step":0,"last_step":0},{"key":"sweep_snorkel_recall","min":0.1388888888888889,"max":1,"mean":0.6635265700483092,"latest":0.2572463768115942,"count":15,"first_step":0,"last_step":99},{"key":"gold_fp","min":7,"max":7,"mean":7,"latest":7,"count":1,"first_step":0,"last_step":0},{"key":"sweep_gold_recall","min":0.25,"max":1,"mean":0.8088235294117647,"latest":0.5,"count":17,"first_step":0,"last_step":86},{"key":"sweep_gold_tn","min":0,"max":81,"mean":64.76470588235294,"latest":63,"count":17,"first_step":0,"last_step":86},{"key":"sweep_snorkel_f1_score","min":0.24390243902439027,"max":0.9226044226044227,"mean":0.6706883729826749,"latest":0.9226044226044227,"count":15,"first_step":0,"last_step":99},{"key":"snorkel_tn","min":3384,"max":3384,"mean":3384,"latest":3384,"count":1,"first_step":0,"last_step":0},{"key":"sweep_gold_fn","min":0,"max":3,"mean":0.7647058823529411,"latest":0,"count":17,"first_step":0,"last_step":86},{"key":"sweep_gold_precision","min":0.047058823529411764,"max":1,"mean":0.3126587632153479,"latest":0.21052631578947367,"count":17,"first_step":0,"last_step":86},{"key":"sweep_gold_tp","min":1,"max":4,"mean":3.235294117647059,"latest":2,"count":17,"first_step":0,"last_step":86},{"key":"sweep_snorkel_tn","min":0,"max":3389,"mean":3098.2,"latest":3389,"count":15,"first_step":0,"last_step":99},{"key":"gold_fn","min":2,"max":2,"mean":2,"latest":2,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_f1_score","min":0.8292340126493324,"max":0.8292340126493324,"mean":0.8292340126493324,"latest":0.8292340126493324,"count":1,"first_step":0,"last_step":0},{"key":"snorkel_recall","min":0.7125603864734299,"max":0.7125603864734299,"mean":0.7125603864734299,"latest":0.7125603864734299,"count":1,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///488/71345/artifacts","name":"","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"is_unbalance","value":"True"},{"key":"learning_rate","value":"0.02"},{"key":"min_data_in_leaf","value":"100"},{"key":"n_estimators","value":"600"},{"key":"n_gold_samples","value":"85"},{"key":"n_jobs","value":"1"},{"key":"n_orgs","value":"1"},{"key":"n_snorkel_samples","value":"4217"},{"key":"n_training_samples","value":"229660"},{"key":"num_leaves","value":"31"},{"key":"org_ids","value":"[2]"},{"key":"random_state","value":"42"},{"key":"run_date","value":"2026-05-17"},{"key":"testing_window_days","value":"7"},{"key":"tfidf_lowercase","value":"False"},{"key":"tfidf_max_df","value":"0.95"},{"key":"tfidf_max_features","value":"30000"},{"key":"tfidf_min_df","value":"5"},{"key":"tfidf_ngram_range","value":"(1, + 2)"},{"key":"train_optimal_f1_threshold","value":"0.4115"},{"key":"training_window_days","value":"91"},{"key":"verbosity","value":"-1"},{"key":"version","value":"1"}],"project_id":488,"started_at":"2026-05-18T08:45:07.216Z","status":"completed","tags":[{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"n_orgs","value":"1"},{"key":"version","value":"1"}],"updated_at":"2026-05-18T08:45:16.3591Z"}},{"id":"71344","type":"runs","attributes":{"completed_at":"2026-05-18T05:03:26.966Z","created_at":"2026-05-18T05:01:59.834451Z","descendant_match":false,"description":"","duration":87.237,"external_url":"https://mlflow.us1.staging.dog/#/runs/2b10271e3e1546359da360a651c17bfa","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"accuracy","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0},{"key":"precision","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0},{"key":"recall","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///487/71344/artifacts","name":"mortar_train_test_alias_loading_partitioned_model","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"max_depth","value":"30"},{"key":"min_samples_leaf","value":"5"},{"key":"min_samples_split","value":"10"},{"key":"n_estimators","value":"100"}],"project_id":487,"started_at":"2026-05-18T05:01:59.729Z","status":"completed","tags":[{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"mortar_train_test_alias_loading_partitioned_model"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"train_end","value":"2026-05-18"},{"key":"train_start","value":"2026-05-17"}],"updated_at":"2026-05-18T05:03:27.148977Z"}},{"id":"71343","type":"runs","attributes":{"created_at":"2026-05-18T04:04:13.985851Z","descendant_match":false,"description":"","external_url":"https://mlflow.us1.staging.dog/#/runs/d1a9b44a39c54a34a35b956ce3469328","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"accuracy","min":0.9,"max":0.9,"mean":0.9,"latest":0.9,"count":2,"first_step":0,"last_step":0},{"key":"precision","min":0.9074074074074074,"max":0.9074074074074074,"mean":0.9074074074074074,"latest":0.9074074074074074,"count":2,"first_step":0,"last_step":0},{"key":"recall","min":0.903030303030303,"max":0.903030303030303,"mean":0.903030303030303,"latest":0.903030303030303,"count":2,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///486/71343/artifacts","name":"mortar_train_test_alias_loading_global_model","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"max_depth","value":"30"},{"key":"min_samples_leaf","value":"5"},{"key":"min_samples_split","value":"10"},{"key":"n_estimators","value":"100"}],"project_id":486,"started_at":"2026-05-18T04:04:13.883Z","status":"running","tags":[{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"mortar_train_test_alias_loading_global_model"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"train_end","value":"2026-05-18"},{"key":"train_start","value":"2026-05-17"}],"updated_at":"2026-05-18T04:04:14.000273Z"}},{"id":"71342","type":"runs","attributes":{"completed_at":"2026-05-18T03:01:58.035Z","created_at":"2026-05-18T03:01:30.842651Z","descendant_match":false,"description":"","duration":27.296,"external_url":"https://mlflow.us1.staging.dog/#/runs/6b22a5d0a54842ba9387d88316893fc9","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"accuracy","min":0.9,"max":0.9666666666666667,"mean":0.9438095238095238,"latest":0.9666666666666667,"count":35,"first_step":0,"last_step":0},{"key":"precision","min":0.8783068783068783,"max":0.9777777777777779,"mean":0.9454438947296091,"latest":0.9666666666666667,"count":35,"first_step":0,"last_step":0},{"key":"recall","min":0.875,"max":0.9743589743589745,"mean":0.941554873697731,"latest":0.9722222222222222,"count":35,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///484/71342/artifacts","name":"mortar_train_smoke_testing_partitioned_model","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"max_depth","value":"30"},{"key":"min_samples_leaf","value":"5"},{"key":"min_samples_split","value":"10"}],"project_id":484,"started_at":"2026-05-18T03:01:30.739Z","status":"completed","tags":[{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"mortar_train_smoke_testing_partitioned_model"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"train_end","value":"2026-05-18"},{"key":"train_start","value":"2026-05-17"}],"updated_at":"2026-05-18T03:01:58.176408Z"}},{"id":"71341","type":"runs","attributes":{"completed_at":"2026-05-18T02:12:00.018Z","created_at":"2026-05-18T02:11:33.56821Z","descendant_match":false,"description":"","duration":26.55,"external_url":"https://mlflow.us1.staging.dog/#/runs/f6921c2bc1014234b624d3f0c6e2f83e","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71341/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T02:11:33.468Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-es-us-east-1"}],"updated_at":"2026-05-18T02:12:00.166487Z"}},{"id":"71340","type":"runs","attributes":{"completed_at":"2026-05-18T02:11:52.421Z","created_at":"2026-05-18T02:11:29.581542Z","descendant_match":false,"description":"","duration":22.934,"external_url":"https://mlflow.us1.staging.dog/#/runs/74f4aad59e4f4e66a726afc5db0436e1","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71340/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T02:11:29.487Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-dynamodb-mx-central-1"}],"updated_at":"2026-05-18T02:11:52.554536Z"}},{"id":"71339","type":"runs","attributes":{"completed_at":"2026-05-18T02:11:38.852Z","created_at":"2026-05-18T02:11:17.924126Z","descendant_match":false,"description":"","duration":21.044,"external_url":"https://mlflow.us1.staging.dog/#/runs/fa21144e452d4c6eb1c2ff6bff2dbb57","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71339/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T02:11:17.808Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"pagerduty"}],"updated_at":"2026-05-18T02:11:39.012518Z"}},{"id":"71338","type":"runs","attributes":{"completed_at":"2026-05-18T02:01:48.717Z","created_at":"2026-05-18T02:01:44.062453Z","descendant_match":false,"description":"","duration":4.748,"external_url":"https://mlflow.us1.staging.dog/#/runs/fcf4e0cad9f948dfb6d53eb34e3660be","has_children":false,"is_pinned":false,"metric_summaries":[{"key":"accuracy","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0},{"key":"precision","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0},{"key":"recall","min":1,"max":1,"mean":1,"latest":0,"count":2,"first_step":0,"last_step":0}],"mlflow_artifact_location":"mlflow-artifacts:///484/71338/artifacts","name":"mortar_train_smoke_testing_global_model","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":[{"key":"max_depth","value":"30"},{"key":"min_samples_leaf","value":"5"},{"key":"min_samples_split","value":"10"},{"key":"n_estimators","value":"100"}],"project_id":484,"started_at":"2026-05-18T02:01:43.969Z","status":"completed","tags":[{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"mortar_train_smoke_testing_global_model"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"train_end","value":"2026-05-18"},{"key":"train_start","value":"2026-05-17"}],"updated_at":"2026-05-18T02:01:48.856663Z"}},{"id":"71331","type":"runs","attributes":{"completed_at":"2026-05-18T01:56:03.441Z","created_at":"2026-05-18T01:52:30.49774Z","descendant_match":false,"description":"","duration":213.718,"external_url":"https://mlflow.us1.staging.dog/#/runs/48c65b0e43c049bea60fe45dfa2dca30","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71331/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:52:29.723Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-monitoring-ca-west-1"}],"updated_at":"2026-05-18T01:56:03.578642Z"}},{"id":"71317","type":"runs","attributes":{"completed_at":"2026-05-18T01:55:56.61Z","created_at":"2026-05-18T01:50:27.663599Z","descendant_match":false,"description":"","duration":329.076,"external_url":"https://mlflow.us1.staging.dog/#/runs/3cf809f7034f49f8a45b678ae5b3c55f","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71317/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:50:27.534Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-monitoring-mx-central-1"}],"updated_at":"2026-05-18T01:55:56.756604Z"}},{"id":"71336","type":"runs","attributes":{"completed_at":"2026-05-18T01:54:59.996Z","created_at":"2026-05-18T01:52:55.451932Z","descendant_match":false,"description":"","duration":124.633,"external_url":"https://mlflow.us1.staging.dog/#/runs/bc30dc20a00d4147832435bb46dbb533","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71336/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:52:55.363Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-firehose-me-central-1"}],"updated_at":"2026-05-18T01:55:00.139099Z"}},{"id":"71337","type":"runs","attributes":{"completed_at":"2026-05-18T01:54:52.337Z","created_at":"2026-05-18T01:53:28.702892Z","descendant_match":false,"description":"","duration":83.73,"external_url":"https://mlflow.us1.staging.dog/#/runs/f38436eab3554414a3125a8299273caf","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71337/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:53:28.607Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-firehose-eu-west-3"}],"updated_at":"2026-05-18T01:54:52.600823Z"}},{"id":"71326","type":"runs","attributes":{"completed_at":"2026-05-18T01:54:45.204Z","created_at":"2026-05-18T01:51:44.604428Z","descendant_match":false,"description":"","duration":180.692,"external_url":"https://mlflow.us1.staging.dog/#/runs/eb0fe4f0cbe047308dbe33b61f4b9847","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71326/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:51:44.512Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-monitoring-ap-south-1"}],"updated_at":"2026-05-18T01:54:45.379615Z"}},{"id":"71332","type":"runs","attributes":{"completed_at":"2026-05-18T01:54:38.347Z","created_at":"2026-05-18T01:52:32.3427Z","descendant_match":false,"description":"","duration":126.115,"external_url":"https://mlflow.us1.staging.dog/#/runs/cafb02ded7914103aa4fd260626f3fff","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71332/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:52:32.232Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-kinesis-ap-southeast-3"}],"updated_at":"2026-05-18T01:54:38.494039Z"}},{"id":"71335","type":"runs","attributes":{"completed_at":"2026-05-18T01:54:31.613Z","created_at":"2026-05-18T01:52:49.441594Z","descendant_match":false,"description":"","duration":102.264,"external_url":"https://mlflow.us1.staging.dog/#/runs/eaefc5caf34c45f7bc93448eb0ee2d33","has_children":false,"is_pinned":false,"metric_summaries":[],"mlflow_artifact_location":"mlflow-artifacts:///482/71335/artifacts","name":"vanilla","owner_id":"1d45ac49-1e4e-11f1-8c3a-42221ed6388d","params":null,"project_id":482,"started_at":"2026-05-18T01:52:49.349Z","status":"completed","tags":[{"key":"code_source","value":"dd-analytics"},{"key":"datacenter","value":"us1.staging.dog"},{"key":"mlflow.runName","value":"vanilla"},{"key":"mlflow.source.name","value":"bootstrap_job.py"},{"key":"mlflow.source.type","value":"LOCAL"},{"key":"mlflow.user","value":"dog"},{"key":"model_type","value":"bayesian_model_with_baseline"},{"key":"third_party_provider_service_region","value":"amazonaws-monitoring-us-gov-east-1"}],"updated_at":"2026-05-18T01:54:31.752756Z"}}],"meta":{"page":{"type":"number_size","number":0,"size":25,"total":65614,"first_number":0,"prev_number":null,"next_number":1,"last_number":2624}},"links":{"self":"https://api.datad0g.com/api/v2/model-lab-api/runs","first":"https://api.datad0g.com/api/v2/model-lab-api/runs?page[number]=0&page[size]=25","last":"https://api.datad0g.com/api/v2/model-lab-api/runs?page[number]=2624&page[size]=25","next":"https://api.datad0g.com/api/v2/model-lab-api/runs?page[number]=1&page[size]=25"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.yaml new file mode 100644 index 00000000000..4156348a728 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_No_Content_response.yaml @@ -0,0 +1,32 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158/pin + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158/pin + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..5c3a17fff37 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Pin_a_Model_Lab_run_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/999999/pin + response: + body: '{"errors":[{"title":"Generic Error","detail":"run not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.yaml new file mode 100644 index 00000000000..08cbf368e66 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_No_Content_response.yaml @@ -0,0 +1,32 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/2387/star + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/2387/star + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..37746759c71 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Star_a_Model_Lab_project_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/999999/star + response: + body: '{"errors":[{"title":"Generic Error","detail":"project not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.yaml new file mode 100644 index 00000000000..e116a5135d9 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unpin_a_Model_Lab_run_returns_No_Content_response.yaml @@ -0,0 +1,17 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/runs/70158/pin + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.freeze new file mode 100644 index 00000000000..144cd0a4428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:45:00.000Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.yaml new file mode 100644 index 00000000000..eb67ea00669 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Model_Lab_API/Scenario_Unstar_a_Model_Lab_project_returns_No_Content_response.yaml @@ -0,0 +1,17 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/model-lab-api/projects/2387/star + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.freeze new file mode 100644 index 00000000000..116f5fcaa86 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:51:43.688Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.yaml new file mode 100644 index 00000000000..052b8b4e188 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_HTTP_server_source_valid_tokens_returns_OK_response.yaml @@ -0,0 +1,24 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["http-server-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"auth_strategy":"none","decoding":"json","id":"http-server-source","type":"http_server","valid_tokens":[{"enabled":true,"field_to_add":{"key":"token_name","value":"primary_token"},"path_to_token":{"header":"X-Token"},"token_key":"HTTP_SERVER_TOKEN"},{"enabled":true,"path_to_token":"path","token_key":"HTTP_SERVER_TOKEN_BACKUP"}]}]},"name":"Pipeline with HTTP server valid_tokens"},"type":"pipelines"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: '{"errors":[]} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.freeze new file mode 100644 index 00000000000..26ce0f6dea7 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-18T16:51:43.307Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.yaml new file mode 100644 index 00000000000..270741654f8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_Splunk_HEC_source_valid_tokens_returns_OK_response.yaml @@ -0,0 +1,24 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["splunk-hec-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"splunk-hec-source","type":"splunk_hec","valid_tokens":[{"enabled":true,"field_to_add":{"key":"token_name","value":"primary_token"},"token_key":"SPLUNK_HEC_TOKEN"},{"enabled":false,"token_key":"SPLUNK_HEC_TOKEN_BACKUP"}]}]},"name":"Pipeline with Splunk HEC valid_tokens"},"type":"pipelines"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: '{"errors":[]} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.freeze new file mode 100644 index 00000000000..48640770eca --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-21T09:58:44.439Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.yaml new file mode 100644 index 00000000000..e40f31e7a46 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Observability_Pipelines/Scenario_Validate_an_observability_pipeline_with_cloud_prem_destination_buffer_returns_OK_response.yaml @@ -0,0 +1,24 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"config":{"destinations":[{"buffer":{"max_size":1073741824,"type":"disk","when_full":"block"},"id":"cloud-prem-destination","inputs":["my-processor-group"],"type":"cloud_prem"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline with CloudPrem Buffer"},"type":"pipelines"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: '{"errors":[]} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze index 7a29240030e..9eedde19e4d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-27T14:11:49.966Z \ No newline at end of file +2026-05-15T14:39:18.459Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml index 2772f0617fa..e636d31a076 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_On-Call/Scenario_Set_On-Call_team_routing_rules_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","attributes":{"name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","created_at":"2025-11-27T14:11:50.355271+00:00","modified_at":"2025-11-27T14:11:50.355271+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1764252709@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ad92f892fdf302962d879c0d02664d8e?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"af4cfd73-8162-49c3-899a-101d0617d500","attributes":{"uuid":"af4cfd73-8162-49c3-899a-101d0617d500","name":null,"handle":"test-set_on_call_team_routing_rules_returns_ok_response-1778855958@datadoghq.com","created_at":"2026-05-15T14:39:20.154059+00:00","modified_at":"2026-05-15T14:39:20.154059+00:00","email":"test-set_on_call_team_routing_rules_returns_ok_response-1778855958@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c530c1e2f9d5cddf9d34bed00a5e760b?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"handle":"test-handle-a7692378c203a880","name":"test-name-a7692378c203a880"},"type":"team"}} + {"data":{"attributes":{"handle":"test-handle-fc62c73422bed141","name":"test-name-fc62c73422bed141"},"type":"team"}} form: {} headers: Accept: @@ -35,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/team response: - body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team","attributes":{"avatar":null,"banner":14,"created_at":"2025-11-27T14:11:50.842947+00:00","description":null,"handle":"test-handle-a7692378c203a880","hidden_modules":[],"link_count":0,"modified_at":"2025-11-27T14:11:50.842947+00:00","name":"test-name-a7692378c203a880","summary":null,"user_count":0,"visible_modules":[]},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8/permission-settings"}}}}}' + body: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2026-05-15T14:39:20.573129+00:00","description":null,"handle":"test-handle-fc62c73422bed141","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-05-15T14:39:20.573129+00:00","name":"test-name-fc62c73422bed141","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1/permission-settings"}}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"layers":[{"effective_date":"2025-11-17T14:11:49.966Z","end_date":"2025-12-07T14:11:49.966Z","interval":{"days":1},"members":[{"user":{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-11-22T14:11:49.966Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} + {"data":{"attributes":{"layers":[{"effective_date":"2026-05-05T14:39:18.459Z","end_date":"2026-05-25T14:39:18.459Z","interval":{"days":1},"members":[{"user":{"id":"af4cfd73-8162-49c3-899a-101d0617d500"}}],"name":"Layer 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2026-05-10T14:39:18.459Z"}],"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}} form: {} headers: Accept: @@ -55,7 +55,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/schedules response: - body: '{"data":{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"0eecb6fe-83c6-48c9-9e0e-82379498f733","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + body: '{"data":{"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"d2139431-973b-42cc-a932-941aeff81783","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -64,7 +64,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"},{"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"1f9b0595-17a3-4d95-9b2e-edcea3b6e737","type":"schedules"},{"id":"0473ca92-cb9b-11f0-85f9-9a82ffe01443","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}},"type":"policies"}} + {"data":{"attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"},{"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules"},{"config":{"schedule":{"position":"previous"}},"id":"6417bbaa-a75e-474d-a45a-9af8e1a3907a","type":"schedules"},{"id":"af4cfd73-8162-49c3-899a-101d0617d500","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}},"type":"policies"}} form: {} headers: Accept: @@ -75,7 +75,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/on-call/escalation-policies response: - body: '{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1764252709","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"533f661e-6a1f-4327-8d3f-035add94cff8","type":"steps"},{"id":"b8948730-6aec-4a51-8662-cce4026b94dc","type":"steps"}]},"teams":{"data":[{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"teams"}]}}}}' + body: '{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies","attributes":{"name":"Test-Set_On_Call_team_routing_rules_returns_OK_response-1778855958","resolve_page_on_policy_end":true,"retries":2,"tags":[]},"relationships":{"steps":{"data":[{"id":"cd41c9ed-3d97-469c-aa8a-9a36c0f45a82","type":"steps"},{"id":"102b0afe-da23-48ca-be15-699891fcbff7","type":"steps"}]},"teams":{"data":[{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"teams"}]}}}}' code: 201 duration: 0ms headers: @@ -84,7 +84,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rules":[{"actions":[{"channel":"channel","type":"send_slack_message","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"restrictions":[{"end_day":"monday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"},{"end_day":"tuesday","end_time":"17:00:00","start_day":"tuesday","start_time":"09:00:00"}],"time_zone":"Europe/Paris"}},{"policy_id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","query":"","urgency":"low"}]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[{"actions":[{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"escalation_policy","urgency":"low"}],"query":"tags.service:time_restrictions","time_restriction":{"restrictions":[{"end_day":"monday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"},{"end_day":"tuesday","end_time":"17:00:00","start_day":"tuesday","start_time":"09:00:00"}],"time_zone":"Europe/Paris"}},{"actions":[{"ack_timeout_minutes":30,"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","support_hours":{"restrictions":[{"end_day":"wednesday","end_time":"17:00:00","start_day":"wednesday","start_time":"09:00:00"},{"end_day":"thursday","end_time":"17:00:00","start_day":"thursday","start_time":"09:00:00"}],"time_zone":"Europe/Paris"},"type":"escalation_policy","urgency":"low"}],"query":"tags.service:support_hours_and_acknowledgment_timeout"},{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","query":"tags.service:legacy_policy_definition","urgency":"low"},{"actions":[{"policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"escalation_policy","urgency":"low"}],"query":""}]},"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules"}} form: {} headers: Accept: @@ -93,9 +93,9 @@ interactions: - application/json id: 4 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules?include=rules + url: https://api.datadoghq.com/api/v2/on-call/teams/5f48616e-52b1-4126-a255-0bd9f4820dc1/routing-rules?include=rules response: - body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules"},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules"}]}}},"included":[{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-0","type":"team_routing_rules","attributes":{"actions":[{"type":"send_slack_message","channel":"channel","workspace":"workspace"}],"query":"tags.service:test","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]}},"relationships":{"policy":{"data":null}}},{"id":"virtual-ba4fe917-0da4-4b40-96da-f9d7306d97d8-rule-1","type":"team_routing_rules","attributes":{"actions":[],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"66f0e922-2834-4d68-aa0b-98cc81fc2a9d","type":"policies"}}}}]}' + body: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules","relationships":{"rules":{"data":[{"id":"d4a7d064-0b02-4510-9412-24c95fdbef89","type":"team_routing_rules"},{"id":"a1a5fdd6-dd2b-4571-a86c-909a89a21490","type":"team_routing_rules"},{"id":"fdbe9494-e88c-4927-bb7e-407c0df33258","type":"team_routing_rules"},{"id":"8e059ecb-b492-4db6-accd-6eb69b4099b1","type":"team_routing_rules"}]}}},"included":[{"id":"d4a7d064-0b02-4510-9412-24c95fdbef89","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"tags.service:time_restrictions","time_restriction":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"monday","end_time":"17:00:00","end_day":"monday"},{"start_time":"09:00:00","start_day":"tuesday","end_time":"17:00:00","end_day":"tuesday"}]},"urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"a1a5fdd6-dd2b-4571-a86c-909a89a21490","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","support_hours":{"time_zone":"Europe/Paris","restrictions":[{"start_time":"09:00:00","start_day":"wednesday","end_time":"17:00:00","end_day":"wednesday"},{"start_time":"09:00:00","start_day":"thursday","end_time":"17:00:00","end_day":"thursday"}]},"ack_timeout_minutes":30,"urgency":"low"}],"query":"tags.service:support_hours_and_acknowledgment_timeout","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"fdbe9494-e88c-4927-bb7e-407c0df33258","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"tags.service:legacy_policy_definition","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}},{"id":"8e059ecb-b492-4db6-accd-6eb69b4099b1","type":"team_routing_rules","attributes":{"actions":[{"type":"escalation_policy","policy_id":"3321cfa1-8420-4655-ac38-f51ea522834e","urgency":"low"}],"query":"","urgency":"low"},"relationships":{"policy":{"data":{"id":"3321cfa1-8420-4655-ac38-f51ea522834e","type":"policies"}}}}]}' code: 200 duration: 0ms headers: @@ -104,7 +104,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"rules":[]},"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules"}} + {"data":{"attributes":{"rules":[]},"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules"}} form: {} headers: Accept: @@ -113,9 +113,9 @@ interactions: - application/json id: 5 method: PUT - url: https://api.datadoghq.com/api/v2/on-call/teams/ba4fe917-0da4-4b40-96da-f9d7306d97d8/routing-rules + url: https://api.datadoghq.com/api/v2/on-call/teams/5f48616e-52b1-4126-a255-0bd9f4820dc1/routing-rules response: - body: '{"data":{"id":"ba4fe917-0da4-4b40-96da-f9d7306d97d8","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' + body: '{"data":{"id":"5f48616e-52b1-4126-a255-0bd9f4820dc1","type":"team_routing_rules","relationships":{"rules":{"data":[]}}}}' code: 200 duration: 0ms headers: @@ -130,7 +130,7 @@ interactions: - '*/*' id: 6 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/66f0e922-2834-4d68-aa0b-98cc81fc2a9d + url: https://api.datadoghq.com/api/v2/on-call/escalation-policies/3321cfa1-8420-4655-ac38-f51ea522834e response: body: '' code: 204 @@ -145,7 +145,7 @@ interactions: - '*/*' id: 7 method: DELETE - url: https://api.datadoghq.com/api/v2/on-call/schedules/1f9b0595-17a3-4d95-9b2e-edcea3b6e737 + url: https://api.datadoghq.com/api/v2/on-call/schedules/6417bbaa-a75e-474d-a45a-9af8e1a3907a response: body: '' code: 204 @@ -160,7 +160,7 @@ interactions: - '*/*' id: 8 method: DELETE - url: https://api.datadoghq.com/api/v2/team/ba4fe917-0da4-4b40-96da-f9d7306d97d8 + url: https://api.datadoghq.com/api/v2/team/5f48616e-52b1-4126-a255-0bd9f4820dc1 response: body: '' code: 204 @@ -175,7 +175,7 @@ interactions: - '*/*' id: 9 method: DELETE - url: https://api.datadoghq.com/api/v2/users/0473ca92-cb9b-11f0-85f9-9a82ffe01443 + url: https://api.datadoghq.com/api/v2/users/af4cfd73-8162-49c3-899a-101d0617d500 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.freeze new file mode 100644 index 00000000000..55a8fd17a92 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-05-20T15:12:27.397Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.yaml new file mode 100644 index 00000000000..1f39a6dae59 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: | + {"cases":[{"name":"","notifications":[],"status":"info"}],"filters":[],"hasExtendedTitle":true,"isEnabled":true,"message":"test","name":"Test-Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_res-1779289947","options":{"detectionMethod":"impossible_travel","evaluationWindow":900,"impossibleTravelOptions":{"baselineUserLocations":true,"baselineUserLocationsDuration":7},"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"geo_data","distinctFields":[],"groupByFields":["@usr.id"],"metric":"@network.client.geoip","query":"*"}],"tags":[],"type":"log_detection"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security_monitoring/rules + response: + body: '{"name":"Test-Create_a_detection_rule_with_type_impossible_travel_and_baselineUserLocationsDuration_returns_OK_res-1779289947","createdAt":1779289949181,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"*","groupByFields":["@usr.id"],"hasOptionalGroupByFields":false,"distinctFields":[],"metric":"@network.client.geoip","metrics":["@network.client.geoip"],"aggregation":"geo_data","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"impossible_travel","maxSignalDuration":86400,"keepAlive":3600,"impossibleTravelOptions":{"baselineUserLocations":true,"baselineUserLocationsDuration":7,"detectIpTransition":false}},"cases":[{"name":"","status":"info","notifications":[]}],"message":"test","tags":[],"hasExtendedTitle":true,"type":"log_detection","filters":[],"version":1,"id":"v2k-viu-svz","blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":2320499,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"","name":""}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/security_monitoring/rules/v2k-viu-svz + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/features/v1/logs_pipelines.feature b/tests/scenarios/features/v1/logs_pipelines.feature index 00b7369e231..1ab4401b0fd 100644 --- a/tests/scenarios/features/v1/logs_pipelines.feature +++ b/tests/scenarios/features/v1/logs_pipelines.feature @@ -21,138 +21,138 @@ Feature: Logs Pipelines And a valid "appKeyAuth" key in the system And an instance of "LogsPipelines" API - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Create a pipeline returns "Bad Request" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Create a pipeline returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Append Operation returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayAppend", "processors": [{"type": "array-processor", "is_enabled": true, "name": "append_ip_to_array", "operation": {"type": "append", "source": "network.client.ip", "target": "sourceIps"}}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Append Operation with preserve_source false returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayAppendNoPreserve", "processors": [{"type": "array-processor", "is_enabled": true, "name": "append_ip_and_remove_source", "operation": {"type": "append", "source": "network.client.ip", "target": "sourceIps", "preserve_source": false}}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Append Operation with preserve_source true returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayAppendPreserve", "processors": [{"type": "array-processor", "is_enabled": true, "name": "append_ip_and_keep_source", "operation": {"type": "append", "source": "network.client.ip", "target": "sourceIps", "preserve_source": true}}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Length Operation returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayLength", "processors": [{"type": "array-processor", "is_enabled": true, "name": "count_tags", "operation": {"type": "length", "source": "tags", "target": "tagCount"}}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Select Operation returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArraySelect", "processors": [{"type": "array-processor", "is_enabled": true, "name": "extract_referrer", "operation": {"type": "select", "source": "httpRequest.headers", "target": "referrer", "filter": "name:Referrer", "value_to_extract": "value"}}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Decoder Processor returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testDecoderProcessor", "processors": [{"type": "decoder-processor", "is_enabled": true, "name": "test_decoder", "source": "encoded.field", "target": "decoded.field", "binary_to_text_encoding": "base16", "input_representation": "utf_8"}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Schema Processor and preserve_source false returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testSchemaProcessor", "processors": [{"type": "schema-processor", "is_enabled": true, "name": "Apply OCSF schema for 3001", "schema": {"schema_type": "ocsf", "version": "1.5.0", "class_uid": 3001, "class_name": "Account Change", "profiles": ["cloud", "datetime"]}, "mappers": [{"type": "schema-category-mapper", "name": "activity_id and activity_name", "categories": [{"filter": {"query": "@eventName:(*Create*)"}, "name": "Create", "id": 1}, {"filter": {"query": "@eventName:(ChangePassword OR PasswordUpdated)"}, "name": "Password Change", "id": 3}, {"filter": {"query": "@eventName:(*Attach*)"}, "name": "Attach Policy", "id": 7}, {"filter": {"query": "@eventName:(*Detach* OR *Remove*)"}, "name": "Detach Policy", "id": 8}, {"filter": {"query": "@eventName:(*Delete*)"}, "name": "Delete", "id": 6}, {"filter": {"query": "@eventName:*"}, "name": "Other", "id": 99}], "targets": {"name": "ocsf.activity_name", "id": "ocsf.activity_id"}, "fallback": {"values": {"ocsf.activity_id": "99", "ocsf.activity_name": "Other"}, "sources": {"ocsf.activity_name": ["eventName"]}}}, {"type": "schema-category-mapper", "name": "status", "categories": [{"filter": {"query": "-@errorCode:*"}, "id": 1, "name": "Success"}, {"filter": {"query": "@errorCode:*"}, "id": 2, "name": "Failure"}], "targets": {"id": "ocsf.status_id", "name": "ocsf.status"}}, {"type": "schema-category-mapper", "name": "Set default severity", "categories": [{"filter": {"query": "@eventName:*"}, "name": "Informational", "id": 1}], "targets": {"name": "ocsf.severity", "id": "ocsf.severity_id"}}, {"type": "schema-remapper", "name": "Map userIdentity to ocsf.user.uid", "sources": ["userIdentity.principalId", "responseElements.role.roleId", "responseElements.user.userId"], "target": "ocsf.user.uid", "preserve_source": false}, {"type": "schema-remapper", "name": "Map userName to ocsf.user.name", "sources": ["requestParameters.userName", "responseElements.role.roleName", "requestParameters.roleName", "responseElements.user.userName"], "target": "ocsf.user.name", "preserve_source": false}, {"type": "schema-remapper", "name": "Map api to ocsf.api", "sources": ["api"], "target": "ocsf.api", "preserve_source": false}, {"type": "schema-remapper", "name": "Map user to ocsf.user", "sources": ["user"], "target": "ocsf.user", "preserve_source": false}, {"type": "schema-remapper", "name": "Map actor to ocsf.actor", "sources": ["actor"], "target": "ocsf.actor", "preserve_source": false}, {"type": "schema-remapper", "name": "Map cloud to ocsf.cloud", "sources": ["cloud"], "target": "ocsf.cloud", "preserve_source": false}, {"type": "schema-remapper", "name": "Map http_request to ocsf.http_request", "sources": ["http_request"], "target": "ocsf.http_request", "preserve_source": false}, {"type": "schema-remapper", "name": "Map metadata to ocsf.metadata", "sources": ["metadata"], "target": "ocsf.metadata", "preserve_source": false}, {"type": "schema-remapper", "name": "Map time to ocsf.time", "sources": ["time"], "target": "ocsf.time", "preserve_source": false}, {"type": "schema-remapper", "name": "Map src_endpoint to ocsf.src_endpoint", "sources": ["src_endpoint"], "target": "ocsf.src_endpoint", "preserve_source": false}, {"type": "schema-remapper", "name": "Map severity to ocsf.severity", "sources": ["severity"], "target": "ocsf.severity", "preserve_source": false}, {"type": "schema-remapper", "name": "Map severity_id to ocsf.severity_id", "sources": ["severity_id"], "target": "ocsf.severity_id", "preserve_source": false}]}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Schema Processor and preserve_source true returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testSchemaProcessor", "processors": [{"type": "schema-processor", "is_enabled": true, "name": "Apply OCSF schema for 3001", "schema": {"schema_type": "ocsf", "version": "1.5.0", "class_uid": 3001, "class_name": "Account Change", "profiles": ["cloud", "datetime"]}, "mappers": [{"type": "schema-category-mapper", "name": "activity_id and activity_name", "categories": [{"filter": {"query": "@eventName:(*Create*)"}, "name": "Create", "id": 1}, {"filter": {"query": "@eventName:(ChangePassword OR PasswordUpdated)"}, "name": "Password Change", "id": 3}, {"filter": {"query": "@eventName:(*Attach*)"}, "name": "Attach Policy", "id": 7}, {"filter": {"query": "@eventName:(*Detach* OR *Remove*)"}, "name": "Detach Policy", "id": 8}, {"filter": {"query": "@eventName:(*Delete*)"}, "name": "Delete", "id": 6}, {"filter": {"query": "@eventName:*"}, "name": "Other", "id": 99}], "targets": {"name": "ocsf.activity_name", "id": "ocsf.activity_id"}, "fallback": {"values": {"ocsf.activity_id": "99", "ocsf.activity_name": "Other"}, "sources": {"ocsf.activity_name": ["eventName"]}}}, {"type": "schema-category-mapper", "name": "status", "categories": [{"filter": {"query": "-@errorCode:*"}, "id": 1, "name": "Success"}, {"filter": {"query": "@errorCode:*"}, "id": 2, "name": "Failure"}], "targets": {"id": "ocsf.status_id", "name": "ocsf.status"}}, {"type": "schema-category-mapper", "name": "Set default severity", "categories": [{"filter": {"query": "@eventName:*"}, "name": "Informational", "id": 1}], "targets": {"name": "ocsf.severity", "id": "ocsf.severity_id"}}, {"type": "schema-remapper", "name": "Map userIdentity to ocsf.user.uid", "sources": ["userIdentity.principalId", "responseElements.role.roleId", "responseElements.user.userId"], "target": "ocsf.user.uid", "preserve_source": true}, {"type": "schema-remapper", "name": "Map userName to ocsf.user.name", "sources": ["requestParameters.userName", "responseElements.role.roleName", "requestParameters.roleName", "responseElements.user.userName"], "target": "ocsf.user.name", "preserve_source": true}, {"type": "schema-remapper", "name": "Map api to ocsf.api", "sources": ["api"], "target": "ocsf.api", "preserve_source": true}, {"type": "schema-remapper", "name": "Map user to ocsf.user", "sources": ["user"], "target": "ocsf.user", "preserve_source": true}, {"type": "schema-remapper", "name": "Map actor to ocsf.actor", "sources": ["actor"], "target": "ocsf.actor", "preserve_source": true}, {"type": "schema-remapper", "name": "Map cloud to ocsf.cloud", "sources": ["cloud"], "target": "ocsf.cloud", "preserve_source": true}, {"type": "schema-remapper", "name": "Map http_request to ocsf.http_request", "sources": ["http_request"], "target": "ocsf.http_request", "preserve_source": true}, {"type": "schema-remapper", "name": "Map metadata to ocsf.metadata", "sources": ["metadata"], "target": "ocsf.metadata", "preserve_source": true}, {"type": "schema-remapper", "name": "Map time to ocsf.time", "sources": ["time"], "target": "ocsf.time", "preserve_source": true}, {"type": "schema-remapper", "name": "Map src_endpoint to ocsf.src_endpoint", "sources": ["src_endpoint"], "target": "ocsf.src_endpoint", "preserve_source": true}, {"type": "schema-remapper", "name": "Map severity to ocsf.severity", "sources": ["severity"], "target": "ocsf.severity", "preserve_source": true}, {"type": "schema-remapper", "name": "Map severity_id to ocsf.severity_id", "sources": ["severity_id"], "target": "ocsf.severity_id", "preserve_source": true}]}], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Span Id Remapper returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipeline", "processors": [{"type": "span-id-remapper", "is_enabled" : true, "name" : "test_filter", "sources" : [ "dd.span_id"] }], "tags": []} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with nested pipeline processor returns "OK" response Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testPipelineWithNested", "processors": [{"type": "pipeline", "is_enabled": true, "name": "nested_pipeline_with_metadata", "filter": {"query": "env:production"}, "tags": ["env:prod", "type:nested"], "description": "This is a nested pipeline for production logs"}], "tags": ["team:test"], "description": "Pipeline containing nested processor with tags and description"} When the request is sent Then the response status is 200 OK - @team:DataDog/event-platform-experience + @team:DataDog/logs-onboarding Scenario: Create a pipeline with schema processor Given new "CreateLogsPipeline" request And body with value {"filter": {"query": "source:python"}, "name": "testSchemaProcessor", "processors": [{"type": "schema-processor", "is_enabled": true, "name": "Apply OCSF schema for 3001", "schema": {"schema_type": "ocsf", "version": "1.5.0", "class_uid": 3001, "class_name": "Account Change", "profiles": ["cloud", "datetime"]}, "mappers": [{"type": "schema-category-mapper", "name": "activity_id and activity_name", "categories": [{"filter": {"query": "@eventName:(*Create*)"}, "name": "Create", "id": 1}, {"filter": {"query": "@eventName:(ChangePassword OR PasswordUpdated)"}, "name": "Password Change", "id": 3}, {"filter": {"query": "@eventName:(*Attach*)"}, "name": "Attach Policy", "id": 7}, {"filter": {"query": "@eventName:(*Detach* OR *Remove*)"}, "name": "Detach Policy", "id": 8}, {"filter": {"query": "@eventName:(*Delete*)"}, "name": "Delete", "id": 6}, {"filter": {"query": "@eventName:*"}, "name": "Other", "id": 99}], "targets": {"name": "ocsf.activity_name", "id": "ocsf.activity_id"}, "fallback": {"values": {"ocsf.activity_id": "99", "ocsf.activity_name": "Other"}, "sources": {"ocsf.activity_name": ["eventName"]}}}, {"type": "schema-category-mapper", "name": "status", "categories": [{"filter": {"query": "-@errorCode:*"}, "id": 1, "name": "Success"}, {"filter": {"query": "@errorCode:*"}, "id": 2, "name": "Failure"}], "targets": {"id": "ocsf.status_id", "name": "ocsf.status"}}, {"type": "schema-category-mapper", "name": "Set default severity", "categories": [{"filter": {"query": "@eventName:*"}, "name": "Informational", "id": 1}], "targets": {"name": "ocsf.severity", "id": "ocsf.severity_id"}}, {"type": "schema-remapper", "name": "Map userIdentity to ocsf.user.uid", "sources": ["userIdentity.principalId", "responseElements.role.roleId", "responseElements.user.userId"], "target": "ocsf.user.uid"}, {"type": "schema-remapper", "name": "Map userName to ocsf.user.name", "sources": ["requestParameters.userName", "responseElements.role.roleName", "requestParameters.roleName", "responseElements.user.userName"], "target": "ocsf.user.name"}, {"type": "schema-remapper", "name": "Map api to ocsf.api", "sources": ["api"], "target": "ocsf.api"}, {"type": "schema-remapper", "name": "Map user to ocsf.user", "sources": ["user"], "target": "ocsf.user"}, {"type": "schema-remapper", "name": "Map actor to ocsf.actor", "sources": ["actor"], "target": "ocsf.actor"}, {"type": "schema-remapper", "name": "Map cloud to ocsf.cloud", "sources": ["cloud"], "target": "ocsf.cloud"}, {"type": "schema-remapper", "name": "Map http_request to ocsf.http_request", "sources": ["http_request"], "target": "ocsf.http_request"}, {"type": "schema-remapper", "name": "Map metadata to ocsf.metadata", "sources": ["metadata"], "target": "ocsf.metadata"}, {"type": "schema-remapper", "name": "Map time to ocsf.time", "sources": ["time"], "target": "ocsf.time"}, {"type": "schema-remapper", "name": "Map src_endpoint to ocsf.src_endpoint", "sources": ["src_endpoint"], "target": "ocsf.src_endpoint"}, {"type": "schema-remapper", "name": "Map severity to ocsf.severity", "sources": ["severity"], "target": "ocsf.severity"}, {"type": "schema-remapper", "name": "Map severity_id to ocsf.severity_id", "sources": ["severity_id"], "target": "ocsf.severity_id"}]}], "tags": []} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Delete a pipeline returns "Bad Request" response Given new "DeleteLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Delete a pipeline returns "OK" response Given new "DeleteLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Get a pipeline returns "Bad Request" response Given new "GetLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Get a pipeline returns "OK" response Given new "GetLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Get all pipelines returns "OK" response Given new "ListLogsPipelines" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Get pipeline order returns "OK" response Given new "GetLogsPipelineOrder" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Update a pipeline returns "Bad Request" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" @@ -160,7 +160,7 @@ Feature: Logs Pipelines When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Update a pipeline returns "OK" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" @@ -168,21 +168,21 @@ Feature: Logs Pipelines When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Update pipeline order returns "Bad Request" response Given new "UpdateLogsPipelineOrder" request And body with value {"pipeline_ids": ["tags", "org_ids", "products"]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Update pipeline order returns "OK" response Given new "UpdateLogsPipelineOrder" request And body with value {"pipeline_ids": ["tags", "org_ids", "products"]} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/event-platform-experience + @generated @skip @team:DataDog/logs-onboarding Scenario: Update pipeline order returns "Unprocessable Entity" response Given new "UpdateLogsPipelineOrder" request And body with value {"pipeline_ids": ["tags", "org_ids", "products"]} diff --git a/tests/scenarios/features/v1/monitors.feature b/tests/scenarios/features/v1/monitors.feature index 63bb9f16b9a..73ed30421fb 100644 --- a/tests/scenarios/features/v1/monitors.feature +++ b/tests/scenarios/features/v1/monitors.feature @@ -42,6 +42,15 @@ Feature: Monitors When the request is sent Then the response status is 200 OK + @team:DataDog/monitor-app + Scenario: Create a Data Jobs monitor returns "OK" response + Given new "CreateMonitor" request + And body with value {"name": "{{ unique }}", "type": "data-jobs alert", "query": "formula(\"failed_runs(run_query)\").by(job_name,workspace_name).last(10d) > 0", "message": "Data jobs alert triggered", "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], "options": {"thresholds": {"critical": 0}, "variables": [{"name": "run_query", "jobs_query": "job_name:*", "job_type": "databricks.job", "query_dialect": "metric"}]}} + When the request is sent + Then the response status is 200 OK + And the response "name" is equal to "{{ unique }}" + And the response "type" is equal to "data-jobs alert" + @team:DataDog/monitor-app Scenario: Create a Data Quality monitor returns "OK" response Given new "CreateMonitor" request @@ -210,7 +219,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} + And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} When the request is sent Then the response status is 400 Bad Request diff --git a/tests/scenarios/features/v1/synthetics.feature b/tests/scenarios/features/v1/synthetics.feature index 38aef49ed16..052377a39d8 100644 --- a/tests/scenarios/features/v1/synthetics.feature +++ b/tests/scenarios/features/v1/synthetics.feature @@ -54,7 +54,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Create a browser test returns "- JSON format is wrong" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "mcpProtocolVersion": "2025-06-18", "proxy": {"url": "https://example.com"}, "service": "Greeter", "toolName": "search", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -84,7 +84,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Create a browser test returns "Test quota is reached" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "mcpProtocolVersion": "2025-06-18", "proxy": {"url": "https://example.com"}, "service": "Greeter", "toolName": "search", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 402 Test quota is reached @@ -268,6 +268,22 @@ Feature: Synthetics When the request is sent Then the response status is 402 Test quota is reached + @team:DataDog/synthetics-orchestrating-managing + Scenario: Create an API test with MCP steps returns "OK - Returns the created test details." response + Given new "CreateSyntheticsAPITest" request + And body from file "synthetics_api_test_mcp_payload.json" + When the request is sent + Then the response status is 200 OK - Returns the created test details. + And the response "name" is equal to "{{ unique }}" + And the response "config.steps[0].subtype" is equal to "mcp" + And the response "config.steps[0].request.callType" is equal to "init" + And the response "config.steps[0].request.mcpProtocolVersion" is equal to "2025-06-18" + And the response "config.steps[1].subtype" is equal to "mcp" + And the response "config.steps[1].request.callType" is equal to "tool_list" + And the response "config.steps[2].subtype" is equal to "mcp" + And the response "config.steps[2].request.callType" is equal to "tool_call" + And the response "config.steps[2].request.toolName" is equal to "search" + @team:DataDog/synthetics-orchestrating-managing Scenario: Create an API test with UDP subtype returns "OK - Returns the created test details." response Given new "CreateSyntheticsAPITest" request @@ -410,7 +426,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- JSON format is wrong" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "mcpProtocolVersion": "2025-06-18", "proxy": {"url": "https://example.com"}, "service": "Greeter", "toolName": "search", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -418,7 +434,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "mcpProtocolVersion": "2025-06-18", "proxy": {"url": "https://example.com"}, "service": "Greeter", "toolName": "search", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -426,7 +442,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "OK" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "mcpProtocolVersion": "2025-06-18", "proxy": {"url": "https://example.com"}, "service": "Greeter", "toolName": "search", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"blockedRequestPatterns": [], "ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 200 OK diff --git a/tests/scenarios/features/v1/synthetics_api_test_mcp_payload.json b/tests/scenarios/features/v1/synthetics_api_test_mcp_payload.json new file mode 100644 index 00000000000..dc94a0f5489 --- /dev/null +++ b/tests/scenarios/features/v1/synthetics_api_test_mcp_payload.json @@ -0,0 +1,139 @@ +{ + "config": { + "steps": [ + { + "name": "Initialize MCP session", + "subtype": "mcp", + "allowFailure": false, + "isCritical": true, + "retry": { + "count": 0, + "interval": 300 + }, + "assertions": [ + { + "operator": "is", + "type": "statusCode", + "target": 200 + }, + { + "type": "mcpRespectsSpecification" + }, + { + "operator": "contains", + "type": "mcpServerCapabilities", + "target": ["tools"] + } + ], + "request": { + "url": "https://example.org/mcp", + "callType": "init", + "mcpProtocolVersion": "2025-06-18", + "headers": { + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "" + } + } + }, + { + "name": "List MCP tools", + "subtype": "mcp", + "allowFailure": false, + "isCritical": true, + "retry": { + "count": 0, + "interval": 300 + }, + "assertions": [ + { + "operator": "is", + "type": "statusCode", + "target": 200 + }, + { + "operator": "moreThan", + "type": "mcpToolCount", + "target": 0 + }, + { + "operator": "lessThan", + "type": "mcpToolNameLength", + "target": 64 + }, + { + "type": "mcpRespectsSpecification" + } + ], + "request": { + "url": "https://example.org/mcp", + "callType": "tool_list", + "mcpProtocolVersion": "2025-06-18", + "headers": { + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "" + } + } + }, + { + "name": "Call MCP search tool", + "subtype": "mcp", + "allowFailure": false, + "isCritical": true, + "retry": { + "count": 0, + "interval": 300 + }, + "assertions": [ + { + "operator": "is", + "type": "statusCode", + "target": 200 + }, + { + "operator": "lessThan", + "type": "responseTime", + "target": 5000 + }, + { + "type": "mcpRespectsSpecification" + } + ], + "request": { + "url": "https://example.org/mcp", + "callType": "tool_call", + "mcpProtocolVersion": "2025-06-18", + "toolName": "search", + "toolArgs": { + "limit": 5, + "query": "datadog synthetics" + }, + "headers": { + "DD-API-KEY": "", + "DD-APPLICATION-KEY": "" + } + } + } + ] + }, + "locations": [ + "aws:us-east-2" + ], + "message": "BDD test payload: synthetics_api_test_mcp_payload.json", + "name": "{{ unique }}", + "options": { + "min_failure_duration": 10, + "min_location_failed": 1, + "monitor_name": "{{ unique }}", + "monitor_priority": 5, + "retry": { + "count": 3, + "interval": 1000 + }, + "tick_every": 900 + }, + "subtype": "multi", + "tags": [ + "testing:api" + ], + "type": "api" +} diff --git a/tests/scenarios/features/v2/app_builder.feature b/tests/scenarios/features/v2/app_builder.feature index 1ef2502e807..782c77895fb 100644 --- a/tests/scenarios/features/v2/app_builder.feature +++ b/tests/scenarios/features/v2/app_builder.feature @@ -27,6 +27,30 @@ Feature: App Builder Then the response status is 201 Created And the response "data.type" is equal to "appDefinitions" + @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Bad Request" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter with value "bad-app-id" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Created" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 201 Created + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Not Found" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Delete App returns "Bad Request" response Given new "DeleteApp" request @@ -89,7 +113,7 @@ Feature: App Builder When the request is sent Then the response status is 400 Bad Request - @skip-typescript @team:DataDog/app-builder-backend + @skip @team:DataDog/app-builder-backend Scenario: Get App returns "Gone" response Given new "GetApp" request And there is a valid "app" in the system @@ -115,6 +139,56 @@ Feature: App Builder And the response "data.id" has the same value as "app.data.id" And the response "data.type" is equal to "appDefinitions" + @team:DataDog/app-builder-backend + Scenario: Get Blueprint returns "Not Found" response + Given new "GetBlueprint" request + And request contains "blueprint_id" parameter with value "00000000-0000-0000-0000-000000000001" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Get Blueprint returns "OK" response + Given new "GetBlueprint" request + And request contains "blueprint_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get Blueprints by Integration ID returns "OK" response + Given new "GetBlueprintsByIntegrationId" request + And request contains "integration_id" parameter with value "aws" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get Blueprints by Slugs returns "OK" response + Given new "GetBlueprintsBySlugs" request + And request contains "slugs" parameter with value "aws-service-manager" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Bad Request" response + Given new "ListAppVersions" request + And request contains "app_id" parameter with value "bad-app-id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Not Found" response + Given new "ListAppVersions" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List App Versions returns "OK" response + Given new "ListAppVersions" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend Scenario: List Apps returns "Bad Request" response Given new "ListApps" request @@ -127,6 +201,46 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @team:DataDog/app-builder-backend + Scenario: List Blueprints returns "OK" response + Given new "ListBlueprints" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: List Tags returns "OK" response + Given new "ListTags" request + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Bad Request" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter with value "bad-app-id" + And request contains "version" parameter with value "latest" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Name App Version returns "No Content" response + Given new "UpdateAppVersionName" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And request contains "version" parameter with value "latest" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 204 No Content + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Not Found" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And request contains "version" parameter with value "latest" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Publish App returns "Bad Request" response Given new "PublishApp" request @@ -149,6 +263,30 @@ Feature: App Builder When the request is sent Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "Bad Request" response + Given new "RevertApp" request + And request contains "app_id" parameter with value "bad-app-id" + And request contains "version" parameter with value "1" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Revert App returns "Not Found" response + Given new "RevertApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And request contains "version" parameter with value "1" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "OK" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend Scenario: Unpublish App returns "Bad Request" response Given new "UnpublishApp" request @@ -171,6 +309,107 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "Bad Request" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter with value "bad-app-id" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "No Content" response + Given new "UpdateAppFavorite" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 204 No Content + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "Not Found" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "Bad Request" response + Given new "UpdateProtectionLevel" request + And request contains "app_id" parameter with value "bad-app-id" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "Not Found" response + Given new "UpdateProtectionLevel" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "OK" response + Given new "UpdateProtectionLevel" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "appDefinitions" + + @skip @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "Bad Request" response + Given new "UpdateAppSelfService" request + And request contains "app_id" parameter with value "bad-app-id" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "No Content" response + Given new "UpdateAppSelfService" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 204 No Content + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "Not Found" response + Given new "UpdateAppSelfService" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "Bad Request" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter with value "bad-app-id" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "No Content" response + Given new "UpdateAppTags" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 204 No Content + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "Not Found" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 404 Not Found + @skip-typescript @team:DataDog/app-builder-backend Scenario: Update App returns "Bad Request" response Given new "UpdateApp" request diff --git a/tests/scenarios/features/v2/audit.feature b/tests/scenarios/features/v2/audit.feature index b61cee6106a..20a2c45f342 100644 --- a/tests/scenarios/features/v2/audit.feature +++ b/tests/scenarios/features/v2/audit.feature @@ -7,19 +7,19 @@ Feature: Audit And a valid "appKeyAuth" key in the system And an instance of "Audit" API - @generated @skip @team:DataDog/logs-app + @generated @skip @team:DataDog/audit-trail Scenario: Get a list of Audit Logs events returns "Bad Request" response Given new "ListAuditLogs" request When the request is sent Then the response status is 400 Bad Request - @team:DataDog/logs-app + @team:DataDog/audit-trail Scenario: Get a list of Audit Logs events returns "OK" response Given new "ListAuditLogs" request When the request is sent Then the response status is 200 OK - @replay-only @skip-validation @team:DataDog/logs-app @with-pagination + @replay-only @skip-validation @team:DataDog/audit-trail @with-pagination Scenario: Get a list of Audit Logs events returns "OK" response with pagination Given new "ListAuditLogs" request And request contains "page[limit]" parameter with value 2 @@ -27,21 +27,21 @@ Feature: Audit Then the response status is 200 OK And the response has 3 items - @generated @skip @team:DataDog/logs-app + @generated @skip @team:DataDog/audit-trail Scenario: Search Audit Logs events returns "Bad Request" response Given new "SearchAuditLogs" request And body with value {"filter": {"from": "now-15m", "query": "@type:session AND @session.type:user", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/logs-app + @team:DataDog/audit-trail Scenario: Search Audit Logs events returns "OK" response Given new "SearchAuditLogs" request And body with value {"filter": {"from": "now-15m", "query": "@type:session AND @session.type:user", "to": "now"}, "options": {"time_offset": 0, "timezone": "GMT"}, "page": {"limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 200 OK - @replay-only @skip-validation @team:DataDog/logs-app @with-pagination + @replay-only @skip-validation @team:DataDog/audit-trail @with-pagination Scenario: Search Audit Logs events returns "OK" response with pagination Given new "SearchAuditLogs" request And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"} diff --git a/tests/scenarios/features/v2/case_management.feature b/tests/scenarios/features/v2/case_management.feature index bd67a8ddf2c..04f9d8e0698 100644 --- a/tests/scenarios/features/v2/case_management.feature +++ b/tests/scenarios/features/v2/case_management.feature @@ -10,6 +10,57 @@ Feature: Case Management And a valid "appKeyAuth" key in the system And an instance of "CaseManagement" API + @generated @skip @team:DataDog/case-management + Scenario: Add insights to a case returns "Bad Request" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Add insights to a case returns "Not Found" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Add insights to a case returns "OK" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "Bad Request" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "Not Found" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "OK" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Archive case returns "Bad Request" response Given new "ArchiveCase" request @@ -64,6 +115,30 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "Bad Request" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "Not Found" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "OK" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Comment case returns "Bad Request" response Given new "CommentCase" request @@ -90,6 +165,27 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "Bad Request" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "Not Found" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "OK" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Create Jira issue for case returns "Accepted" response Given operation "CreateCaseJiraIssue" enabled @@ -144,6 +240,30 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Bad Request" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Created" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Not Found" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/case-management Scenario: Create a case returns "Bad Request" response Given new "CreateCase" request @@ -170,6 +290,54 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Bad Request" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Created" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Not Found" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Bad Request" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Created" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Not Found" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Create a notification rule returns "Bad Request" response Given new "CreateProjectNotificationRule" request @@ -215,6 +383,33 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Bad Request" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Created" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Not Found" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Create investigation notebook for case returns "Bad Request" response Given operation "CreateCaseNotebook" enabled @@ -242,6 +437,78 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Delete a case link returns "Bad Request" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Delete a case link returns "No Content" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Delete a case link returns "Not Found" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Delete a case view returns "Bad Request" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Delete a case view returns "No Content" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Delete a case view returns "Not Found" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Delete a maintenance window returns "Bad Request" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Delete a maintenance window returns "No Content" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Delete a maintenance window returns "Not Found" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Delete a notification rule returns "API error response" response Given new "DeleteProjectNotificationRule" request @@ -258,6 +525,24 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Delete an automation rule returns "No Content" response + Given operation "DeleteCaseAutomationRule" enabled + And new "DeleteCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Delete an automation rule returns "Not Found" response + Given operation "DeleteCaseAutomationRule" enabled + And new "DeleteCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/case-management Scenario: Delete case comment returns "Bad Request" response Given new "DeleteCaseComment" request @@ -306,6 +591,108 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Disable an automation rule returns "Bad Request" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Disable an automation rule returns "Not Found" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Disable an automation rule returns "OK" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Enable an automation rule returns "Bad Request" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Enable an automation rule returns "Not Found" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Enable an automation rule returns "OK" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Favorite a project returns "Bad Request" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Favorite a project returns "No Content" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Favorite a project returns "Not Found" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get a case view returns "Bad Request" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get a case view returns "Not Found" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get a case view returns "OK" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Get all projects returns "Bad Request" response Given new "GetProjects" request @@ -324,6 +711,57 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Get an automation rule returns "Bad Request" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get an automation rule returns "Not Found" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get an automation rule returns "OK" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get case timeline returns "Bad Request" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get case timeline returns "Not Found" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get case timeline returns "OK" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Get notification rules returns "Bad Request" response Given new "GetProjectNotificationRules" request @@ -452,6 +890,147 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: List automation rules returns "Bad Request" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List automation rules returns "Not Found" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List automation rules returns "OK" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case links returns "Bad Request" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List case links returns "Not Found" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List case links returns "OK" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case views returns "Bad Request" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List case views returns "Not Found" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List case views returns "OK" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case watchers returns "Bad Request" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List case watchers returns "Not Found" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List case watchers returns "OK" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "Bad Request" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "Not Found" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "OK" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "Bad Request" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "Not Found" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "OK" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Remove Jira issue link from case returns "Bad Request" response Given operation "UnlinkJiraIssue" enabled @@ -490,6 +1069,33 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "Bad Request" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "Not Found" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "OK" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Search cases returns "Bad Request" response Given new "SearchCases" request @@ -569,6 +1175,111 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Unfavorite a project returns "Bad Request" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Unfavorite a project returns "No Content" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Unfavorite a project returns "Not Found" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Unwatch a case returns "Bad Request" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Unwatch a case returns "No Content" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Unwatch a case returns "Not Found" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "Bad Request" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "Not Found" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "OK" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "Bad Request" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "Not Found" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "OK" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Update a notification rule returns "Bad Request" response Given new "UpdateProjectNotificationRule" request @@ -622,6 +1333,36 @@ Feature: Case Management And the response "data" has field "id" And the response "data.attributes.name" is equal to "Updated Project Name {{ unique }}" + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "Bad Request" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "Not Found" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "OK" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Update case attributes returns "Bad Request" response Given new "UpdateAttributes" request @@ -648,6 +1389,36 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "Bad Request" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "Not Found" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "OK" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Update case custom attribute returns "Bad Request" response Given new "UpdateCaseCustomAttribute" request @@ -708,6 +1479,33 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "Bad Request" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "Not Found" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "OK" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Update case priority returns "Bad Request" response Given new "UpdatePriority" request @@ -762,6 +1560,33 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "Bad Request" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "Not Found" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "OK" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Update case status returns "Bad Request" response Given new "UpdateStatus" request @@ -814,3 +1639,30 @@ Feature: Case Management And body with value {"data": {"attributes": {"title": "[UPDATED] Memory leak investigation on API"}, "type": "case"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Bad Request" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Created" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Not Found" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found diff --git a/tests/scenarios/features/v2/case_management_attribute.feature b/tests/scenarios/features/v2/case_management_attribute.feature index 3ac06e724b7..47806e809c0 100644 --- a/tests/scenarios/features/v2/case_management_attribute.feature +++ b/tests/scenarios/features/v2/case_management_attribute.feature @@ -75,3 +75,33 @@ Feature: Case Management Attribute Given new "GetAllCustomAttributes" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "Bad Request" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "Not Found" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "OK" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/case_management_type.feature b/tests/scenarios/features/v2/case_management_type.feature index 0773d7d241b..260ac3d3c42 100644 --- a/tests/scenarios/features/v2/case_management_type.feature +++ b/tests/scenarios/features/v2/case_management_type.feature @@ -44,3 +44,30 @@ Feature: Case Management Type Given new "GetAllCaseTypes" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "Bad Request" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "Not Found" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "OK" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/cloud_cost_management.feature b/tests/scenarios/features/v2/cloud_cost_management.feature index d06acba8d82..17779e4599e 100644 --- a/tests/scenarios/features/v2/cloud_cost_management.feature +++ b/tests/scenarios/features/v2/cloud_cost_management.feature @@ -294,6 +294,182 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "Bad Request" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "OK" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "OK" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "Bad Request" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "OK" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "Bad Request" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "OK" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "Bad Request" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "OK" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "OK" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "OK" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "OK" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request @@ -344,6 +520,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get the Cloud Cost Management billing currency returns "Bad Request" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get the Cloud Cost Management billing currency returns "OK" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management AWS CUR configs returns "OK" response Given new "ListCostAWSCURConfigs" request @@ -364,12 +556,44 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management orchestrators returns "Bad Request" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management orchestrators returns "OK" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag descriptions returns "OK" response Given new "ListCostTagDescriptions" request When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag key metadata returns "Bad Request" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag key metadata returns "OK" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag keys returns "Bad Request" response Given new "ListCostTagKeys" request @@ -382,6 +606,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag sources returns "Bad Request" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag sources returns "OK" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tags returns "Bad Request" response Given new "ListCostTags" request @@ -420,6 +660,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List available Cloud Cost Management metrics returns "Bad Request" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List available Cloud Cost Management metrics returns "OK" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: List budgets returns "OK" response Given new "ListBudgets" request @@ -480,6 +736,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 Successfully reordered rulesets + @generated @skip @team:DataDog/ccm-optimize + Scenario: Search cost recommendations returns "OK" response + Given operation "SearchCostRecommendations" enabled + And new "SearchCostRecommendations" request + And body with value {"filter": "@resource_table:aws_ec2_instance", "sort": [{"expression": "potential_daily_savings.amount", "order": "DESC"}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "Not Found" response Given new "UpdateCostAWSCURConfig" request diff --git a/tests/scenarios/features/v2/compliance.feature b/tests/scenarios/features/v2/compliance.feature new file mode 100644 index 00000000000..e59eba055be --- /dev/null +++ b/tests/scenarios/features/v2/compliance.feature @@ -0,0 +1,27 @@ +@endpoint(compliance) @endpoint(compliance-v2) +Feature: Compliance + Datadog Cloud Security Misconfigurations provides aggregated views of + compliance rules and findings across your cloud resources, helping you + assess posture against industry frameworks (such as HIPAA, SOC 2, ISO + 27001) and custom frameworks. Learn more at https://docs.datadoghq.com/sec + urity/cloud_security_management/misconfigurations/#maintain-compliance- + with-industry-frameworks-and-benchmarks. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Compliance" API + And operation "GetRuleBasedView" enabled + And new "GetRuleBasedView" request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get the rule-based view of compliance findings returns "Bad Request" response + Given request contains "to" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get the rule-based view of compliance findings returns "OK" response + Given request contains "to" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/dashboards.feature b/tests/scenarios/features/v2/dashboards.feature new file mode 100644 index 00000000000..bc2c2068c94 --- /dev/null +++ b/tests/scenarios/features/v2/dashboards.feature @@ -0,0 +1,73 @@ +@endpoint(dashboards) @endpoint(dashboards-v2) +Feature: Dashboards + Get usage statistics for the dashboards in your organization, including + view counts, last-edit times, widget counts, and quality scores. See the + [Dashboards documentation](https://docs.datadoghq.com/dashboards/) for + more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Dashboards" API + + @generated @skip @team:DataDog/dashboards-backend + Scenario: Get usage stats for a dashboard returns "Bad Request" response + Given operation "GetDashboardUsage" enabled + And new "GetDashboardUsage" request + And request contains "dashboard_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/dashboards-backend + Scenario: Get usage stats for a dashboard returns "Not Found" response + Given operation "GetDashboardUsage" enabled + And new "GetDashboardUsage" request + And request contains "dashboard_id" parameter with value "xxx-xxx-xxx" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/dashboards-backend + Scenario: Get usage stats for a dashboard returns "OK" response + Given operation "GetDashboardUsage" enabled + And there is a valid "dashboard" in the system + And new "GetDashboardUsage" request + And request contains "dashboard_id" parameter from "dashboard.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "dashboard.id" + And the response "data.type" is equal to "dashboards-usages" + And the response "data.attributes.title" has the same value as "dashboard.title" + And the response "data.attributes" has field "org_id" + And the response "data.attributes" has field "total_views" + And the response "data.attributes.author" has field "handle" + + @replay-only @team:DataDog/dashboards-backend + Scenario: Get usage stats for all dashboards returns "Bad Request" response + Given operation "ListDashboardsUsage" enabled + And new "ListDashboardsUsage" request + And request contains "page[limit]" parameter with value 10000 + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/dashboards-backend + Scenario: Get usage stats for all dashboards returns "OK" response + Given operation "ListDashboardsUsage" enabled + And there is a valid "dashboard" in the system + And new "ListDashboardsUsage" request + When the request is sent + Then the response status is 200 OK + And the response "data[0].type" is equal to "dashboards-usages" + And the response "data[0]" has field "id" + And the response "data[0].attributes" has field "org_id" + And the response "meta.page.type" is equal to "offset_limit" + And the response "meta.page" has field "total" + And the response "links" has field "self" + + @replay-only @skip-validation @team:DataDog/dashboards-backend @with-pagination + Scenario: Get usage stats for all dashboards returns "OK" response with pagination + Given operation "ListDashboardsUsage" enabled + And new "ListDashboardsUsage" request + And request contains "page[limit]" parameter with value 500 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 590 items diff --git a/tests/scenarios/features/v2/email_transport.feature b/tests/scenarios/features/v2/email_transport.feature deleted file mode 100644 index f2b014905ed..00000000000 --- a/tests/scenarios/features/v2/email_transport.feature +++ /dev/null @@ -1,22 +0,0 @@ -@endpoint(email-transport) @endpoint(email-transport-v2) -Feature: Email Transport - Endpoints for receiving email transport webhook events for audit trail - processing. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "EmailTransport" API - And operation "CreateEmailTransportWebhookIntake" enabled - And new "CreateEmailTransportWebhookIntake" request - And body with value [{"attributes": {"category": ["transactional"], "email": {"address": "user@example.com", "domain": "example.com", "subject": "[Monitor Alert] CPU usage is high", "type": ["transactional"]}, "email_id": "abc123-def456", "email_type_display_name": "Monitor Alert", "message": {"auth": {"delivered_with_tls": "TLSv1.2"}, "custom_args": {"email_id": "abc123-def456", "email_type_display_name": "Monitor Alert", "org_uuid": "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", "queue_time": "2024-01-15T10:29:00Z", "subject": "[Monitor Alert] CPU usage is high"}, "id": {"message_id": "", "smtp_id": "", "transport_event_id": "evt_abc123"}, "name": "delivered", "response": {"enhanced_smtp_code": "2.0.0", "reason": "250 2.0.0 OK", "smtp_code": "250"}, "sender_ip": "192.168.1.1", "timestamp": {"event_timestamp": 1705312200.0, "lifetime": 3.2, "queue_time": 1.5, "scheduled_time": 1705312190.0}}, "network": {"ip": {"attributes": [{"ip": "192.168.1.1", "source": ["sendgrid"]}], "list": ["192.168.1.1"]}}, "org": 1234, "org_metadata": {}, "org_uuid": "8dee7c38-00cb-11ea-a77b-8b5a08d3b091", "queue_time": "2024-01-15T10:29:00Z", "subject": "[Monitor Alert] CPU usage is high", "useragent": "Mozilla/5.0"}, "date": "2024-01-15T10:30:00Z", "log_id": "AQAAAZPHnBT0TwJAdgAAAABBWlBIblVlNEFBQ0dFMmVkYTFDSnRR", "source": "sendgrid", "status": "info", "tags": ["env:production"]}] - - @generated @skip @team:DataDog/dogmail - Scenario: Ingest email transport webhook events returns "Bad Request" response - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/dogmail - Scenario: Ingest email transport webhook events returns "No Content" response - When the request is sent - Then the response status is 204 No Content diff --git a/tests/scenarios/features/v2/incidents.feature b/tests/scenarios/features/v2/incidents.feature index df4c5fe28da..e30ccb25292 100644 --- a/tests/scenarios/features/v2/incidents.feature +++ b/tests/scenarios/features/v2/incidents.feature @@ -275,7 +275,7 @@ Feature: Incidents When the request is sent Then the response status is 400 Bad Request - @team:Datadog/incident-app + @skip-terraform-config @team:Datadog/incident-app Scenario: Create incident notification template returns "Created" response Given there is a valid "incident_type" in the system And operation "CreateIncidentNotificationTemplate" enabled @@ -497,7 +497,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-validation @team:Datadog/incident-app + @skip-terraform-config @skip-validation @team:Datadog/incident-app Scenario: Delete an incident type returns "OK" response Given operation "DeleteIncidentType" enabled And new "DeleteIncidentType" request @@ -1311,7 +1311,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-validation @team:Datadog/incident-app + @skip-terraform-config @skip-validation @team:Datadog/incident-app Scenario: Update an incident type returns "OK" response Given operation "UpdateIncidentType" enabled And new "UpdateIncidentType" request diff --git a/tests/scenarios/features/v2/llm_observability.feature b/tests/scenarios/features/v2/llm_observability.feature index 639121ad238..0e1a7e984fa 100644 --- a/tests/scenarios/features/v2/llm_observability.feature +++ b/tests/scenarios/features/v2/llm_observability.feature @@ -1,13 +1,31 @@ @endpoint(llm-observability) @endpoint(llm-observability-v2) Feature: LLM Observability - Manage LLM Observability projects, datasets, dataset records, experiments, - and annotations. + Manage LLM Observability spans, data, projects, datasets, dataset records, + experiments, and annotations. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system And an instance of "LLMObservability" API + @skip @team:DataDog/ml-observability + Scenario: Add a display_block interaction returns "Created" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "markdown", "content": "## Triage Instructions"}]}]}, "type": "interactions"}} + When the request is sent + Then the response status is 201 Created + + @skip @team:DataDog/ml-observability + Scenario: Add a display_block interaction with an image block missing url returns "Bad Request" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "image"}]}]}, "type": "interactions"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ml-observability Scenario: Add annotation queue interactions returns "Bad Request" response Given operation "CreateLLMObsAnnotationQueueInteractions" enabled @@ -35,6 +53,22 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Aggregate LLM Observability experimentation returns "Bad Request" response + Given operation "AggregateLLMObsExperimentation" enabled + And new "AggregateLLMObsExperimentation" request + And body with value {"data": {"attributes": {"aggregate": {"compute": [{"metric": "score_value", "name": "avg_faithfulness"}], "dataset_version": null, "group_by": [{"field": "span_id"}], "indexes": ["experiment-evals"], "limit": 1000, "search": {"query": "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012"}, "time": {"from": 1705312200000, "to": 1705315800000}}}, "type": "experimentation"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Aggregate LLM Observability experimentation returns "OK" response + Given operation "AggregateLLMObsExperimentation" enabled + And new "AggregateLLMObsExperimentation" request + And body with value {"data": {"attributes": {"aggregate": {"compute": [{"metric": "score_value", "name": "avg_faithfulness"}], "dataset_version": null, "group_by": [{"field": "span_id"}], "indexes": ["experiment-evals"], "limit": 1000, "search": {"query": "@experiment_id:3fd6b5e0-8910-4b1c-a7d0-5b84de329012"}, "time": {"from": 1705312200000, "to": 1705315800000}}}, "type": "experimentation"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "Bad Request" response Given operation "CreateLLMObsDatasetRecords" enabled @@ -211,6 +245,22 @@ Feature: LLM Observability When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/ml-observability + Scenario: Delete LLM Observability data returns "Accepted" response + Given operation "DeleteLLMObsData" enabled + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete LLM Observability data returns "Bad Request" response + Given operation "DeleteLLMObsData" enabled + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "Bad Request" response Given operation "DeleteLLMObsDatasetRecords" enabled @@ -524,6 +574,78 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability spans returns "Bad Request" response + Given operation "ListLLMObsSpans" enabled + And new "ListLLMObsSpans" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability spans returns "OK" response + Given operation "ListLLMObsSpans" enabled + And new "ListLLMObsSpans" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "Bad Request" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "OK" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "Bad Request" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "OK" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List events for an LLM Observability experiment returns "Bad Request" response + Given operation "ListLLMObsExperimentEvents" enabled + And new "ListLLMObsExperimentEvents" request + And request contains "experiment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List events for an LLM Observability experiment returns "Not Found" response + Given operation "ListLLMObsExperimentEvents" enabled + And new "ListLLMObsExperimentEvents" request + And request contains "experiment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List events for an LLM Observability experiment returns "OK" response + Given operation "ListLLMObsExperimentEvents" enabled + And new "ListLLMObsExperimentEvents" request + And request contains "experiment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Push events for an LLM Observability experiment returns "Accepted" response Given operation "CreateLLMObsExperimentEvents" enabled @@ -551,6 +673,82 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "Bad Request" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "OK" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability experimentation entities returns "Bad Request" response + Given operation "SearchLLMObsExperimentation" enabled + And new "SearchLLMObsExperimentation" request + And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability experimentation entities returns "OK — all results returned in a single page." response + Given operation "SearchLLMObsExperimentation" enabled + And new "SearchLLMObsExperimentation" request + And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} + When the request is sent + Then the response status is 200 OK — all results returned in a single page. + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability experimentation entities returns "Partial Content — more results are available. Use `meta.after` as the next `page.cursor`." response + Given operation "SearchLLMObsExperimentation" enabled + And new "SearchLLMObsExperimentation" request + And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 100}}, "type": "experimentation"}} + When the request is sent + Then the response status is 206 Partial Content — more results are available. Use `meta.after` as the next `page.cursor`. + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability spans returns "Bad Request" response + Given operation "SearchLLMObsSpans" enabled + And new "SearchLLMObsSpans" request + And body with value {"data": {"attributes": {"filter": {"from": "now-900s", "ml_app": "my-llm-app", "query": "@session_id:abc123def456", "span_id": "abc123def456", "span_kind": "llm", "span_name": "llm_call", "to": "now", "trace_id": "trace-9a8b7c6d5e4f"}, "options": {"include_attachments": true, "time_offset": 0}, "page": {"cursor": "eyJzdGFydCI6MTAwfQ==", "limit": 10}, "sort": "-start_ns"}, "type": "spans"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Search LLM Observability spans returns "OK" response + Given operation "SearchLLMObsSpans" enabled + And new "SearchLLMObsSpans" request + And body with value {"data": {"attributes": {"filter": {"from": "now-900s", "ml_app": "my-llm-app", "query": "@session_id:abc123def456", "span_id": "abc123def456", "span_kind": "llm", "span_name": "llm_call", "to": "now", "trace_id": "trace-9a8b7c6d5e4f"}, "options": {"include_attachments": true, "time_offset": 0}, "page": {"cursor": "eyJzdGFydCI6MTAwfQ==", "limit": 10}, "sort": "-start_ns"}, "type": "spans"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Simple search experimentation entities returns "Bad Request" response + Given operation "SimpleSearchLLMObsExperimentation" enabled + And new "SimpleSearchLLMObsExperimentation" request + And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 50, "number": 1}, "sort": [{"direction": "desc", "field": "created_at"}]}, "type": "experimentation"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Simple search experimentation entities returns "OK" response + Given operation "SimpleSearchLLMObsExperimentation" enabled + And new "SimpleSearchLLMObsExperimentation" request + And body with value {"data": {"attributes": {"content_preview": {"limit": 500}, "filter": {"include_deleted": false, "is_deleted": false, "query": "my experiment", "scope": ["experiments"], "version": null}, "include": {"user_data": false}, "page": {"limit": 50, "number": 1}, "sort": [{"direction": "desc", "field": "created_at"}]}, "type": "experimentation"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Update LLM Observability dataset records returns "Bad Request" response Given operation "UpdateLLMObsDatasetRecords" enabled diff --git a/tests/scenarios/features/v2/model_lab_api.feature b/tests/scenarios/features/v2/model_lab_api.feature new file mode 100644 index 00000000000..997a9c389f6 --- /dev/null +++ b/tests/scenarios/features/v2/model_lab_api.feature @@ -0,0 +1,359 @@ +@endpoint(model-lab-api) @endpoint(model-lab-api-v2) +Feature: Model Lab API + Manage Model Lab projects, runs, artifacts, and facets for ML experiment + tracking. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ModelLabAPI" API + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete a Model Lab run returns "Bad Request" response + Given operation "DeleteModelLabRun" enabled + And new "DeleteModelLabRun" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Delete a Model Lab run returns "No Content" response + Given operation "DeleteModelLabRun" enabled + And new "DeleteModelLabRun" request + And request contains "run_id" parameter with value 70158 + When the request is sent + Then the response status is 204 No Content + + @replay-only @team:DataDog/ml-observability + Scenario: Delete a Model Lab run returns "Not Found" response + Given operation "DeleteModelLabRun" enabled + And new "DeleteModelLabRun" request + And request contains "run_id" parameter with value 999999 + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: Download artifact content returns "OK" response + Given operation "GetModelLabArtifactContent" enabled + And new "GetModelLabArtifactContent" request + And request contains "project_id" parameter with value "2387" + And request contains "artifact_path" parameter with value "f635c73b70594ab6bb6e212cdf87d0d5/artifacts/lora_model/adapter_config.json" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Get Model Lab artifact content returns "Bad Request" response + Given operation "GetModelLabArtifactContent" enabled + And new "GetModelLabArtifactContent" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "artifact_path" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get Model Lab artifact content returns "OK" response + Given operation "GetModelLabArtifactContent" enabled + And new "GetModelLabArtifactContent" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "artifact_path" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Get a Model Lab project returns "Bad Request" response + Given operation "GetModelLabProject" enabled + And new "GetModelLabProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Get a Model Lab project returns "Not Found" response + Given operation "GetModelLabProject" enabled + And new "GetModelLabProject" request + And request contains "project_id" parameter with value 999999 + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: Get a Model Lab project returns "OK" response + Given operation "GetModelLabProject" enabled + And new "GetModelLabProject" request + And request contains "project_id" parameter with value 2387 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Get a Model Lab run returns "Bad Request" response + Given operation "GetModelLabRun" enabled + And new "GetModelLabRun" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Get a Model Lab run returns "Not Found" response + Given operation "GetModelLabRun" enabled + And new "GetModelLabRun" request + And request contains "run_id" parameter with value 999999 + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: Get a Model Lab run returns "OK" response + Given operation "GetModelLabRun" enabled + And new "GetModelLabRun" request + And request contains "run_id" parameter with value 70158 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab project artifacts returns "Bad Request" response + Given operation "ListModelLabProjectArtifacts" enabled + And new "ListModelLabProjectArtifacts" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab project artifacts returns "OK" response + Given operation "ListModelLabProjectArtifacts" enabled + And new "ListModelLabProjectArtifacts" request + And request contains "project_id" parameter with value 2387 + When the request is sent + Then the response status is 200 OK + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab project facet keys returns "OK" response + Given operation "ListModelLabProjectFacetKeys" enabled + And new "ListModelLabProjectFacetKeys" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab project facet values returns "Bad Request" response + Given operation "ListModelLabProjectFacetValues" enabled + And new "ListModelLabProjectFacetValues" request + And request contains "facet_type" parameter from "REPLACE.ME" + And request contains "facet_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab project facet values returns "OK" response + Given operation "ListModelLabProjectFacetValues" enabled + And new "ListModelLabProjectFacetValues" request + And request contains "facet_type" parameter with value "tag" + And request contains "facet_name" parameter with value "model" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab projects returns "Bad Request" response + Given operation "ListModelLabProjects" enabled + And new "ListModelLabProjects" request + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab projects returns "OK" response + Given operation "ListModelLabProjects" enabled + And new "ListModelLabProjects" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run artifacts returns "Bad Request" response + Given operation "ListModelLabRunArtifacts" enabled + And new "ListModelLabRunArtifacts" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run artifacts returns "Not Found" response + Given operation "ListModelLabRunArtifacts" enabled + And new "ListModelLabRunArtifacts" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab run artifacts returns "OK" response + Given operation "ListModelLabRunArtifacts" enabled + And new "ListModelLabRunArtifacts" request + And request contains "run_id" parameter with value 70158 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run facet keys returns "Bad Request" response + Given operation "ListModelLabRunFacetKeys" enabled + And new "ListModelLabRunFacetKeys" request + And request contains "filter[project_id]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run facet keys returns "Not Found" response + Given operation "ListModelLabRunFacetKeys" enabled + And new "ListModelLabRunFacetKeys" request + And request contains "filter[project_id]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab run facet keys returns "OK" response + Given operation "ListModelLabRunFacetKeys" enabled + And new "ListModelLabRunFacetKeys" request + And request contains "filter[project_id]" parameter with value 2387 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run facet values returns "Bad Request" response + Given operation "ListModelLabRunFacetValues" enabled + And new "ListModelLabRunFacetValues" request + And request contains "filter[project_id]" parameter from "REPLACE.ME" + And request contains "facet_type" parameter from "REPLACE.ME" + And request contains "facet_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab run facet values returns "Not Found" response + Given operation "ListModelLabRunFacetValues" enabled + And new "ListModelLabRunFacetValues" request + And request contains "filter[project_id]" parameter from "REPLACE.ME" + And request contains "facet_type" parameter from "REPLACE.ME" + And request contains "facet_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab run facet values returns "OK" response + Given operation "ListModelLabRunFacetValues" enabled + And new "ListModelLabRunFacetValues" request + And request contains "filter[project_id]" parameter with value 2387 + And request contains "facet_type" parameter with value "tag" + And request contains "facet_name" parameter with value "model" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List Model Lab runs returns "Bad Request" response + Given operation "ListModelLabRuns" enabled + And new "ListModelLabRuns" request + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: List Model Lab runs returns "OK" response + Given operation "ListModelLabRuns" enabled + And new "ListModelLabRuns" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Pin a Model Lab run returns "Bad Request" response + Given operation "PinModelLabRun" enabled + And new "PinModelLabRun" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Pin a Model Lab run returns "No Content" response + Given operation "PinModelLabRun" enabled + And new "PinModelLabRun" request + And request contains "run_id" parameter with value 70158 + When the request is sent + Then the response status is 204 No Content + + @replay-only @team:DataDog/ml-observability + Scenario: Pin a Model Lab run returns "Not Found" response + Given operation "PinModelLabRun" enabled + And new "PinModelLabRun" request + And request contains "run_id" parameter with value 999999 + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Remove star from a Model Lab project returns "Bad Request" response + Given operation "UnstarModelLabProject" enabled + And new "UnstarModelLabProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Remove star from a Model Lab project returns "No Content" response + Given operation "UnstarModelLabProject" enabled + And new "UnstarModelLabProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ml-observability + Scenario: Remove star from a Model Lab project returns "Not Found" response + Given operation "UnstarModelLabProject" enabled + And new "UnstarModelLabProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Star a Model Lab project returns "Bad Request" response + Given operation "StarModelLabProject" enabled + And new "StarModelLabProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Star a Model Lab project returns "No Content" response + Given operation "StarModelLabProject" enabled + And new "StarModelLabProject" request + And request contains "project_id" parameter with value 2387 + When the request is sent + Then the response status is 204 No Content + + @replay-only @team:DataDog/ml-observability + Scenario: Star a Model Lab project returns "Not Found" response + Given operation "StarModelLabProject" enabled + And new "StarModelLabProject" request + And request contains "project_id" parameter with value 999999 + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Unpin a Model Lab run returns "Bad Request" response + Given operation "UnpinModelLabRun" enabled + And new "UnpinModelLabRun" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @team:DataDog/ml-observability + Scenario: Unpin a Model Lab run returns "No Content" response + Given operation "UnpinModelLabRun" enabled + And new "UnpinModelLabRun" request + And request contains "run_id" parameter with value 70158 + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ml-observability + Scenario: Unpin a Model Lab run returns "Not Found" response + Given operation "UnpinModelLabRun" enabled + And new "UnpinModelLabRun" request + And request contains "run_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/ml-observability + Scenario: Unstar a Model Lab project returns "No Content" response + Given operation "UnstarModelLabProject" enabled + And new "UnstarModelLabProject" request + And request contains "project_id" parameter with value 2387 + When the request is sent + Then the response status is 204 No Content diff --git a/tests/scenarios/features/v2/observability_pipelines.feature b/tests/scenarios/features/v2/observability_pipelines.feature index 887f147074d..487d6971f82 100644 --- a/tests/scenarios/features/v2/observability_pipelines.feature +++ b/tests/scenarios/features/v2/observability_pipelines.feature @@ -176,6 +176,14 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with HTTP server source valid_tokens returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["http-server-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "http-server-source", "type": "http_server", "auth_strategy": "none", "decoding": "json", "valid_tokens": [{"token_key": "HTTP_SERVER_TOKEN", "enabled": true, "path_to_token": {"header": "X-Token"}, "field_to_add": {"key": "token_name", "value": "primary_token"}}, {"token_key": "HTTP_SERVER_TOKEN_BACKUP", "enabled": true, "path_to_token": "path"}]}]}, "name": "Pipeline with HTTP server valid_tokens"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with OCSF mapper custom mapping returns "OK" response Given new "ValidatePipeline" request @@ -223,6 +231,14 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with Splunk HEC source valid_tokens returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["splunk-hec-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "splunk-hec-source", "type": "splunk_hec", "valid_tokens": [{"token_key": "SPLUNK_HEC_TOKEN", "enabled": true, "field_to_add": {"key": "token_name", "value": "primary_token"}}, {"token_key": "SPLUNK_HEC_TOKEN_BACKUP", "enabled": false}]}]}, "name": "Pipeline with Splunk HEC valid_tokens"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with amazon S3 source compression returns "OK" response Given new "ValidatePipeline" request @@ -231,6 +247,14 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @skip @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with cloud_prem destination buffer returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "cloud-prem-destination", "inputs": ["my-processor-group"], "type": "cloud_prem", "endpoint_url_key": "CLOUDPREM_ENDPOINT_URL", "buffer": {"type": "disk", "max_size": 1073741824, "when_full": "block"}}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with CloudPrem Buffer"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with destination secret key returns "OK" response Given new "ValidatePipeline" request diff --git a/tests/scenarios/features/v2/on-call.feature b/tests/scenarios/features/v2/on-call.feature index 0f4b2a0e340..a4ea9a7c4f0 100644 --- a/tests/scenarios/features/v2/on-call.feature +++ b/tests/scenarios/features/v2/on-call.feature @@ -401,7 +401,7 @@ Feature: On-Call And there is a valid "schedule" in the system And there is a valid "escalation_policy" in the system And request contains "team_id" parameter from "dd_team.data.id" - And body with value {"data": {"attributes": {"rules": [{"actions": [{"channel": "channel", "type": "send_slack_message", "workspace": "workspace"}], "query": "tags.service:test", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "", "urgency": "low"}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}} + And body with value {"data": {"attributes": {"rules": [{"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": "tags.service:time_restrictions", "time_restriction": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "monday", "end_time": "17:00:00", "start_day": "monday", "start_time": "09:00:00"}, {"end_day": "tuesday", "end_time": "17:00:00", "start_day": "tuesday", "start_time": "09:00:00"}]}}, {"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low", "ack_timeout_minutes": 30, "support_hours": {"time_zone": "Europe/Paris", "restrictions": [{"end_day": "wednesday", "end_time": "17:00:00", "start_day": "wednesday", "start_time": "09:00:00"}, {"end_day": "thursday", "end_time": "17:00:00", "start_day": "thursday", "start_time": "09:00:00"}]}}], "query": "tags.service:support_hours_and_acknowledgment_timeout"}, {"policy_id": "{{ escalation_policy.data.id }}", "query": "tags.service:legacy_policy_definition", "urgency": "low"}, {"actions": [{"type": "escalation_policy", "policy_id": "{{ escalation_policy.data.id }}", "urgency": "low"}], "query": ""}]}, "id": "{{ dd_team.data.id }}", "type": "team_routing_rules"}} And request contains "include" parameter with value "rules" When the request is sent Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/scorecards.feature b/tests/scenarios/features/v2/scorecards.feature index 750948d8991..e932599c677 100644 --- a/tests/scenarios/features/v2/scorecards.feature +++ b/tests/scenarios/features/v2/scorecards.feature @@ -183,6 +183,20 @@ Feature: Scorecards When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog + Scenario: List all scores returns "Bad Request" response + Given new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List all scores returns "OK" response + Given new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/service-catalog Scenario: Update Scorecard outcomes asynchronously returns "Accepted" response Given there is a valid "create_scorecard_rule" in the system diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index 95306c99540..485a947631d 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -142,6 +142,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk subscribe to sample log generation returns "Bad Request" response + Given operation "BulkCreateSampleLogGenerationSubscriptions" enabled + And new "BulkCreateSampleLogGenerationSubscriptions" request + And body with value {"data": {"attributes": {"content_pack_ids": ["aws-cloudtrail"], "duration": "3d"}, "type": "bulk_subscription_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk subscribe to sample log generation returns "OK" response + Given operation "BulkCreateSampleLogGenerationSubscriptions" enabled + And new "BulkCreateSampleLogGenerationSubscriptions" request + And body with value {"data": {"attributes": {"content_pack_ids": ["aws-cloudtrail"], "duration": "3d"}, "type": "bulk_subscription_requests"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-siem Scenario: Bulk update security signals returns "Bad Request" response Given new "BulkEditSecurityMonitoringSignals" request @@ -559,6 +575,19 @@ Feature: Security Monitoring And the response "type" is equal to "application_security" And the response "message" is equal to "Test rule" + @skip-validation @team:DataDog/k9-cloud-siem + Scenario: Create a detection rule with type 'impossible_travel' and baselineUserLocationsDuration returns "OK" response + Given new "CreateSecurityMonitoringRule" request + And body with value {"queries":[{"aggregation":"geo_data","groupByFields":["@usr.id"],"distinctFields":[],"metric":"@network.client.geoip","query":"*"}],"cases":[{"name":"","status":"info","notifications":[]}],"hasExtendedTitle":true,"message":"test","isEnabled":true,"options":{"maxSignalDuration":86400,"evaluationWindow":900,"keepAlive":3600,"detectionMethod":"impossible_travel","impossibleTravelOptions":{"baselineUserLocations":true,"baselineUserLocationsDuration":7}},"name":"{{ unique }}","type":"log_detection","tags":[],"filters":[]} + When the request is sent + Then the response status is 200 OK + And the response "name" is equal to "{{ unique }}" + And the response "type" is equal to "log_detection" + And the response "message" is equal to "test" + And the response "options.detectionMethod" is equal to "impossible_travel" + And the response "options.impossibleTravelOptions.baselineUserLocations" is equal to true + And the response "options.impossibleTravelOptions.baselineUserLocationsDuration" is equal to 7 + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Create a detection rule with type 'impossible_travel' returns "OK" response Given new "CreateSecurityMonitoringRule" request @@ -708,6 +737,22 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create an entity context sync configuration returns "Bad Request" response + Given operation "CreateSecurityMonitoringIntegrationConfig" enabled + And new "CreateSecurityMonitoringIntegrationConfig" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create an entity context sync configuration returns "OK" response + Given operation "CreateSecurityMonitoringIntegrationConfig" enabled + And new "CreateSecurityMonitoringIntegrationConfig" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-investigation Scenario: Create case for security finding returns "Created" response Given new "CreateCases" request @@ -898,6 +943,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Rule successfully deleted. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete an entity context sync configuration returns "Not Found" response + Given operation "DeleteSecurityMonitoringIntegrationConfig" enabled + And new "DeleteSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete an entity context sync configuration returns "OK" response + Given operation "DeleteSecurityMonitoringIntegrationConfig" enabled + And new "DeleteSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @team:DataDog/k9-cloud-siem Scenario: Delete an existing job returns "Bad Request" response Given operation "DeleteHistoricalJob" enabled @@ -1385,6 +1446,22 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get an entity context sync configuration returns "Not Found" response + Given operation "GetSecurityMonitoringIntegrationConfig" enabled + And new "GetSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get an entity context sync configuration returns "OK" response + Given operation "GetSecurityMonitoringIntegrationConfig" enabled + And new "GetSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get an indicator of compromise returns "Bad Request" response Given operation "GetIndicatorOfCompromise" enabled @@ -1482,6 +1559,44 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 Notification rule details. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "Bad Request" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "Not Found" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "OK" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entity context returns "Bad Request" response + Given operation "GetEntityContext" enabled + And new "GetEntityContext" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entity context returns "OK" response + Given operation "GetEntityContext" enabled + And new "GetEntityContext" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get investigation queries for a signal returns "Not Found" response Given new "GetInvestigationLogQueriesMatchingSignal" request @@ -1514,6 +1629,20 @@ Feature: Security Monitoring And the response "data.attributes.count" is equal to 1 And the response "data.attributes.data[1].rule.name" has the same value as "security_rule.name" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get sample log generation subscriptions returns "Bad Request" response + Given operation "ListSampleLogGenerationSubscriptions" enabled + And new "ListSampleLogGenerationSubscriptions" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get sample log generation subscriptions returns "OK" response + Given operation "ListSampleLogGenerationSubscriptions" enabled + And new "ListSampleLogGenerationSubscriptions" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get suggested actions for a signal returns "Not Found" response Given new "GetSuggestedActionsMatchingSignal" request @@ -1580,6 +1709,12 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get the version history of security filters returns "OK" response + Given new "ListSecurityFilterVersions" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "ListAssetsSBOMs" request @@ -1608,6 +1743,13 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: List entity context sync configurations returns "OK" response + Given operation "ListSecurityMonitoringIntegrationConfigs" enabled + And new "ListSecurityMonitoringIntegrationConfigs" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListFindings" enabled @@ -2096,6 +2238,22 @@ Feature: Security Monitoring And the response "meta.page" has field "after" And the response "links" has field "next" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Subscribe to sample log generation returns "Bad Request" response + Given operation "CreateSampleLogGenerationSubscription" enabled + And new "CreateSampleLogGenerationSubscription" request + And body with value {"data": {"attributes": {"content_pack_id": "aws-cloudtrail", "duration": "3d"}, "type": "subscription_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Subscribe to sample log generation returns "OK" response + Given operation "CreateSampleLogGenerationSubscription" enabled + And new "CreateSampleLogGenerationSubscription" request + And body with value {"data": {"attributes": {"content_pack_id": "aws-cloudtrail", "duration": "3d"}, "type": "subscription_requests"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-siem Scenario: Test a rule returns "Bad Request" response Given new "TestSecurityMonitoringRule" request @@ -2166,6 +2324,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Unsubscribe from sample log generation returns "Bad Request" response + Given operation "DeleteSampleLogGenerationSubscription" enabled + And new "DeleteSampleLogGenerationSubscription" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Unsubscribe from sample log generation returns "OK" response + Given operation "DeleteSampleLogGenerationSubscription" enabled + And new "DeleteSampleLogGenerationSubscription" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Update a cloud configuration rule's details returns "OK" response Given new "UpdateSecurityMonitoringRule" request @@ -2305,6 +2479,33 @@ Feature: Security Monitoring And the response "data.attributes.suppression_query" is equal to "env:staging status:low" And the response "data.attributes.version" is equal to 2 + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "Bad Request" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "Not Found" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "OK" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Update an existing rule returns "Bad Request" response Given new "UpdateSecurityMonitoringRule" request @@ -2412,3 +2613,43 @@ Feature: Security Monitoring And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail"}, "type": "suppressions"}} When the request is sent Then the response status is 204 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "Bad Request" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "Not Found" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "OK" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate entity context sync credentials returns "Bad Request" response + Given operation "ValidateSecurityMonitoringIntegrationCredentials" enabled + And new "ValidateSecurityMonitoringIntegrationCredentials" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "secrets": {"admin_email": "test@example.com"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate entity context sync credentials returns "OK" response + Given operation "ValidateSecurityMonitoringIntegrationCredentials" enabled + And new "ValidateSecurityMonitoringIntegrationCredentials" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "secrets": {"admin_email": "test@example.com"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/test_examples.feature b/tests/scenarios/features/v2/test_examples.feature new file mode 100644 index 00000000000..263011b0ce3 --- /dev/null +++ b/tests/scenarios/features/v2/test_examples.feature @@ -0,0 +1,12 @@ +@endpoint(test-examples) @endpoint(test-examples-v2) +Feature: Test Examples + Manage test example resources. + + @generated @skip @team:DataDog/webframeworks-test + Scenario: List test examples returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TestExamples" API + And new "ListTestExamples" request + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index dc1a8b2fbbd..09d56ad5577 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -632,6 +632,91 @@ "type": "idempotent" } }, + "UpdateAppFavorite": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateProtectionLevel": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "CreatePublishRequest": { + "tag": "App Builder", + "undo": { + "operationId": "DeleteApp", + "parameters": [ + { + "name": "app_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RevertApp": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppSelfService": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppTags": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppVersionName": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "ListAppVersions": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "GetBlueprint": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "ListBlueprints": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "GetBlueprintsByIntegrationId": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "GetBlueprintsBySlugs": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "ListTags": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, "ListApplicationKeys": { "tag": "Key Management", "undo": { @@ -735,6 +820,49 @@ "type": "safe" } }, + "AggregateCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "BulkUpdateCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CountCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "ListCaseLinks": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseLink": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseLink": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetProjects": { "tag": "Case Management", "undo": { @@ -754,6 +882,12 @@ "type": "unsafe" } }, + "ListUserCaseProjectFavorites": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "DeleteProject": { "tag": "Case Management", "undo": { @@ -772,6 +906,25 @@ "type": "idempotent" } }, + "UnfavoriteCaseProject": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "FavoriteCaseProject": { + "tag": "Case Management", + "undo": { + "operationId": "UnfavoriteCaseProject", + "parameters": [ + { + "name": "project_id", + "source": "path.project_id" + } + ], + "type": "unsafe" + } + }, "GetProjectNotificationRules": { "tag": "Case Management", "undo": { @@ -807,6 +960,59 @@ "type": "idempotent" } }, + "ListCaseAutomationRules": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseAutomationRule", + "parameters": [ + { + "name": "project_id", + "source": "path.project_id" + }, + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "GetCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UpdateCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "DisableCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "EnableCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetAllCaseTypes": { "tag": "Case Management Type", "undo": { @@ -831,6 +1037,12 @@ "type": "idempotent" } }, + "UpdateCaseType": { + "tag": "Case Management Type", + "undo": { + "type": "idempotent" + } + }, "GetAllCustomAttributeConfigsByCaseType": { "tag": "Case Management Attribute", "undo": { @@ -849,6 +1061,49 @@ "type": "idempotent" } }, + "UpdateCustomAttributeConfig": { + "tag": "Case Management Attribute", + "undo": { + "type": "idempotent" + } + }, + "ListCaseViews": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseView": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseView", + "parameters": [ + { + "name": "view_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseView": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "GetCaseView": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UpdateCaseView": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetCase": { "tag": "Case Management", "undo": { @@ -885,6 +1140,12 @@ "type": "idempotent" } }, + "UpdateCaseComment": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "DeleteCaseCustomAttribute": { "tag": "Case Management", "undo": { @@ -903,6 +1164,24 @@ "type": "idempotent" } }, + "UpdateCaseDueDate": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "RemoveCaseInsights": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "AddCaseInsights": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "UpdatePriority": { "tag": "Case Management", "undo": { @@ -959,12 +1238,24 @@ "type": "unsafe" } }, + "UpdateCaseResolvedReason": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "UpdateStatus": { "tag": "Case Management", "undo": { "type": "idempotent" } }, + "ListCaseTimeline": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "UpdateCaseTitle": { "tag": "Case Management", "undo": { @@ -983,6 +1274,35 @@ "type": "idempotent" } }, + "ListCaseWatchers": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UnwatchCase": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "WatchCase": { + "tag": "Case Management", + "undo": { + "operationId": "UnwatchCase", + "parameters": [ + { + "name": "case_id", + "source": "path.case_id" + }, + { + "name": "user_uuid", + "source": "path.user_uuid" + } + ], + "type": "unsafe" + } + }, "ListCatalogEntity": { "tag": "Software Catalog", "undo": { @@ -1253,6 +1573,12 @@ "type": "safe" } }, + "GetRuleBasedView": { + "tag": "Compliance", + "undo": { + "type": "safe" + } + }, "ListContainerImages": { "tag": "Container Images", "undo": { @@ -1422,6 +1748,54 @@ "type": "safe" } }, + "GetCommitmentsCommitmentList": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsOnDemandHotspotsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCustomCostsFiles": { "tag": "Cloud Cost Management", "undo": { @@ -1482,6 +1856,12 @@ "type": "safe" } }, + "SearchCostRecommendations": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagDescriptions": { "tag": "Cloud Cost Management", "undo": { @@ -1500,6 +1880,36 @@ "type": "safe" } }, + "ListCostTagMetadata": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCostTagMetadataCurrency": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataMetrics": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataOrchestrators": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagKeySources": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTags": { "tag": "Cloud Cost Management", "undo": { @@ -1654,7 +2064,19 @@ "UpdateDashboardSecureEmbed": { "tag": "Dashboard Secure Embed", "undo": { - "type": "idempotent" + "type": "idempotent" + } + }, + "ListDashboardsUsage": { + "tag": "Dashboards", + "undo": { + "type": "safe" + } + }, + "GetDashboardUsage": { + "tag": "Dashboards", + "undo": { + "type": "safe" } }, "GetAllDatasets": { @@ -1918,12 +2340,6 @@ "type": "idempotent" } }, - "CreateEmailTransportWebhookIntake": { - "tag": "Email Transport", - "undo": { - "type": "safe" - } - }, "SearchIssues": { "tag": "Error Tracking", "undo": { @@ -3280,6 +3696,14 @@ "type": "idempotent" } }, + "DeleteLLMObsData": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "ListLLMObsAnnotationQueues": { "tag": "LLM Observability", "undo": { @@ -3352,6 +3776,24 @@ "type": "idempotent" } }, + "AggregateLLMObsExperimentation": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "SearchLLMObsExperimentation": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "SimpleSearchLLMObsExperimentation": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsExperiments": { "tag": "LLM Observability", "undo": { @@ -3361,15 +3803,19 @@ "CreateLLMObsExperiment": { "tag": "LLM Observability", "undo": { - "operationId": "TODO", - "parameters": [], + "operationId": "DeleteLLMObsExperiments", + "parameters": [ + { + "name": "body", + "template": "{\"data\": {\"attributes\": {\"experiment_ids\": [\"{{ data.id }}\"]}, \"type\": \"experiments\"}}" + } + ], "type": "unsafe" } }, "DeleteLLMObsExperiments": { "tag": "LLM Observability", "undo": { - "operationId": "TODO", "parameters": [], "type": "unsafe" } @@ -3383,11 +3829,28 @@ "CreateLLMObsExperimentEvents": { "tag": "LLM Observability", "undo": { - "operationId": "TODO", "parameters": [], "type": "unsafe" } }, + "ListLLMObsIntegrationAccounts": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsIntegrationInference": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsIntegrationModels": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsProjects": { "tag": "LLM Observability", "undo": { @@ -3416,6 +3879,18 @@ "type": "idempotent" } }, + "ListLLMObsSpans": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "SearchLLMObsSpans": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsDatasets": { "tag": "LLM Observability", "undo": { @@ -3481,6 +3956,12 @@ "type": "unsafe" } }, + "ListLLMObsExperimentEvents": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "SubmitLog": { "tag": "Logs", "undo": { @@ -3719,6 +4200,37 @@ "type": "safe" } }, + "ListMaintenanceWindows": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteMaintenanceWindow", + "parameters": [ + { + "name": "maintenance_window_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "ListTagConfigurations": { "tag": "Metrics", "undo": { @@ -3811,6 +4323,118 @@ "type": "safe" } }, + "GetModelLabArtifactContent": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabRunFacetKeys": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabRunFacetValues": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabProjectFacetKeys": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabProjectFacetValues": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabProjects": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "GetModelLabProject": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabProjectArtifacts": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "UnstarModelLabProject": { + "tag": "Model Lab API", + "undo": { + "type": "idempotent" + } + }, + "StarModelLabProject": { + "tag": "Model Lab API", + "undo": { + "operationId": "UnstarModelLabProject", + "parameters": [ + { + "name": "project_id", + "origin": "path", + "source": "project_id" + } + ], + "type": "unsafe" + } + }, + "ListModelLabRuns": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "DeleteModelLabRun": { + "tag": "Model Lab API", + "undo": { + "type": "idempotent" + } + }, + "GetModelLabRun": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "ListModelLabRunArtifacts": { + "tag": "Model Lab API", + "undo": { + "type": "safe" + } + }, + "UnpinModelLabRun": { + "tag": "Model Lab API", + "undo": { + "type": "idempotent" + } + }, + "PinModelLabRun": { + "tag": "Model Lab API", + "undo": { + "operationId": "UnpinModelLabRun", + "parameters": [ + { + "name": "run_id", + "origin": "path", + "source": "run_id" + } + ], + "type": "unsafe" + } + }, "GetMonitorNotificationRules": { "tag": "Monitors", "undo": { @@ -5306,6 +5930,12 @@ "type": "safe" } }, + "ListScorecardScores": { + "tag": "Scorecards", + "undo": { + "type": "safe" + } + }, "UnassignSeatsUser": { "tag": "Seats", "undo": { @@ -5601,6 +6231,55 @@ "type": "idempotent" } }, + "ListSecurityMonitoringIntegrationConfigs": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringIntegrationConfig", + "parameters": [ + { + "name": "integration_config_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ValidateSecurityMonitoringIntegrationCredentials": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "DeleteSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ValidateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityFilters": { "tag": "Security Monitoring", "undo": { @@ -5620,6 +6299,12 @@ "type": "unsafe" } }, + "ListSecurityFilterVersions": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "DeleteSecurityFilter": { "tag": "Security Monitoring", "undo": { @@ -5717,6 +6402,12 @@ "type": "idempotent" } }, + "GetEntityContext": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { @@ -5802,6 +6493,37 @@ "type": "safe" } }, + "ListSampleLogGenerationSubscriptions": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSampleLogGenerationSubscription": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSampleLogGenerationSubscription", + "parameters": [ + { + "name": "content_pack_id", + "source": "data.attributes.content_pack_id" + } + ], + "type": "unsafe" + } + }, + "BulkCreateSampleLogGenerationSubscriptions": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSampleLogGenerationSubscription": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListSecurityMonitoringSignals": { "tag": "Security Monitoring", "undo": { @@ -5844,6 +6566,12 @@ "type": "idempotent" } }, + "GetSignalEntities": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "EditSecurityMonitoringSignalIncidents": { "tag": "Security Monitoring", "undo": { @@ -7048,6 +7776,12 @@ "type": "idempotent" } }, + "ListTestExamples": { + "tag": "Test Examples", + "undo": { + "type": "safe" + } + }, "UpdateFlakyTests": { "tag": "Test Optimization", "undo": {