diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 583d0d86f5..3ebb9bfff6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1947,6 +1947,22 @@ components: default: created_at example: "-created_at" type: string + ProductAnalyticsLaunchIDPathParameter: + description: UUID of the launch. + in: path + name: id + required: true + schema: + example: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: string + ProductAnalyticsMonitorIDPathParameter: + description: ID of the monitor. It is a numeric ID. + in: path + name: monitor_id + required: true + schema: + example: "12345" + type: string ProductName: description: Name of the product to be deleted. Only `logs` is supported. example: logs @@ -109847,6 +109863,1120 @@ components: type: string x-enum-varnames: - JOURNEY_TIMESERIES_RESPONSE + ProductAnalyticsLaunchAttributes: + description: Attributes of a launch. + properties: + application_id: + description: UUID of the RUM application that the launch belongs to. + nullable: true + type: string + context: + description: Context of the feature being launched. + nullable: true + type: string + created_at: + description: Time the launch was created. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + created_by: + description: UUID of the user who created the launch. + example: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + type: string + description: + description: Description of the feature being launched. + nullable: true + type: string + feature_flag_id: + description: UUID of the Datadog feature flag that gates the launch. + nullable: true + type: string + feature_flag_key: + description: Key of a feature flag managed outside Datadog. + nullable: true + type: string + kpis: + description: KPIs that the launch is meant to move. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchKPI" + nullable: true + type: array + name: + description: Name of the launch. + example: checkout_promo_codes + type: string + org_id: + description: ID of the organization that owns the launch. + example: 2 + format: int64 + type: integer + phase: + $ref: "#/components/schemas/ProductAnalyticsLaunchPhase" + repository_id: + description: ID of the code repository that implements the feature. + type: string + steps: + $ref: "#/components/schemas/ProductAnalyticsLaunchSteps" + updated_at: + description: Time the launch was last updated. + format: date-time + nullable: true + type: string + updated_by: + description: UUID of the user who last updated the launch. + nullable: true + type: string + required: + - org_id + - phase + - name + - created_by + - created_at + - steps + type: object + ProductAnalyticsLaunchCodeAnalysis: + description: |- + Latest inspection of the repository for the tracking plan instrumentation. A new analysis replaces the stored one. + Events and properties that it does not list are not verified. + properties: + analyzed_at: + description: Time of the analysis. Set by the server. + format: date-time + readOnly: true + type: string + events: + description: Results for the events of the tracking plan. List each event once. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchEventFinding" + type: array + revision: + description: Code revision that was inspected, such as a commit SHA. + type: string + type: object + ProductAnalyticsLaunchCodeStatus: + description: Whether the inspected code sends the event, or attaches the property to the event. + enum: + - found + - not_found + example: found + type: string + x-enum-varnames: + - FOUND + - NOT_FOUND + ProductAnalyticsLaunchCreateData: + description: Data of the launch to create. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsLaunchRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsLaunchType" + required: + - type + - attributes + type: object + ProductAnalyticsLaunchCreateRequest: + description: Request to create a launch. + example: + data: + attributes: + context: Let users apply promo codes at checkout. + description: Promo codes at checkout. + kpis: + - id: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + title: Checkout conversion rate + name: checkout_promo_codes + phase: plan + steps: + tracking_plan: + events: + - kpis: + - 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + name: promo_code_applied + trigger: The user applies a valid promo code. + views: + - /checkout + type: liftoff + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsLaunchCreateData" + required: + - data + type: object + ProductAnalyticsLaunchDashboardStep: + description: Dashboard linked to the launch. + properties: + dashboard_id: + description: ID of the linked dashboard. + nullable: true + type: string + type: object + ProductAnalyticsLaunchData: + description: A launch. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsLaunchAttributes" + id: + description: UUID of the launch. + example: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsLaunchType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsLaunchEvent: + description: An event to instrument for the launch. + properties: + description: + description: What the event records. + type: string + kpis: + description: IDs of the launch KPIs that the event measures. + items: + description: ID of a launch KPI. + type: string + type: array + name: + description: Name of the event, unique within the tracking plan. + example: promo_code_applied + type: string + properties: + description: Properties that the event carries. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchEventProperty" + type: array + trigger: + description: What causes the event to be sent. + type: string + views: + description: Views where the event is sent. Each value must be unique and not blank. + items: + description: Name of a view. + type: string + type: array + required: + - name + type: object + ProductAnalyticsLaunchEventFinding: + description: Code analysis result for an event of the tracking plan. + properties: + name: + description: Name of the event in the tracking plan. + example: promo_code_applied + type: string + properties: + description: Results for the properties of the event. Only allowed when the event is `found`. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchPropertyFinding" + type: array + status: + $ref: "#/components/schemas/ProductAnalyticsLaunchCodeStatus" + required: + - name + - status + type: object + ProductAnalyticsLaunchEventProperty: + description: A reference from an event to a property of the tracking plan. + properties: + id: + description: ID of a property in the tracking plan `properties`. + example: promo_code + type: string + required: + description: Whether the event must always include the property. + type: boolean + required: + - id + type: object + ProductAnalyticsLaunchExperimentStep: + description: Experiment linked to the launch. The draft fields are cleared when `experiment_id` is set. + properties: + experiment_id: + description: UUID of the linked experiment. + nullable: true + type: string + hypothesis: + description: Hypothesis of a draft experiment. + nullable: true + type: string + name: + description: Name of a draft experiment. + nullable: true + type: string + protocol_id: + description: Protocol ID of a draft experiment. + nullable: true + type: string + type: object + ProductAnalyticsLaunchFunnelStep: + description: Funnel linked to the launch. + properties: + funnel_tile_def: + additionalProperties: {} + description: Definition of the funnel widget, as a JSON object. + nullable: true + type: object + type: object + ProductAnalyticsLaunchKPI: + description: A KPI that the launch is meant to move. + properties: + id: + description: ID of the KPI, unique within the launch. Tracking plan events reference it. + example: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + type: string + title: + description: Name of the KPI. + example: Checkout conversion rate + type: string + required: + - id + - title + type: object + ProductAnalyticsLaunchListScope: + description: Scope of a launch list. `liftoffs` leaves out launches in the `plan` phase. + enum: + - liftoffs + example: liftoffs + type: string + x-enum-varnames: + - LIFTOFFS + ProductAnalyticsLaunchPatchAttributes: + description: |- + Attributes to update on a launch. Fields that are not set are left unchanged, and `null` clears a nullable field. + Setting a non-empty `feature_flag_id` clears the stored `feature_flag_key` when `feature_flag_key` is not set. + properties: + application_id: + description: UUID of the RUM application that the launch belongs to. + nullable: true + type: string + code_analysis: + $ref: "#/components/schemas/ProductAnalyticsLaunchCodeAnalysis" + context: + description: Context of the feature being launched. + type: string + description: + description: Description of the feature being launched. + nullable: true + type: string + feature_flag_id: + description: UUID of the Datadog feature flag that gates the launch. + nullable: true + type: string + feature_flag_key: + description: Key of a feature flag managed outside Datadog. At most 256 characters, with no leading or trailing spaces. + maxLength: 256 + minLength: 1 + nullable: true + type: string + kpis: + description: KPIs that the launch is meant to move. Replaces the stored list, and `null` clears it. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchKPI" + nullable: true + type: array + name: + description: Name of the launch. + type: string + phase: + $ref: "#/components/schemas/ProductAnalyticsLaunchPhase" + repository_id: + description: ID of the code repository that implements the feature. + nullable: true + type: string + steps: + $ref: "#/components/schemas/ProductAnalyticsLaunchPatchSteps" + type: object + ProductAnalyticsLaunchPatchData: + description: Data of the launch update. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsLaunchPatchAttributes" + id: + description: UUID of the launch. It must match the ID in the path. + example: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsLaunchType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsLaunchPatchRequest: + description: Request to update some fields of a launch. + example: + data: + attributes: + phase: setup + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsLaunchPatchData" + required: + - data + type: object + ProductAnalyticsLaunchPatchSteps: + description: |- + Steps to update. Steps that are not set are left unchanged. + A `tracking_plan` replaces the whole stored tracking plan, so include every event and property to keep. + properties: + dashboard: + $ref: "#/components/schemas/ProductAnalyticsLaunchDashboardStep" + experiment: + $ref: "#/components/schemas/ProductAnalyticsLaunchExperimentStep" + funnel: + $ref: "#/components/schemas/ProductAnalyticsLaunchFunnelStep" + tracking_plan: + $ref: "#/components/schemas/ProductAnalyticsLaunchTrackingPlanRequest" + type: object + ProductAnalyticsLaunchPhase: + description: |- + Lifecycle phase of a launch. A new launch starts in `plan` or `setup`, and defaults to `plan`. + Allowed changes: `plan` to `setup`, `setup` to `ready`, `ready` to `setup` or `launched`, and `launched` to `ready`. + enum: + - plan + - setup + - ready + - launched + example: plan + type: string + x-enum-varnames: + - PLAN + - SETUP + - READY + - LAUNCHED + ProductAnalyticsLaunchProperties: + additionalProperties: + $ref: "#/components/schemas/ProductAnalyticsLaunchProperty" + description: Event properties of the tracking plan, keyed by property ID. + example: + promo_code: + description: Promo code entered by the user. + type: object + ProductAnalyticsLaunchProperty: + description: An event property of the tracking plan. + properties: + description: + description: What the property captures. + example: Promo code entered by the user. + type: string + required: + - description + type: object + ProductAnalyticsLaunchPropertyFinding: + description: Code analysis result for a property of an event. + properties: + id: + description: ID of the property in the tracking plan. + example: promo_code + type: string + status: + $ref: "#/components/schemas/ProductAnalyticsLaunchCodeStatus" + required: + - id + - status + type: object + ProductAnalyticsLaunchRequestAttributes: + description: Attributes of a launch to create or replace. + properties: + application_id: + description: UUID of the RUM application that the launch belongs to. + nullable: true + type: string + context: + description: Context of the feature being launched, used to build the tracking plan. + example: Let users apply promo codes at checkout. + type: string + description: + description: Description of the feature being launched. + nullable: true + type: string + feature_flag_id: + description: UUID of the Datadog feature flag that gates the launch. Do not set it together with `feature_flag_key`. + nullable: true + type: string + feature_flag_key: + description: |- + Key of a feature flag managed outside Datadog, as evaluated in code. At most 256 characters, with no leading or trailing spaces. + Do not set it together with `feature_flag_id`. `null` clears it. On replace, omitting it keeps the stored key unless `feature_flag_id` is set. + maxLength: 256 + minLength: 1 + nullable: true + type: string + kpis: + description: KPIs that the launch is meant to move. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchKPI" + type: array + name: + description: Name of the launch. + example: checkout_promo_codes + type: string + phase: + $ref: "#/components/schemas/ProductAnalyticsLaunchPhase" + repository_id: + description: ID of the code repository that implements the feature. + type: string + steps: + $ref: "#/components/schemas/ProductAnalyticsLaunchStepsRequest" + required: + - name + - context + - steps + type: object + ProductAnalyticsLaunchResponse: + description: Response containing a launch. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsLaunchData" + required: + - data + type: object + ProductAnalyticsLaunchSteps: + description: Steps of the launch. + properties: + dashboard: + $ref: "#/components/schemas/ProductAnalyticsLaunchDashboardStep" + experiment: + $ref: "#/components/schemas/ProductAnalyticsLaunchExperimentStep" + funnel: + $ref: "#/components/schemas/ProductAnalyticsLaunchFunnelStep" + tracking_plan: + $ref: "#/components/schemas/ProductAnalyticsLaunchTrackingPlan" + type: object + ProductAnalyticsLaunchStepsRequest: + description: Steps of the launch. The tracking plan is required. + properties: + dashboard: + $ref: "#/components/schemas/ProductAnalyticsLaunchDashboardStep" + experiment: + $ref: "#/components/schemas/ProductAnalyticsLaunchExperimentStep" + funnel: + $ref: "#/components/schemas/ProductAnalyticsLaunchFunnelStep" + tracking_plan: + $ref: "#/components/schemas/ProductAnalyticsLaunchTrackingPlanRequest" + required: + - tracking_plan + type: object + ProductAnalyticsLaunchTrackingPlan: + description: Tracking plan of a launch, listing the events and properties to instrument. + properties: + code_analysis: + $ref: "#/components/schemas/ProductAnalyticsLaunchCodeAnalysis" + codegen_session_id: + description: ID of the code generation session that implemented the plan. + type: string + created_at: + description: Time the tracking plan was created. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + created_by: + description: UUID of the user who created the tracking plan. + example: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + type: string + events: + description: Events to instrument. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchEvent" + type: array + id: + description: ID of the tracking plan. + example: 9b1d6c2e-4f3a-4b5c-8d7e-6f5a4b3c2d1e + type: string + jira_ticket_id: + description: ID of the Jira ticket that tracks the instrumentation work. + type: string + pr_link: + description: Link to the pull request that implements the plan. + type: string + properties: + $ref: "#/components/schemas/ProductAnalyticsLaunchProperties" + updated_at: + description: Time the tracking plan was last updated. + format: date-time + nullable: true + type: string + updated_by: + description: UUID of the user who last updated the tracking plan. + nullable: true + type: string + required: + - id + - created_by + - created_at + type: object + ProductAnalyticsLaunchTrackingPlanRequest: + description: Tracking plan of a launch, listing the events and properties to instrument. + properties: + code_analysis: + $ref: "#/components/schemas/ProductAnalyticsLaunchCodeAnalysis" + codegen_session_id: + description: ID of the code generation session that implemented the plan. + type: string + events: + description: Events to instrument. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchEvent" + type: array + jira_ticket_id: + description: ID of the Jira ticket that tracks the instrumentation work. + type: string + pr_link: + description: Link to the pull request that implements the plan. + type: string + properties: + $ref: "#/components/schemas/ProductAnalyticsLaunchProperties" + type: object + ProductAnalyticsLaunchType: + default: liftoff + description: Launch resource type. + enum: + - liftoff + example: liftoff + type: string + x-enum-varnames: + - LIFTOFF + ProductAnalyticsLaunchesResponse: + description: Response containing a list of launches. + properties: + data: + description: The launches. + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchData" + type: array + required: + - data + type: object + ProductAnalyticsMonitorAttributes: + description: Attributes of a Product Analytics monitor. + properties: + created_time: + description: Time the monitor was created. + format: date-time + type: string + creator: + $ref: "#/components/schemas/ProductAnalyticsMonitorCreator" + message: + description: Notification message sent when the monitor alerts. + example: Conversion from /a to /b dropped over the last hour + type: string + modified_time: + description: Time the monitor was last modified. + format: date-time + type: string + name: + description: Name of the monitor. + example: Funnel conversion drop + type: string + options: + $ref: "#/components/schemas/ProductAnalyticsMonitorOptions" + org_id: + description: ID of the organization that owns the monitor. + example: 2 + format: int64 + type: integer + priority: + description: Priority of the monitor, from 1 (highest) to 5 (lowest). + format: int32 + maximum: 5 + minimum: 1 + type: integer + query: + description: Monitor query. + example: formula("query").rollup("sum").last("1h") < 1 + type: string + status: + $ref: "#/components/schemas/ProductAnalyticsMonitorStatus" + tags: + description: Monitor tags, as `key:value` strings. + items: + description: A tag in `key:value` format. + type: string + nullable: true + type: array + required: + - org_id + - name + - message + - query + - options + - status + type: object + ProductAnalyticsMonitorCreateAttributes: + description: Attributes of the Product Analytics monitor to create. + properties: + message: + description: Notification message sent when the monitor alerts. It can include `@` notification handles. + example: |- + Conversion from /a to /b dropped over the last hour + + @slack-my-alerts-channel + type: string + name: + description: Name of the monitor. + example: Funnel conversion drop + type: string + options: + $ref: "#/components/schemas/ProductAnalyticsMonitorOptions" + priority: + description: Priority of the monitor, from 1 (highest) to 5 (lowest). + example: 3 + format: int32 + maximum: 5 + minimum: 1 + type: integer + query: + description: |- + Monitor query, for example `formula("query").rollup("sum").last("1h") < 1`. + Define the variables it references in `options.variables`. + example: formula("query").rollup("sum").last("1h") < 1 + type: string + tags: + $ref: "#/components/schemas/ProductAnalyticsMonitorTags" + required: + - name + - message + - query + type: object + ProductAnalyticsMonitorCreateData: + description: Data of the Product Analytics monitor to create. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsMonitorCreateAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsMonitorRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsMonitorCreateRequest: + description: Request to create a Product Analytics monitor. + example: + data: + attributes: + message: |- + Conversion from /a to /b dropped over the last hour + + @slack-my-alerts-channel + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 2 + variables: + - data_source: product_analytics_journey + name: query + search: + expression: node_0->node_1 + filters: + graph_filters: + - name: __dd.time_to_convert + operator: <= + value: 86400000 + join_keys: + primary: "@usr.id" + node_objects: + node_0: + data_source: product_analytics + search: + query: "@type:view @view.name:/a" + node_1: + data_source: product_analytics + search: + query: "@type:view @view.name:/b" + priority: 3 + query: formula("query").rollup("sum").last("1h") < 1 + tags: + chart_id: chart-1 + query_type: funnel + type: pa_monitor_request + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsMonitorCreateData" + required: + - data + type: object + ProductAnalyticsMonitorCreator: + description: The user who created the monitor. + properties: + email: + description: Email of the user. + type: string + handle: + description: Handle of the user. + type: string + id: + description: Numeric ID of the user. + format: int64 + type: integer + name: + description: Name of the user. + type: string + uuid: + description: UUID of the user. + type: string + type: object + ProductAnalyticsMonitorData: + description: A Product Analytics monitor. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsMonitorAttributes" + id: + description: ID of the monitor. + example: "12345" + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsMonitorType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsMonitorListAttributes: + description: A list of Product Analytics monitors. + properties: + monitors: + description: The monitors. + items: + $ref: "#/components/schemas/ProductAnalyticsMonitorListItem" + type: array + total: + description: Total number of monitors that match, across all pages. + example: 1 + format: int64 + type: integer + required: + - monitors + - total + type: object + ProductAnalyticsMonitorListData: + description: Data of a Product Analytics monitor list. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsMonitorListAttributes" + id: + description: ID of the list resource. Always `list`. + example: list + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsMonitorListType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsMonitorListItem: + description: A Product Analytics monitor in a list. + properties: + created_time: + description: Time the monitor was created. + format: date-time + type: string + creator: + $ref: "#/components/schemas/ProductAnalyticsMonitorCreator" + id: + description: ID of the monitor. + example: "12345" + type: string + message: + description: Notification message sent when the monitor alerts. + example: Conversion from /a to /b dropped over the last hour + type: string + modified_time: + description: Time the monitor was last modified. + format: date-time + type: string + name: + description: Name of the monitor. + example: Funnel conversion drop + type: string + options: + $ref: "#/components/schemas/ProductAnalyticsMonitorOptions" + org_id: + description: ID of the organization that owns the monitor. + example: 2 + format: int64 + type: integer + priority: + description: Priority of the monitor, from 1 (highest) to 5 (lowest). + format: int32 + maximum: 5 + minimum: 1 + type: integer + query: + description: Monitor query. + example: formula("query").rollup("sum").last("1h") < 1 + type: string + status: + $ref: "#/components/schemas/ProductAnalyticsMonitorStatus" + tags: + description: Monitor tags, as `key:value` strings. + items: + description: A tag in `key:value` format. + type: string + nullable: true + type: array + required: + - id + - org_id + - name + - message + - query + - options + - status + type: object + ProductAnalyticsMonitorListResponse: + description: Response containing a list of Product Analytics monitors. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsMonitorListData" + required: + - data + type: object + ProductAnalyticsMonitorListType: + default: pa_monitor_list + description: Product Analytics monitor list resource type. + enum: + - pa_monitor_list + example: pa_monitor_list + type: string + x-enum-varnames: + - PA_MONITOR_LIST + ProductAnalyticsMonitorOptions: + description: Options of a Product Analytics monitor. + properties: + chart_uuid: + description: UUID of the chart the monitor was created from. + type: string + metric_selector: + description: Metric of the chart that the monitor evaluates. + type: string + query_index: + description: Index of the chart query that the monitor evaluates. + format: int64 + type: integer + renotify_interval: + description: Number of minutes after the last notification before the monitor notifies again on the current status. `0` means it never notifies again. + format: int64 + type: integer + thresholds: + $ref: "#/components/schemas/ProductAnalyticsMonitorThresholds" + timeframe: + description: Time frame of the chart that the monitor evaluates. + type: string + variables: + description: Query variables referenced by the monitor query. + items: + $ref: "#/components/schemas/ProductAnalyticsMonitorVariable" + type: array + type: object + ProductAnalyticsMonitorRequestType: + default: pa_monitor_request + description: Product Analytics monitor request resource type. + enum: + - pa_monitor_request + example: pa_monitor_request + type: string + x-enum-varnames: + - PA_MONITOR_REQUEST + ProductAnalyticsMonitorResponse: + description: Response containing a Product Analytics monitor. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsMonitorData" + required: + - data + type: object + ProductAnalyticsMonitorStatus: + description: Current alert status of the monitor. `No Data` is returned when the monitor has not been evaluated yet. + enum: + - OK + - Alert + - Warn + - No Data + example: OK + type: string + x-enum-varnames: + - OK + - ALERT + - WARN + - NO_DATA + ProductAnalyticsMonitorTags: + additionalProperties: + description: Tag value. + type: string + description: |- + Monitor tags as key and value pairs. Each pair is stored as a `key:value` tag. + `chart_id` and `dashboard_id` link the monitor to the chart it was created from. `dashboard_id` requires `chart_id`. + example: + chart_id: chart-1 + query_type: funnel + type: object + ProductAnalyticsMonitorThresholds: + description: |- + Alert thresholds of a Product Analytics monitor. + Keep `critical` in sync with the comparison in the monitor query; the query is not derived from these values. + properties: + critical: + description: Value that triggers a critical alert. + example: 1 + format: double + type: number + critical_recovery: + description: Value at which a critical alert recovers. + format: double + type: number + warning: + description: Value that triggers a warning. + example: 2 + format: double + type: number + warning_recovery: + description: Value at which a warning recovers. + format: double + type: number + type: object + ProductAnalyticsMonitorType: + default: pa_monitor + description: Product Analytics monitor resource type. + enum: + - pa_monitor + example: pa_monitor + type: string + x-enum-varnames: + - PA_MONITOR + ProductAnalyticsMonitorUnlinkAttributes: + description: |- + The chart link to remove. It must match the stored link exactly: + `chart_id` alone for a saved chart, or `chart_id` and `dashboard_id` for a dashboard widget. + properties: + chart_id: + description: ID of the chart the monitor is linked to. + example: chart-1 + type: string + dashboard_id: + description: ID of the dashboard the monitor is linked to. + example: dash-1 + type: string + required: + - chart_id + type: object + ProductAnalyticsMonitorUnlinkData: + description: Data of the Product Analytics monitor unlink request. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsMonitorUnlinkAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsMonitorUnlinkRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsMonitorUnlinkRequest: + description: Request to unlink a Product Analytics monitor from its chart. + example: + data: + attributes: + chart_id: chart-1 + dashboard_id: dash-1 + type: pa_monitor_unlink_request + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsMonitorUnlinkData" + required: + - data + type: object + ProductAnalyticsMonitorUnlinkRequestType: + default: pa_monitor_unlink_request + description: Product Analytics monitor unlink request resource type. + enum: + - pa_monitor_unlink_request + example: pa_monitor_unlink_request + type: string + x-enum-varnames: + - PA_MONITOR_UNLINK_REQUEST + ProductAnalyticsMonitorUpdateAttributes: + description: |- + Attributes to update on a Product Analytics monitor. Fields that are not set are left unchanged. + A set `options` or `tags` object replaces the stored value. + properties: + message: + description: Notification message sent when the monitor alerts. + example: Conversion from /a to /b dropped over the last hour + type: string + name: + description: Name of the monitor. + example: Funnel conversion drop + type: string + options: + $ref: "#/components/schemas/ProductAnalyticsMonitorOptions" + priority: + description: Priority of the monitor, from 1 (highest) to 5 (lowest). + format: int32 + maximum: 5 + minimum: 1 + type: integer + query: + description: Monitor query. + example: formula("query").rollup("sum").last("1h") < 1 + type: string + tags: + $ref: "#/components/schemas/ProductAnalyticsMonitorTags" + type: object + ProductAnalyticsMonitorUpdateData: + description: Data of the Product Analytics monitor update. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsMonitorUpdateAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsMonitorRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsMonitorUpdateRequest: + description: Request to update a Product Analytics monitor. + example: + data: + attributes: + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 1.5 + type: pa_monitor_request + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsMonitorUpdateData" + required: + - data + type: object + ProductAnalyticsMonitorVariable: + additionalProperties: {} + description: |- + A query variable of the monitor, referenced by name in the `formula(...)` of the monitor query. + Its shape depends on the `data_source`, for example `product_analytics_journey` for funnels. + example: + data_source: product_analytics_journey + name: query + search: + expression: node_0->node_1 + join_keys: + primary: "@usr.id" + node_objects: + node_0: + data_source: product_analytics + search: + query: "@type:view @view.name:/a" + node_1: + data_source: product_analytics + search: + query: "@type:view @view.name:/b" + type: object ProductAnalyticsOccurrenceFilter: description: Filter for occurrence-based queries. properties: @@ -131562,6 +132692,747 @@ components: required: - securityTrigger type: object + SegmentAttributes: + description: Attributes of a segment. + properties: + created_at: + description: Time the segment was created. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + created_by: + $ref: "#/components/schemas/SegmentUser" + data_query: + $ref: "#/components/schemas/SegmentDataQuery" + description: + description: Description of the segment. + type: string + disabled_at: + description: Time the segment was disabled, if it was. + format: date-time + type: string + disabled_by: + $ref: "#/components/schemas/SegmentUser" + entity: + description: Kind of entity that the segment contains, `user` or `account`. + type: string + materialized_at: + description: Time the segment membership was last computed. + format: date-time + nullable: true + type: string + modified_at: + description: Time the segment was last modified. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + modified_by: + $ref: "#/components/schemas/SegmentUser" + name: + description: Name of the segment. + example: High-value users + type: string + org_id: + description: ID of the organization that owns the segment. + format: int64 + type: integer + row_count: + description: Number of entities in the segment when its membership was last computed. `-1` when the count is not available yet. + format: int64 + type: integer + source: + description: Who created the segment. `0` for a user and `1` for Datadog. + format: int64 + type: integer + tags: + description: Tags of the segment. + items: + description: A tag. + type: string + nullable: true + type: array + type: + description: Kind of segment, derived from its blocks, such as `event_platform`, `user_store`, or `combination`. + type: string + version: + description: Version of the segment, increased on each update. + format: int64 + type: integer + required: + - name + - data_query + - created_at + - modified_at + type: object + SegmentCreateAttributes: + description: Attributes of the segment to create. + properties: + data_query: + $ref: "#/components/schemas/SegmentDataQuery" + description: + description: Description of the segment. + type: string + name: + description: Name of the segment. It must be unique in the organization. + example: High-value users + type: string + tags: + description: Tags of the segment. Tags cannot contain commas. + items: + description: A tag. + type: string + type: array + required: + - name + - data_query + type: object + SegmentCreateData: + description: Data of the segment to create. + properties: + attributes: + $ref: "#/components/schemas/SegmentCreateAttributes" + type: + $ref: "#/components/schemas/SegmentResourceType" + required: + - type + - attributes + type: object + SegmentCreateRequest: + description: Request to create a segment. + example: + data: + attributes: + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + name: viewed_logs + query: "@type:view @view.name:/logs" + to: "0" + description: Users who viewed the logs page in the last 30 days. + name: High-value users + tags: + - team:growth + type: segment + properties: + data: + $ref: "#/components/schemas/SegmentCreateData" + required: + - data + type: object + SegmentData: + description: A segment. + properties: + attributes: + $ref: "#/components/schemas/SegmentAttributes" + id: + description: ID of the segment. + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + type: + $ref: "#/components/schemas/SegmentResourceType" + required: + - id + - type + - attributes + type: object + SegmentDataQuery: + description: |- + Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use `combination` to combine named blocks with a boolean formula such as `A AND NOT B`. + properties: + account_store: + description: Account profile blocks. + items: + $ref: "#/components/schemas/SegmentProfileStoreBlock" + type: array + combination: + description: Boolean formula that combines blocks by name. + example: viewed_logs AND premium + type: string + event_platform: + description: Event blocks. + items: + $ref: "#/components/schemas/SegmentEventPlatformBlock" + type: array + journeys: + description: Funnel blocks. + items: + $ref: "#/components/schemas/SegmentJourneyBlock" + type: array + reference_table: + description: Reference table blocks. + items: + $ref: "#/components/schemas/SegmentReferenceTableBlock" + type: array + retentions: + description: Retention blocks. + items: + $ref: "#/components/schemas/SegmentRetentionBlock" + type: array + static: + description: Uploaded list blocks. + items: + $ref: "#/components/schemas/SegmentStaticBlock" + type: array + templates: + description: Template blocks. + items: + $ref: "#/components/schemas/SegmentTemplateBlock" + type: array + user_store: + description: User profile blocks. + items: + $ref: "#/components/schemas/SegmentProfileStoreBlock" + type: array + type: object + SegmentDeleteAttributes: + description: Attributes of a deleted segment. + properties: + disabled_at: + description: Time the segment was deleted. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + disabled_by: + $ref: "#/components/schemas/SegmentUser" + name: + description: Name of the segment. + example: High-value users + type: string + required: + - name + - disabled_at + type: object + SegmentDeleteData: + description: A deleted segment. + properties: + attributes: + $ref: "#/components/schemas/SegmentDeleteAttributes" + id: + description: ID of the segment. + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + type: + $ref: "#/components/schemas/SegmentDeletedType" + required: + - id + - type + - attributes + type: object + SegmentDeleteResponse: + description: Response returned when a segment is deleted. + properties: + data: + $ref: "#/components/schemas/SegmentDeleteData" + required: + - data + type: object + SegmentDeletedType: + default: deleted_segment + description: Deleted segment resource type. + enum: + - deleted_segment + example: deleted_segment + type: string + x-enum-varnames: + - DELETED_SEGMENT + SegmentEntity: + description: Kind of entity that a segment contains. + enum: + - user + - account + example: user + type: string + x-enum-varnames: + - USER + - ACCOUNT + SegmentEventPlatformBlock: + description: |- + Selects the users or accounts that sent matching RUM or Product Analytics events in a time range. + `from` and `to` are epoch milliseconds, or negative offsets in milliseconds relative to now. `0` means now. + properties: + facet: + description: Facet that identifies the entity, such as `@usr.id`. + example: "@usr.id" + type: string + from: + description: Start of the time range. + example: "-2592000000" + type: string + name: + description: Name of the block, used in `combination`. + example: viewed_logs + type: string + query: + description: Event search query. + example: "@type:view @view.name:/logs" + type: string + to: + description: End of the time range. + example: "0" + type: string + required: + - facet + type: object + SegmentJourneyBlock: + description: Selects the users who converted or dropped off in a funnel. + properties: + conversion_type: + $ref: "#/components/schemas/ProductAnalyticsJourneyConversionType" + exclude_anonymous_traffic: + description: Whether to leave out anonymous users. + type: boolean + from: + description: Start of the time range, in epoch milliseconds. + format: int64 + type: integer + group_by: + description: Group-by definitions of the funnel query. + items: + additionalProperties: {} + description: A group-by definition. + type: object + type: array + name: + description: Name of the block, used in `combination`. + type: string + search: + additionalProperties: {} + description: Funnel search, with the same shape as the `search` of a Product Analytics journey query. + type: object + target: + additionalProperties: {} + description: Funnel step or step range to evaluate. + type: object + to: + description: End of the time range, in epoch milliseconds. + format: int64 + type: integer + type: object + SegmentPreviewAttributes: + description: |- + Segment definition to preview and the columns to return. + Without columns, the response returns the user ID, or the account ID for account segments. + properties: + account_store_columns: + description: Account profile columns to return. + items: + description: Name of an account profile column. + type: string + type: array + data_query: + $ref: "#/components/schemas/SegmentDataQuery" + limit: + description: Maximum number of rows to return, up to 1000. Defaults to 1000. + format: int64 + maximum: 1000 + type: integer + reference_table_columns: + description: Reference table columns to return. + items: + description: Name of a reference table column. + type: string + type: array + user_store_columns: + description: User profile columns to return. + items: + description: Name of a user profile column. + type: string + type: array + required: + - data_query + type: object + SegmentPreviewData: + description: Data of the segment preview request. + properties: + attributes: + $ref: "#/components/schemas/SegmentPreviewAttributes" + type: + $ref: "#/components/schemas/SegmentPreviewRequestType" + required: + - type + - attributes + type: object + SegmentPreviewRequest: + description: Request to preview the members of a segment definition. + example: + data: + attributes: + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + query: "@type:view @view.name:/logs" + to: "0" + limit: 50 + user_store_columns: + - user_id + - user_email + - user_name + type: segment_preview_request + properties: + data: + $ref: "#/components/schemas/SegmentPreviewData" + required: + - data + type: object + SegmentPreviewRequestType: + default: segment_preview_request + description: Segment preview request resource type. + enum: + - segment_preview_request + example: segment_preview_request + type: string + x-enum-varnames: + - SEGMENT_PREVIEW_REQUEST + SegmentPreviewResponse: + description: Response containing a preview of the members of a segment. + properties: + data: + $ref: "#/components/schemas/SegmentPreviewResponseData" + required: + - data + type: object + SegmentPreviewResponseAttributes: + description: Members of the previewed segment. + properties: + hits: + description: Rows of the preview, each as a map of column names to values. + items: + additionalProperties: {} + description: A row of the preview. + type: object + type: array + total_rows: + description: Total number of entities in the segment. + example: 1843 + format: int64 + type: integer + required: + - hits + - total_rows + type: object + SegmentPreviewResponseData: + description: Data of the segment preview response. + properties: + attributes: + $ref: "#/components/schemas/SegmentPreviewResponseAttributes" + id: + description: ID of the preview response. + example: segment_preview_response + type: string + type: + $ref: "#/components/schemas/SegmentPreviewResponseType" + required: + - id + - type + - attributes + type: object + SegmentPreviewResponseType: + default: unified_segment_preview_response + description: Segment preview response resource type. + enum: + - unified_segment_preview_response + example: unified_segment_preview_response + type: string + x-enum-varnames: + - UNIFIED_SEGMENT_PREVIEW_RESPONSE + SegmentProfileStoreBlock: + description: Selects users or accounts by their profile attributes. + properties: + name: + description: Name of the block, used in `combination`. + type: string + query: + description: Profile attribute query. + example: "country:US" + type: string + required: + - query + type: object + SegmentReferenceTableBlock: + description: Selects users or accounts from a reference table. + properties: + columns: + description: Columns to include. + items: + $ref: "#/components/schemas/SegmentReferenceTableColumn" + type: array + filter_query: + description: Query that filters the reference table rows. + type: string + join_condition: + $ref: "#/components/schemas/SegmentReferenceTableJoinCondition" + name: + description: Name of the block, used in `combination`. + type: string + table_name: + description: Name of the reference table. + example: customer_data + type: string + required: + - table_name + - join_condition + type: object + SegmentReferenceTableColumn: + description: A reference table column to include. + properties: + alias: + description: Name to use for the column. + type: string + name: + description: Name of the column in the reference table. + type: string + type: object + SegmentReferenceTableJoinCondition: + description: How reference table rows are matched to entities. + properties: + column_name: + description: Reference table column that holds the entity ID. + example: user_id + type: string + facet: + description: Facet that identifies the entity, such as `@usr.id`. + type: string + required: + - column_name + type: object + SegmentResourceType: + default: segment + description: Segment resource type. + enum: + - segment + example: segment + type: string + x-enum-varnames: + - SEGMENT + SegmentResponse: + description: Response containing a segment. + properties: + data: + $ref: "#/components/schemas/SegmentData" + required: + - data + type: object + SegmentRetentionBlock: + additionalProperties: {} + description: Selects users from a retention query. It has the same fields as a Product Analytics retention query, plus a `name`. + type: object + SegmentSortColumn: + description: Column to sort segments by. + enum: + - name + - description + - created_by + - created_at + - modified_by + - modified_at + - disabled_by + - disabled_at + - uuid + example: modified_at + type: string + x-enum-varnames: + - NAME + - DESCRIPTION + - CREATED_BY + - CREATED_AT + - MODIFIED_BY + - MODIFIED_AT + - DISABLED_BY + - DISABLED_AT + - UUID + SegmentStaticBlock: + description: A fixed list of users uploaded to Datadog. + properties: + id: + description: ID of the uploaded list. + type: string + name: + description: Name of the block, used in `combination`. + type: string + user_count: + description: Number of users in the list. + format: int64 + minimum: 0 + type: integer + type: object + SegmentSummaryAttributes: + description: Attributes of a segment in a list. The segment definition is not included. + properties: + created_at: + description: Time the segment was created. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + created_by: + $ref: "#/components/schemas/SegmentUser" + description: + description: Description of the segment. + type: string + entity: + description: Kind of entity that the segment contains, `user` or `account`. + type: string + modified_at: + description: Time the segment was last modified. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + modified_by: + $ref: "#/components/schemas/SegmentUser" + name: + description: Name of the segment. + example: High-value users + type: string + org_id: + description: ID of the organization that owns the segment. + format: int64 + type: integer + row_count: + description: Number of entities in the segment when its membership was last computed. `-1` when the count is not available yet. + format: int64 + type: integer + source: + description: Who created the segment. `0` for a user and `1` for Datadog. + format: int64 + type: integer + tags: + description: Tags of the segment. + items: + description: A tag. + type: string + nullable: true + type: array + type: + description: Kind of segment, derived from its blocks. + type: string + required: + - name + - created_at + - modified_at + type: object + SegmentSummaryData: + description: A segment in a list. + properties: + attributes: + $ref: "#/components/schemas/SegmentSummaryAttributes" + id: + description: ID of the segment. + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + type: + $ref: "#/components/schemas/SegmentResourceType" + required: + - id + - type + - attributes + type: object + SegmentTemplateBlock: + description: Selects users or accounts with a segment template. + properties: + from: + description: Start of the time range, in epoch milliseconds. + type: string + name: + description: Name of the block, used in `combination`. + type: string + parameters: + additionalProperties: {} + description: Template parameter values, keyed by parameter name. + example: + threshold: 10 + type: object + template_id: + description: ID of the segment template, such as `time-spent-v1`. + example: time-spent-v1 + type: string + to: + description: End of the time range, in epoch milliseconds. + type: string + required: + - template_id + - parameters + type: object + SegmentUpdateAttributes: + description: Attributes to update on a segment. Fields that are not set are left unchanged. + properties: + data_query: + $ref: "#/components/schemas/SegmentDataQuery" + description: + description: Description of the segment. + type: string + name: + description: Name of the segment. It must be unique in the organization. + type: string + tags: + description: Tags of the segment. Replaces the stored tags. + items: + description: A tag. + type: string + type: array + type: object + SegmentUpdateData: + description: Data of the segment update. + properties: + attributes: + $ref: "#/components/schemas/SegmentUpdateAttributes" + id: + description: ID of the segment. It must match the ID in the path. + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + type: + $ref: "#/components/schemas/SegmentResourceType" + required: + - id + - type + - attributes + type: object + SegmentUpdateRequest: + description: Request to update a segment. + example: + data: + attributes: + description: Users who viewed the logs page in the last 7 days. + name: High-value users + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: segment + properties: + data: + $ref: "#/components/schemas/SegmentUpdateData" + required: + - data + type: object + SegmentUser: + description: A Datadog user who created, modified, or disabled a segment. + properties: + handle: + description: Handle of the user. + type: string + icon: + description: URL of the user avatar. + type: string + id: + description: Numeric ID of the user, as a string. + type: string + name: + description: Name of the user. + type: string + uuid: + description: UUID of the user. + type: string + type: object + SegmentsResponse: + description: Response containing a list of segments. + properties: + data: + description: The segments. + items: + $ref: "#/components/schemas/SegmentSummaryData" + type: array + required: + - data + type: object Selectors: description: |- Selectors are used to filter security issues for which notifications should be generated. @@ -229705,6 +231576,882 @@ 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/product-analytics/launches: + get: + description: |- + List the Product Analytics launches of your organization. A launch tracks a feature release with its phase, KPIs, and tracking plan. + Results are sorted by `-created_at` by default. + operationId: ListProductAnalyticsLaunches + parameters: + - description: |- + Comma-separated fields to sort by: `id`, `phase`, `feature_flag_id`, `name`, `application_id`, `description`, + `created_by`, `created_at`, `updated_by`, or `updated_at`. Prefix a field with `-` to sort in descending order. + in: query + name: sort + required: false + schema: + example: -created_at + type: string + - description: Set to `liftoffs` to leave out launches in the `plan` phase. + in: query + name: scope + required: false + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchListScope" + - description: Return only launches in these phases. Repeat the parameter to pass several phases. + explode: true + in: query + name: phase + required: false + schema: + items: + $ref: "#/components/schemas/ProductAnalyticsLaunchPhase" + type: array + style: form + - description: Return only launches of this RUM application UUID. + in: query + name: application_id + required: false + schema: + type: string + - description: Return only launches whose name contains this value, ignoring case. + in: query + name: name + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + name: checkout_promo_codes + org_id: 2 + phase: plan + steps: + tracking_plan: + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + id: 9b1d6c2e-4f3a-4b5c-8d7e-6f5a4b3c2d1e + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchesResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List launches + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - product_analytics_read + - rum_apps_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 Product Analytics launch and its tracking plan. + The tracking plan lists the events and event properties to instrument. Events can only reference properties and KPIs defined in the launch. + operationId: CreateProductAnalyticsLaunch + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + context: Let users apply promo codes at checkout. + description: Promo codes at checkout. + kpis: + - id: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + title: Checkout conversion rate + name: checkout_promo_codes + phase: plan + steps: + tracking_plan: + events: + - kpis: + - 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + name: promo_code_applied + trigger: The user applies a valid promo code. + views: + - /checkout + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: + context: Let users apply promo codes at checkout. + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + description: Promo codes at checkout. + feature_flag_id: + feature_flag_key: + kpis: + - id: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + title: Checkout conversion rate + name: checkout_promo_codes + org_id: 2 + phase: plan + steps: + tracking_plan: + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + events: + - kpis: + - 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + name: promo_code_applied + trigger: The user applies a valid promo code. + views: + - /checkout + id: 9b1d6c2e-4f3a-4b5c-8d7e-6f5a4b3c2d1e + updated_at: + updated_by: + updated_at: + updated_by: + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a launch + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - product_analytics_write + - rum_apps_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/product-analytics/launches/{id}: + delete: + description: Delete a Product Analytics launch and its tracking plan. + operationId: DeleteProductAnalyticsLaunch + parameters: + - $ref: "#/components/parameters/ProductAnalyticsLaunchIDPathParameter" + 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: Delete a launch + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - product_analytics_write + - rum_apps_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/). + get: + description: Get a Product Analytics launch and its tracking plan by UUID. + operationId: GetProductAnalyticsLaunch + parameters: + - $ref: "#/components/parameters/ProductAnalyticsLaunchIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: + context: Let users apply promo codes at checkout. + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + description: Promo codes at checkout. + feature_flag_id: + feature_flag_key: + kpis: + - id: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + title: Checkout conversion rate + name: checkout_promo_codes + org_id: 2 + phase: plan + steps: + tracking_plan: + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + events: + - kpis: + - 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + name: promo_code_applied + trigger: The user applies a valid promo code. + views: + - /checkout + id: 9b1d6c2e-4f3a-4b5c-8d7e-6f5a4b3c2d1e + updated_at: + updated_by: + updated_at: + updated_by: + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchResponse" + 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: Get a launch + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - product_analytics_read + - rum_apps_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 some fields of a Product Analytics launch. Fields that are not set are left unchanged. The `id` in the body must match the one in the path. + Setting `steps.tracking_plan` replaces the whole stored tracking plan, not only the fields you send. + Returns `409` when the launch changed during the update; fetch it again and retry. + operationId: PatchProductAnalyticsLaunch + parameters: + - $ref: "#/components/parameters/ProductAnalyticsLaunchIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + phase: setup + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchPatchRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: + context: Let users apply promo codes at checkout. + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + description: Promo codes at checkout. + feature_flag_id: + feature_flag_key: + kpis: + - id: 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + title: Checkout conversion rate + name: checkout_promo_codes + org_id: 2 + phase: setup + steps: + tracking_plan: + created_at: "2026-11-01T10:00:00Z" + created_by: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + events: + - kpis: + - 7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10 + name: promo_code_applied + trigger: The user applies a valid promo code. + views: + - /checkout + id: 9b1d6c2e-4f3a-4b5c-8d7e-6f5a4b3c2d1e + updated_at: + updated_by: + updated_at: + updated_by: + id: 5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c + type: liftoff + schema: + $ref: "#/components/schemas/ProductAnalyticsLaunchResponse" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a launch + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - product_analytics_write + - rum_apps_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/product-analytics/monitors: + get: + description: |- + List the Product Analytics monitors of your organization, one page at a time. + With `chart_id`, and optionally `dashboard_id`, return every monitor linked to that chart in one response instead. + With `chart_id` alone, monitors created from a dashboard widget are not returned. + Monitors created in the last few seconds may be missing. + operationId: ListProductAnalyticsMonitors + parameters: + - description: Maximum number of monitors per page, from 1 to 1000. Ignored when `chart_id` is set. + in: query + name: page[size] + required: false + schema: + default: 100 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: Page number, starting at 1. Ignored when `chart_id` is set. + in: query + name: page[number] + required: false + schema: + default: 1 + format: int64 + minimum: 1 + type: integer + - description: Return only the monitors linked to this chart. Turns off pagination. + in: query + name: chart_id + required: false + schema: + type: string + - description: Return only the monitors linked to this dashboard. Requires `chart_id`. + in: query + name: dashboard_id + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + monitors: + - id: "12345" + message: Conversion from /a to /b dropped over the last hour + name: Funnel conversion drop + options: + thresholds: + critical: 1 + org_id: 2 + query: formula("query").rollup("sum").last("1h") < 1 + status: OK + tags: + - chart_id:chart-1 + total: 1 + id: list + type: pa_monitor_list + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorListResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List Product Analytics monitors + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - rum_apps_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 Product Analytics monitor that alerts on a Product Analytics query, such as a funnel conversion rate. + Link it to the chart it was created from with the `chart_id` and `dashboard_id` tags. + operationId: CreateProductAnalyticsMonitor + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + message: |- + Conversion from /a to /b dropped over the last hour + + @slack-my-alerts-channel + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 2 + variables: + - data_source: product_analytics_journey + name: query + search: + expression: node_0->node_1 + filters: + graph_filters: + - name: __dd.time_to_convert + operator: "<=" + value: 86400000 + join_keys: + primary: "@usr.id" + node_objects: + node_0: + data_source: product_analytics + search: + query: "@type:view @view.name:/a" + node_1: + data_source: product_analytics + search: + query: "@type:view @view.name:/b" + priority: 3 + query: formula("query").rollup("sum").last("1h") < 1 + tags: + chart_id: chart-1 + query_type: funnel + type: pa_monitor_request + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + message: Conversion from /a to /b dropped over the last hour + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 2 + org_id: 2 + priority: 3 + query: formula("query").rollup("sum").last("1h") < 1 + status: No Data + tags: + - chart_id:chart-1 + - query_type:funnel + id: "12345" + type: pa_monitor + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a Product Analytics monitor + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_write + 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/product-analytics/monitors/{monitor_id}: + delete: + description: Delete a Product Analytics monitor. + operationId: DeleteProductAnalyticsMonitor + parameters: + - $ref: "#/components/parameters/ProductAnalyticsMonitorIDPathParameter" + 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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a Product Analytics monitor + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - rum_apps_write + 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 Product Analytics monitor by its ID. + operationId: GetProductAnalyticsMonitor + parameters: + - $ref: "#/components/parameters/ProductAnalyticsMonitorIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + message: Conversion from /a to /b dropped over the last hour + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 1.5 + org_id: 2 + priority: 3 + query: formula("query").rollup("sum").last("1h") < 1 + status: OK + tags: + - chart_id:chart-1 + - query_type:funnel + id: "12345" + type: pa_monitor + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorResponse" + 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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a Product Analytics monitor + tags: + - Product Analytics + x-permission: + operator: OR + permissions: + - rum_apps_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/). + put: + description: |- + Update a Product Analytics monitor. Fields that are not set are left unchanged, and at least one field must be set. + A set `tags` object replaces the monitor tags, except `chart_id` and `dashboard_id`: they are ignored here. + To remove them, use the unlink endpoint. + operationId: UpdateProductAnalyticsMonitor + parameters: + - $ref: "#/components/parameters/ProductAnalyticsMonitorIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 1.5 + type: pa_monitor_request + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + message: Conversion from /a to /b dropped over the last hour + name: Funnel conversion drop + options: + thresholds: + critical: 1 + warning: 1.5 + org_id: 2 + priority: 3 + query: formula("query").rollup("sum").last("1h") < 1 + status: OK + tags: + - chart_id:chart-1 + - query_type:funnel + id: "12345" + type: pa_monitor + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorResponse" + 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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a Product Analytics monitor + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_write + 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/product-analytics/monitors/{monitor_id}/unlink: + post: + description: |- + Remove the `chart_id` and `dashboard_id` tags from a Product Analytics monitor. The monitor and the rest of its configuration are kept. + The request must name the stored link exactly. A monitor with no link is left unchanged. + operationId: RemoveChartFromProductAnalyticsMonitor + parameters: + - $ref: "#/components/parameters/ProductAnalyticsMonitorIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + chart_id: chart-1 + dashboard_id: dash-1 + type: pa_monitor_unlink_request + schema: + $ref: "#/components/schemas/ProductAnalyticsMonitorUnlinkRequest" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Unlink a Product Analytics monitor from its chart + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_write + 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/product-analytics/retention/grid: post: description: |- @@ -230077,6 +232824,520 @@ 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/product-analytics/segment: + get: + description: |- + List the user and account segments of your organization. Disabled segments are left out unless `filter[disabled]` is `false`. + The list does not include segment definitions; get a segment by ID to see its `data_query`. + operationId: ListProductAnalyticsSegments + parameters: + - description: Return only segments of this entity kind. Other values are ignored. + in: query + name: filter[entity] + required: false + schema: + $ref: "#/components/schemas/SegmentEntity" + - description: |- + Comma-separated segment kinds to return: `event_platform`, `user_store`, `account_store`, `reference_table`, + `static`, `template`, `combination`, `journey`, or `retention`. + in: query + name: filter[type] + required: false + schema: + example: event_platform,combination + type: string + - description: Comma-separated segment IDs to return, up to 1000. + in: query + name: filter[ids] + required: false + schema: + type: string + - description: Set to `false` to include disabled segments. + in: query + name: filter[disabled] + required: false + schema: + default: true + type: boolean + - description: Column to sort by. Other values are ignored. + in: query + name: sort[column] + required: false + schema: + $ref: "#/components/schemas/SegmentSortColumn" + - description: Sort order. Only used with `sort[column]`. + in: query + name: sort[order] + required: false + schema: + $ref: "#/components/schemas/QuerySortOrder" + - description: Maximum number of segments to return. Returns all segments when not set. + in: query + name: limit + required: false + schema: + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-11-01T10:00:00Z" + description: Users who viewed the logs page in the last 30 days. + entity: user + modified_at: "2026-11-01T10:00:00Z" + name: High-value users + org_id: 2 + row_count: 1843 + source: 0 + tags: + - team:growth + type: event_platform + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: segment + schema: + $ref: "#/components/schemas/SegmentsResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List segments + tags: + - Rum Audience Management + x-permission: + operator: OR + permissions: + - rum_apps_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 user or account segment. The `data_query` defines who belongs to the segment. + Segment names must be unique in the organization. + operationId: CreateProductAnalyticsSegment + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + name: viewed_logs + query: "@type:view @view.name:/logs" + to: "0" + description: Users who viewed the logs page in the last 30 days. + name: High-value users + tags: + - team:growth + type: segment + schema: + $ref: "#/components/schemas/SegmentCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-11-01T10:00:00Z" + created_by: + handle: jane.doe@example.com + id: "1234" + name: Jane Doe + uuid: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + name: viewed_logs + query: "@type:view @view.name:/logs" + to: "0" + description: Users who viewed the logs page in the last 30 days. + entity: user + modified_at: "2026-11-01T10:00:00Z" + modified_by: + handle: jane.doe@example.com + id: "1234" + name: Jane Doe + uuid: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + name: High-value users + org_id: 2 + source: 0 + tags: + - team:growth + type: event_platform + version: 1 + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: segment + schema: + $ref: "#/components/schemas/SegmentResponse" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create a segment + tags: + - Rum Audience Management + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_write + - rum_apps_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/product-analytics/segment/{id}: + delete: + description: |- + Delete a segment. Segments created by users are deleted permanently. + Segments created by Datadog, and segments based on an uploaded list, are disabled instead. + operationId: DeleteProductAnalyticsSegment + parameters: + - description: ID of the segment. + in: path + name: id + required: true + schema: + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled_at: "2026-11-01T10:00:00Z" + disabled_by: + handle: jane.doe@example.com + id: "1234" + uuid: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + name: High-value users + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: deleted_segment + schema: + $ref: "#/components/schemas/SegmentDeleteResponse" + 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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete a segment + tags: + - Rum Audience Management + x-permission: + operator: OR + permissions: + - rum_apps_write + - rum_apps_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/). + get: + description: Get a segment by ID, including its definition. + operationId: GetProductAnalyticsSegment + parameters: + - description: ID of the segment. + in: path + name: id + required: true + schema: + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-11-01T10:00:00Z" + created_by: + handle: jane.doe@example.com + id: "1234" + name: Jane Doe + uuid: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + name: viewed_logs + query: "@type:view @view.name:/logs" + to: "0" + description: Users who viewed the logs page in the last 30 days. + entity: user + modified_at: "2026-11-01T10:00:00Z" + modified_by: + handle: jane.doe@example.com + id: "1234" + name: Jane Doe + uuid: 3f2a8b1c-6d4e-4f5a-9b8c-7d6e5f4a3b2c + name: High-value users + org_id: 2 + source: 0 + tags: + - team:growth + type: event_platform + version: 1 + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: segment + schema: + $ref: "#/components/schemas/SegmentResponse" + 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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get a segment + tags: + - Rum Audience Management + x-permission: + operator: OR + permissions: + - rum_apps_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/). + put: + description: |- + Update a segment. Fields that are not set are left unchanged. The `id` in the body must match the one in the path. + The response has no body; get the segment to see the result. + operationId: UpdateProductAnalyticsSegment + parameters: + - description: ID of the segment. + in: path + name: id + required: true + schema: + example: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Users who viewed the logs page in the last 7 days. + name: High-value users + id: 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d + type: segment + schema: + $ref: "#/components/schemas/SegmentUpdateRequest" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Update a segment + tags: + - Rum Audience Management + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_write + - rum_apps_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/product-analytics/segments/preview: + post: + description: |- + Preview the users or accounts that match a segment definition, without saving it. + Returns up to 1000 rows and the total number of matching entities. + operationId: PreviewProductAnalyticsSegment + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + data_query: + event_platform: + - facet: "@usr.id" + from: "-2592000000" + query: "@type:view @view.name:/logs" + to: "0" + limit: 50 + user_store_columns: + - user_id + - user_email + - user_name + type: segment_preview_request + schema: + $ref: "#/components/schemas/SegmentPreviewRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + hits: + - user_email: john.smith@example.com + user_id: "150847" + user_name: John Smith + total_rows: 1843 + id: segment_preview_response + type: unified_segment_preview_response + schema: + $ref: "#/components/schemas/SegmentPreviewResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Preview a segment + tags: + - Rum Audience Management + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_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/product-analytics/users/event_filtered_query: post: description: Query users filtered by both user properties and event platform data diff --git a/examples/v2/product-analytics/CreateProductAnalyticsLaunch.py b/examples/v2/product-analytics/CreateProductAnalyticsLaunch.py new file mode 100644 index 0000000000..56c760ef8d --- /dev/null +++ b/examples/v2/product-analytics/CreateProductAnalyticsLaunch.py @@ -0,0 +1,63 @@ +""" +Create a launch returns "Created" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_launch_create_data import ProductAnalyticsLaunchCreateData +from datadog_api_client.v2.model.product_analytics_launch_create_request import ProductAnalyticsLaunchCreateRequest +from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent +from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI +from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase +from datadog_api_client.v2.model.product_analytics_launch_request_attributes import ( + ProductAnalyticsLaunchRequestAttributes, +) +from datadog_api_client.v2.model.product_analytics_launch_steps_request import ProductAnalyticsLaunchStepsRequest +from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, +) +from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + +body = ProductAnalyticsLaunchCreateRequest( + data=ProductAnalyticsLaunchCreateData( + attributes=ProductAnalyticsLaunchRequestAttributes( + context="Let users apply promo codes at checkout.", + description="Promo codes at checkout.", + kpis=[ + ProductAnalyticsLaunchKPI( + id="7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", + title="Checkout conversion rate", + ), + ], + name="checkout_promo_codes", + phase=ProductAnalyticsLaunchPhase.PLAN, + steps=ProductAnalyticsLaunchStepsRequest( + tracking_plan=ProductAnalyticsLaunchTrackingPlanRequest( + events=[ + ProductAnalyticsLaunchEvent( + kpis=[ + "7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", + ], + name="promo_code_applied", + trigger="The user applies a valid promo code.", + views=[ + "/checkout", + ], + ), + ], + ), + ), + ), + type=ProductAnalyticsLaunchType.LIFTOFF, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["create_product_analytics_launch"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.create_product_analytics_launch(body=body) + + print(response) diff --git a/examples/v2/product-analytics/CreateProductAnalyticsMonitor.py b/examples/v2/product-analytics/CreateProductAnalyticsMonitor.py new file mode 100644 index 0000000000..6b505e898d --- /dev/null +++ b/examples/v2/product-analytics/CreateProductAnalyticsMonitor.py @@ -0,0 +1,58 @@ +""" +Create a Product Analytics monitor returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_monitor_create_attributes import ( + ProductAnalyticsMonitorCreateAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_create_data import ProductAnalyticsMonitorCreateData +from datadog_api_client.v2.model.product_analytics_monitor_create_request import ProductAnalyticsMonitorCreateRequest +from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions +from datadog_api_client.v2.model.product_analytics_monitor_request_type import ProductAnalyticsMonitorRequestType +from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags +from datadog_api_client.v2.model.product_analytics_monitor_thresholds import ProductAnalyticsMonitorThresholds +from datadog_api_client.v2.model.product_analytics_monitor_variable import ProductAnalyticsMonitorVariable + +body = ProductAnalyticsMonitorCreateRequest( + data=ProductAnalyticsMonitorCreateData( + attributes=ProductAnalyticsMonitorCreateAttributes( + message="Conversion from /a to /b dropped over the last hour\n\n@slack-my-alerts-channel", + name="Funnel conversion drop", + options=ProductAnalyticsMonitorOptions( + thresholds=ProductAnalyticsMonitorThresholds( + critical=1.0, + warning=2.0, + ), + variables=[ + ProductAnalyticsMonitorVariable( + [ + ("data_source", "product_analytics_journey"), + ("name", "query"), + ( + "search", + "{'expression': 'node_0->node_1', 'filters': {'graph_filters': [{'name': '__dd.time_to_convert', 'operator': '<=', 'value': 86400000}]}, 'join_keys': {'primary': '@usr.id'}, 'node_objects': {'node_0': {'data_source': 'product_analytics', 'search': {'query': '@type:view @view.name:/a'}}, 'node_1': {'data_source': 'product_analytics', 'search': {'query': '@type:view @view.name:/b'}}}}", + ), + ] + ), + ], + ), + priority=3, + query='formula("query").rollup("sum").last("1h") < 1', + tags=ProductAnalyticsMonitorTags( + chart_id="chart-1", + query_type="funnel", + ), + ), + type=ProductAnalyticsMonitorRequestType.PA_MONITOR_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_product_analytics_monitor"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.create_product_analytics_monitor(body=body) + + print(response) diff --git a/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.py b/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.py new file mode 100644 index 0000000000..a1876aa75c --- /dev/null +++ b/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.py @@ -0,0 +1,16 @@ +""" +Delete a launch returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["delete_product_analytics_launch"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + api_instance.delete_product_analytics_launch( + id="5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", + ) diff --git a/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.py b/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.py new file mode 100644 index 0000000000..5a31412920 --- /dev/null +++ b/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.py @@ -0,0 +1,14 @@ +""" +Delete a Product Analytics monitor returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.unstable_operations["delete_product_analytics_monitor"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + api_instance.delete_product_analytics_monitor( + monitor_id="12345", + ) diff --git a/examples/v2/product-analytics/GetProductAnalyticsLaunch.py b/examples/v2/product-analytics/GetProductAnalyticsLaunch.py new file mode 100644 index 0000000000..5782d21056 --- /dev/null +++ b/examples/v2/product-analytics/GetProductAnalyticsLaunch.py @@ -0,0 +1,18 @@ +""" +Get a launch returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["get_product_analytics_launch"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.get_product_analytics_launch( + id="5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", + ) + + print(response) diff --git a/examples/v2/product-analytics/GetProductAnalyticsMonitor.py b/examples/v2/product-analytics/GetProductAnalyticsMonitor.py new file mode 100644 index 0000000000..2fcc5c4561 --- /dev/null +++ b/examples/v2/product-analytics/GetProductAnalyticsMonitor.py @@ -0,0 +1,16 @@ +""" +Get a Product Analytics monitor returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.unstable_operations["get_product_analytics_monitor"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.get_product_analytics_monitor( + monitor_id="12345", + ) + + print(response) diff --git a/examples/v2/product-analytics/ListProductAnalyticsLaunches.py b/examples/v2/product-analytics/ListProductAnalyticsLaunches.py new file mode 100644 index 0000000000..c2f511d623 --- /dev/null +++ b/examples/v2/product-analytics/ListProductAnalyticsLaunches.py @@ -0,0 +1,16 @@ +""" +List launches returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["list_product_analytics_launches"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.list_product_analytics_launches() + + print(response) diff --git a/examples/v2/product-analytics/ListProductAnalyticsMonitors.py b/examples/v2/product-analytics/ListProductAnalyticsMonitors.py new file mode 100644 index 0000000000..5e908807cb --- /dev/null +++ b/examples/v2/product-analytics/ListProductAnalyticsMonitors.py @@ -0,0 +1,14 @@ +""" +List Product Analytics monitors returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi + +configuration = Configuration() +configuration.unstable_operations["list_product_analytics_monitors"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.list_product_analytics_monitors() + + print(response) diff --git a/examples/v2/product-analytics/PatchProductAnalyticsLaunch.py b/examples/v2/product-analytics/PatchProductAnalyticsLaunch.py new file mode 100644 index 0000000000..b1376d6e73 --- /dev/null +++ b/examples/v2/product-analytics/PatchProductAnalyticsLaunch.py @@ -0,0 +1,31 @@ +""" +Update a launch returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_launch_patch_attributes import ProductAnalyticsLaunchPatchAttributes +from datadog_api_client.v2.model.product_analytics_launch_patch_data import ProductAnalyticsLaunchPatchData +from datadog_api_client.v2.model.product_analytics_launch_patch_request import ProductAnalyticsLaunchPatchRequest +from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase +from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + +body = ProductAnalyticsLaunchPatchRequest( + data=ProductAnalyticsLaunchPatchData( + attributes=ProductAnalyticsLaunchPatchAttributes( + phase=ProductAnalyticsLaunchPhase.SETUP, + ), + id="5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", + type=ProductAnalyticsLaunchType.LIFTOFF, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["patch_product_analytics_launch"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.patch_product_analytics_launch(id="5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", body=body) + + print(response) diff --git a/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.py b/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.py new file mode 100644 index 0000000000..6086d57963 --- /dev/null +++ b/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.py @@ -0,0 +1,30 @@ +""" +Unlink a Product Analytics monitor from its chart returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_monitor_unlink_attributes import ( + ProductAnalyticsMonitorUnlinkAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_unlink_data import ProductAnalyticsMonitorUnlinkData +from datadog_api_client.v2.model.product_analytics_monitor_unlink_request import ProductAnalyticsMonitorUnlinkRequest +from datadog_api_client.v2.model.product_analytics_monitor_unlink_request_type import ( + ProductAnalyticsMonitorUnlinkRequestType, +) + +body = ProductAnalyticsMonitorUnlinkRequest( + data=ProductAnalyticsMonitorUnlinkData( + attributes=ProductAnalyticsMonitorUnlinkAttributes( + chart_id="chart-1", + dashboard_id="dash-1", + ), + type=ProductAnalyticsMonitorUnlinkRequestType.PA_MONITOR_UNLINK_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["remove_chart_from_product_analytics_monitor"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + api_instance.remove_chart_from_product_analytics_monitor(monitor_id="12345", body=body) diff --git a/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.py b/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.py new file mode 100644 index 0000000000..26e49f23cf --- /dev/null +++ b/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.py @@ -0,0 +1,37 @@ +""" +Update a Product Analytics monitor returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi +from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions +from datadog_api_client.v2.model.product_analytics_monitor_request_type import ProductAnalyticsMonitorRequestType +from datadog_api_client.v2.model.product_analytics_monitor_thresholds import ProductAnalyticsMonitorThresholds +from datadog_api_client.v2.model.product_analytics_monitor_update_attributes import ( + ProductAnalyticsMonitorUpdateAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_update_data import ProductAnalyticsMonitorUpdateData +from datadog_api_client.v2.model.product_analytics_monitor_update_request import ProductAnalyticsMonitorUpdateRequest + +body = ProductAnalyticsMonitorUpdateRequest( + data=ProductAnalyticsMonitorUpdateData( + attributes=ProductAnalyticsMonitorUpdateAttributes( + name="Funnel conversion drop", + options=ProductAnalyticsMonitorOptions( + thresholds=ProductAnalyticsMonitorThresholds( + critical=1.0, + warning=1.5, + ), + ), + ), + type=ProductAnalyticsMonitorRequestType.PA_MONITOR_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_product_analytics_monitor"] = True +with ApiClient(configuration) as api_client: + api_instance = ProductAnalyticsApi(api_client) + response = api_instance.update_product_analytics_monitor(monitor_id="12345", body=body) + + print(response) diff --git a/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.py b/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.py new file mode 100644 index 0000000000..85843427e7 --- /dev/null +++ b/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.py @@ -0,0 +1,46 @@ +""" +Create a segment returns "Created" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi +from datadog_api_client.v2.model.segment_create_attributes import SegmentCreateAttributes +from datadog_api_client.v2.model.segment_create_data import SegmentCreateData +from datadog_api_client.v2.model.segment_create_request import SegmentCreateRequest +from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery +from datadog_api_client.v2.model.segment_event_platform_block import SegmentEventPlatformBlock +from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + +body = SegmentCreateRequest( + data=SegmentCreateData( + attributes=SegmentCreateAttributes( + data_query=SegmentDataQuery( + event_platform=[ + SegmentEventPlatformBlock( + facet="@usr.id", + _from="-2592000000", + name="viewed_logs", + query="@type:view @view.name:/logs", + to="0", + ), + ], + ), + description="Users who viewed the logs page in the last 30 days.", + name="High-value users", + tags=[ + "team:growth", + ], + ), + type=SegmentResourceType.SEGMENT, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["create_product_analytics_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + response = api_instance.create_product_analytics_segment(body=body) + + print(response) diff --git a/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.py b/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.py new file mode 100644 index 0000000000..766e8aaf09 --- /dev/null +++ b/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.py @@ -0,0 +1,18 @@ +""" +Delete a segment returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["delete_product_analytics_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + response = api_instance.delete_product_analytics_segment( + id="8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + + print(response) diff --git a/examples/v2/rum-audience-management/GetProductAnalyticsSegment.py b/examples/v2/rum-audience-management/GetProductAnalyticsSegment.py new file mode 100644 index 0000000000..952ada6958 --- /dev/null +++ b/examples/v2/rum-audience-management/GetProductAnalyticsSegment.py @@ -0,0 +1,18 @@ +""" +Get a segment returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["get_product_analytics_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + response = api_instance.get_product_analytics_segment( + id="8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + + print(response) diff --git a/examples/v2/rum-audience-management/ListProductAnalyticsSegments.py b/examples/v2/rum-audience-management/ListProductAnalyticsSegments.py new file mode 100644 index 0000000000..e52da758b0 --- /dev/null +++ b/examples/v2/rum-audience-management/ListProductAnalyticsSegments.py @@ -0,0 +1,16 @@ +""" +List segments returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["list_product_analytics_segments"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + response = api_instance.list_product_analytics_segments() + + print(response) diff --git a/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.py b/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.py new file mode 100644 index 0000000000..7a6d7cf564 --- /dev/null +++ b/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.py @@ -0,0 +1,46 @@ +""" +Preview a segment returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi +from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery +from datadog_api_client.v2.model.segment_event_platform_block import SegmentEventPlatformBlock +from datadog_api_client.v2.model.segment_preview_attributes import SegmentPreviewAttributes +from datadog_api_client.v2.model.segment_preview_data import SegmentPreviewData +from datadog_api_client.v2.model.segment_preview_request import SegmentPreviewRequest +from datadog_api_client.v2.model.segment_preview_request_type import SegmentPreviewRequestType + +body = SegmentPreviewRequest( + data=SegmentPreviewData( + attributes=SegmentPreviewAttributes( + data_query=SegmentDataQuery( + event_platform=[ + SegmentEventPlatformBlock( + facet="@usr.id", + _from="-2592000000", + query="@type:view @view.name:/logs", + to="0", + ), + ], + ), + limit=50, + user_store_columns=[ + "user_id", + "user_email", + "user_name", + ], + ), + type=SegmentPreviewRequestType.SEGMENT_PREVIEW_REQUEST, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["preview_product_analytics_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + response = api_instance.preview_product_analytics_segment(body=body) + + print(response) diff --git a/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.py b/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.py new file mode 100644 index 0000000000..a06188d01b --- /dev/null +++ b/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.py @@ -0,0 +1,29 @@ +""" +Update a segment returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi +from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType +from datadog_api_client.v2.model.segment_update_attributes import SegmentUpdateAttributes +from datadog_api_client.v2.model.segment_update_data import SegmentUpdateData +from datadog_api_client.v2.model.segment_update_request import SegmentUpdateRequest + +body = SegmentUpdateRequest( + data=SegmentUpdateData( + attributes=SegmentUpdateAttributes( + description="Users who viewed the logs page in the last 7 days.", + name="High-value users", + ), + id="8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type=SegmentResourceType.SEGMENT, + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +configuration.unstable_operations["update_product_analytics_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RumAudienceManagementApi(api_client) + api_instance.update_product_analytics_segment(id="8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 7d8f36b32b..a17d280f6e 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -851,6 +851,15 @@ def __init__( "v2.update_org_group_policy": False, "v2.update_org_group_policy_override": False, "v2.list_role_templates": False, + "v2.create_product_analytics_launch": False, + "v2.create_product_analytics_monitor": False, + "v2.delete_product_analytics_launch": False, + "v2.delete_product_analytics_monitor": False, + "v2.get_product_analytics_launch": False, + "v2.get_product_analytics_monitor": False, + "v2.list_product_analytics_launches": False, + "v2.list_product_analytics_monitors": False, + "v2.patch_product_analytics_launch": False, "v2.query_product_analytics_journey_funnel": False, "v2.query_product_analytics_journey_list": False, "v2.query_product_analytics_journey_scalar": False, @@ -861,17 +870,25 @@ def __init__( "v2.query_product_analytics_retention_scalar": False, "v2.query_product_analytics_retention_timeseries": False, "v2.query_product_analytics_sankey": False, + "v2.remove_chart_from_product_analytics_monitor": False, + "v2.update_product_analytics_monitor": False, "v2.create_connection": False, + "v2.create_product_analytics_segment": False, "v2.delete_connection": False, + "v2.delete_product_analytics_segment": False, "v2.delete_user_profile": False, "v2.get_account_facet_info": False, "v2.get_mapping": False, + "v2.get_product_analytics_segment": False, "v2.get_user_facet_info": False, "v2.list_connections": False, + "v2.list_product_analytics_segments": False, + "v2.preview_product_analytics_segment": False, "v2.query_accounts": False, "v2.query_event_filtered_users": False, "v2.query_users": False, "v2.update_connection": False, + "v2.update_product_analytics_segment": False, "v2.list_product_catalog_sk_us": False, "v2.get_pruned_trace_by_id": False, "v2.get_trace_by_id": False, diff --git a/src/datadog_api_client/v2/api/product_analytics_api.py b/src/datadog_api_client/v2/api/product_analytics_api.py index 8c30924126..65c8ee301d 100644 --- a/src/datadog_api_client/v2/api/product_analytics_api.py +++ b/src/datadog_api_client/v2/api/product_analytics_api.py @@ -3,10 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) from datadog_api_client.v2.model.product_analytics_server_side_event_item import ProductAnalyticsServerSideEventItem from datadog_api_client.v2.model.product_analytics_analytics_list_response import ProductAnalyticsAnalyticsListResponse from datadog_api_client.v2.model.product_analytics_analytics_list_request import ProductAnalyticsAnalyticsListRequest @@ -23,6 +27,17 @@ ProductAnalyticsJourneyTimeseriesResponse, ) from datadog_api_client.v2.model.product_analytics_formula_journey_request import ProductAnalyticsFormulaJourneyRequest +from datadog_api_client.v2.model.product_analytics_launches_response import ProductAnalyticsLaunchesResponse +from datadog_api_client.v2.model.product_analytics_launch_list_scope import ProductAnalyticsLaunchListScope +from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase +from datadog_api_client.v2.model.product_analytics_launch_response import ProductAnalyticsLaunchResponse +from datadog_api_client.v2.model.product_analytics_launch_create_request import ProductAnalyticsLaunchCreateRequest +from datadog_api_client.v2.model.product_analytics_launch_patch_request import ProductAnalyticsLaunchPatchRequest +from datadog_api_client.v2.model.product_analytics_monitor_list_response import ProductAnalyticsMonitorListResponse +from datadog_api_client.v2.model.product_analytics_monitor_response import ProductAnalyticsMonitorResponse +from datadog_api_client.v2.model.product_analytics_monitor_create_request import ProductAnalyticsMonitorCreateRequest +from datadog_api_client.v2.model.product_analytics_monitor_update_request import ProductAnalyticsMonitorUpdateRequest +from datadog_api_client.v2.model.product_analytics_monitor_unlink_request import ProductAnalyticsMonitorUnlinkRequest from datadog_api_client.v2.model.product_analytics_retention_grid_response import ProductAnalyticsRetentionGridResponse from datadog_api_client.v2.model.product_analytics_retention_grid_request import ProductAnalyticsRetentionGridRequest from datadog_api_client.v2.model.product_analytics_retention_list_response import ProductAnalyticsRetentionListResponse @@ -49,6 +64,251 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_product_analytics_launch_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsLaunchResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/launches", + "operation_id": "create_product_analytics_launch", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ProductAnalyticsLaunchCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_product_analytics_monitor_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsMonitorResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors", + "operation_id": "create_product_analytics_monitor", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ProductAnalyticsMonitorCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_product_analytics_launch_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/launches/{id}", + "operation_id": "delete_product_analytics_launch", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_product_analytics_monitor_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors/{monitor_id}", + "operation_id": "delete_product_analytics_monitor", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "monitor_id": { + "required": True, + "openapi_types": (str,), + "attribute": "monitor_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_product_analytics_launch_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsLaunchResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/launches/{id}", + "operation_id": "get_product_analytics_launch", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_product_analytics_monitor_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsMonitorResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors/{monitor_id}", + "operation_id": "get_product_analytics_monitor", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "monitor_id": { + "required": True, + "openapi_types": (str,), + "attribute": "monitor_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_product_analytics_launches_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsLaunchesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/launches", + "operation_id": "list_product_analytics_launches", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "scope": { + "openapi_types": (ProductAnalyticsLaunchListScope,), + "attribute": "scope", + "location": "query", + }, + "phase": { + "openapi_types": ([ProductAnalyticsLaunchPhase],), + "attribute": "phase", + "location": "query", + "collection_format": "multi", + }, + "application_id": { + "openapi_types": (str,), + "attribute": "application_id", + "location": "query", + }, + "name": { + "openapi_types": (str,), + "attribute": "name", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_product_analytics_monitors_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsMonitorListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors", + "operation_id": "list_product_analytics_monitors", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "validation": { + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "chart_id": { + "openapi_types": (str,), + "attribute": "chart_id", + "location": "query", + }, + "dashboard_id": { + "openapi_types": (str,), + "attribute": "dashboard_id", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._patch_product_analytics_launch_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsLaunchResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/launches/{id}", + "operation_id": "patch_product_analytics_launch", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ProductAnalyticsLaunchPatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._query_product_analytics_journey_funnel_endpoint = _Endpoint( settings={ "response_type": (ProductAnalyticsJourneyFunnelResponse,), @@ -289,6 +549,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._remove_chart_from_product_analytics_monitor_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors/{monitor_id}/unlink", + "operation_id": "remove_chart_from_product_analytics_monitor", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "monitor_id": { + "required": True, + "openapi_types": (str,), + "attribute": "monitor_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ProductAnalyticsMonitorUnlinkRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._submit_product_analytics_event_endpoint = _Endpoint( settings={ "response_type": (dict,), @@ -355,6 +641,242 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_product_analytics_monitor_endpoint = _Endpoint( + settings={ + "response_type": (ProductAnalyticsMonitorResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/product-analytics/monitors/{monitor_id}", + "operation_id": "update_product_analytics_monitor", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "monitor_id": { + "required": True, + "openapi_types": (str,), + "attribute": "monitor_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ProductAnalyticsMonitorUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_product_analytics_launch( + self, + body: ProductAnalyticsLaunchCreateRequest, + ) -> ProductAnalyticsLaunchResponse: + """Create a launch. + + Create a Product Analytics launch and its tracking plan. + The tracking plan lists the events and event properties to instrument. Events can only reference properties and KPIs defined in the launch. + + :type body: ProductAnalyticsLaunchCreateRequest + :rtype: ProductAnalyticsLaunchResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_product_analytics_launch_endpoint.call_with_http_info(**kwargs) + + def create_product_analytics_monitor( + self, + body: ProductAnalyticsMonitorCreateRequest, + ) -> ProductAnalyticsMonitorResponse: + """Create a Product Analytics monitor. + + Create a Product Analytics monitor that alerts on a Product Analytics query, such as a funnel conversion rate. + Link it to the chart it was created from with the ``chart_id`` and ``dashboard_id`` tags. + + :type body: ProductAnalyticsMonitorCreateRequest + :rtype: ProductAnalyticsMonitorResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_product_analytics_monitor_endpoint.call_with_http_info(**kwargs) + + def delete_product_analytics_launch( + self, + id: str, + ) -> None: + """Delete a launch. + + Delete a Product Analytics launch and its tracking plan. + + :param id: UUID of the launch. + :type id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._delete_product_analytics_launch_endpoint.call_with_http_info(**kwargs) + + def delete_product_analytics_monitor( + self, + monitor_id: str, + ) -> None: + """Delete a Product Analytics monitor. + + Delete a Product Analytics monitor. + + :param monitor_id: ID of the monitor. It is a numeric ID. + :type monitor_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["monitor_id"] = monitor_id + + return self._delete_product_analytics_monitor_endpoint.call_with_http_info(**kwargs) + + def get_product_analytics_launch( + self, + id: str, + ) -> ProductAnalyticsLaunchResponse: + """Get a launch. + + Get a Product Analytics launch and its tracking plan by UUID. + + :param id: UUID of the launch. + :type id: str + :rtype: ProductAnalyticsLaunchResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_product_analytics_launch_endpoint.call_with_http_info(**kwargs) + + def get_product_analytics_monitor( + self, + monitor_id: str, + ) -> ProductAnalyticsMonitorResponse: + """Get a Product Analytics monitor. + + Get a Product Analytics monitor by its ID. + + :param monitor_id: ID of the monitor. It is a numeric ID. + :type monitor_id: str + :rtype: ProductAnalyticsMonitorResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["monitor_id"] = monitor_id + + return self._get_product_analytics_monitor_endpoint.call_with_http_info(**kwargs) + + def list_product_analytics_launches( + self, + *, + sort: Union[str, UnsetType] = unset, + scope: Union[ProductAnalyticsLaunchListScope, UnsetType] = unset, + phase: Union[List[ProductAnalyticsLaunchPhase], UnsetType] = unset, + application_id: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + ) -> ProductAnalyticsLaunchesResponse: + """List launches. + + List the Product Analytics launches of your organization. A launch tracks a feature release with its phase, KPIs, and tracking plan. + Results are sorted by ``-created_at`` by default. + + :param sort: Comma-separated fields to sort by: ``id`` , ``phase`` , ``feature_flag_id`` , ``name`` , ``application_id`` , ``description`` , + ``created_by`` , ``created_at`` , ``updated_by`` , or ``updated_at``. Prefix a field with ``-`` to sort in descending order. + :type sort: str, optional + :param scope: Set to ``liftoffs`` to leave out launches in the ``plan`` phase. + :type scope: ProductAnalyticsLaunchListScope, optional + :param phase: Return only launches in these phases. Repeat the parameter to pass several phases. + :type phase: [ProductAnalyticsLaunchPhase], optional + :param application_id: Return only launches of this RUM application UUID. + :type application_id: str, optional + :param name: Return only launches whose name contains this value, ignoring case. + :type name: str, optional + :rtype: ProductAnalyticsLaunchesResponse + """ + kwargs: Dict[str, Any] = {} + if sort is not unset: + kwargs["sort"] = sort + + if scope is not unset: + kwargs["scope"] = scope + + if phase is not unset: + kwargs["phase"] = phase + + if application_id is not unset: + kwargs["application_id"] = application_id + + if name is not unset: + kwargs["name"] = name + + return self._list_product_analytics_launches_endpoint.call_with_http_info(**kwargs) + + def list_product_analytics_monitors( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + chart_id: Union[str, UnsetType] = unset, + dashboard_id: Union[str, UnsetType] = unset, + ) -> ProductAnalyticsMonitorListResponse: + """List Product Analytics monitors. + + List the Product Analytics monitors of your organization, one page at a time. + With ``chart_id`` , and optionally ``dashboard_id`` , return every monitor linked to that chart in one response instead. + With ``chart_id`` alone, monitors created from a dashboard widget are not returned. + Monitors created in the last few seconds may be missing. + + :param page_size: Maximum number of monitors per page, from 1 to 1000. Ignored when ``chart_id`` is set. + :type page_size: int, optional + :param page_number: Page number, starting at 1. Ignored when ``chart_id`` is set. + :type page_number: int, optional + :param chart_id: Return only the monitors linked to this chart. Turns off pagination. + :type chart_id: str, optional + :param dashboard_id: Return only the monitors linked to this dashboard. Requires ``chart_id``. + :type dashboard_id: str, optional + :rtype: ProductAnalyticsMonitorListResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if chart_id is not unset: + kwargs["chart_id"] = chart_id + + if dashboard_id is not unset: + kwargs["dashboard_id"] = dashboard_id + + return self._list_product_analytics_monitors_endpoint.call_with_http_info(**kwargs) + + def patch_product_analytics_launch( + self, + id: str, + body: ProductAnalyticsLaunchPatchRequest, + ) -> ProductAnalyticsLaunchResponse: + """Update a launch. + + Update some fields of a Product Analytics launch. Fields that are not set are left unchanged. The ``id`` in the body must match the one in the path. + Setting ``steps.tracking_plan`` replaces the whole stored tracking plan, not only the fields you send. + Returns ``409`` when the launch changed during the update; fetch it again and retry. + + :param id: UUID of the launch. + :type id: str + :type body: ProductAnalyticsLaunchPatchRequest + :rtype: ProductAnalyticsLaunchResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._patch_product_analytics_launch_endpoint.call_with_http_info(**kwargs) + def query_product_analytics_journey_funnel( self, body: ProductAnalyticsJourneyFunnelRequest, @@ -567,6 +1089,28 @@ def query_product_analytics_timeseries( return self._query_product_analytics_timeseries_endpoint.call_with_http_info(**kwargs) + def remove_chart_from_product_analytics_monitor( + self, + monitor_id: str, + body: ProductAnalyticsMonitorUnlinkRequest, + ) -> None: + """Unlink a Product Analytics monitor from its chart. + + Remove the ``chart_id`` and ``dashboard_id`` tags from a Product Analytics monitor. The monitor and the rest of its configuration are kept. + The request must name the stored link exactly. A monitor with no link is left unchanged. + + :param monitor_id: ID of the monitor. It is a numeric ID. + :type monitor_id: str + :type body: ProductAnalyticsMonitorUnlinkRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["monitor_id"] = monitor_id + + kwargs["body"] = body + + return self._remove_chart_from_product_analytics_monitor_endpoint.call_with_http_info(**kwargs) + def submit_product_analytics_event( self, body: ProductAnalyticsServerSideEventItem, @@ -613,3 +1157,26 @@ def submit_product_analytics_event( kwargs["body"] = body return self._submit_product_analytics_event_endpoint.call_with_http_info(**kwargs) + + def update_product_analytics_monitor( + self, + monitor_id: str, + body: ProductAnalyticsMonitorUpdateRequest, + ) -> ProductAnalyticsMonitorResponse: + """Update a Product Analytics monitor. + + Update a Product Analytics monitor. Fields that are not set are left unchanged, and at least one field must be set. + A set ``tags`` object replaces the monitor tags, except ``chart_id`` and ``dashboard_id`` : they are ignored here. + To remove them, use the unlink endpoint. + + :param monitor_id: ID of the monitor. It is a numeric ID. + :type monitor_id: str + :type body: ProductAnalyticsMonitorUpdateRequest + :rtype: ProductAnalyticsMonitorResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["monitor_id"] = monitor_id + + kwargs["body"] = body + + return self._update_product_analytics_monitor_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/rum_audience_management_api.py b/src/datadog_api_client/v2/api/rum_audience_management_api.py index 71e3537774..c6d7cb092e 100644 --- a/src/datadog_api_client/v2/api/rum_audience_management_api.py +++ b/src/datadog_api_client/v2/api/rum_audience_management_api.py @@ -3,14 +3,28 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) from datadog_api_client.v2.model.facet_info_response import FacetInfoResponse from datadog_api_client.v2.model.facet_info_request import FacetInfoRequest from datadog_api_client.v2.model.query_response import QueryResponse from datadog_api_client.v2.model.query_account_request import QueryAccountRequest +from datadog_api_client.v2.model.segments_response import SegmentsResponse +from datadog_api_client.v2.model.segment_entity import SegmentEntity +from datadog_api_client.v2.model.segment_sort_column import SegmentSortColumn +from datadog_api_client.v2.model.query_sort_order import QuerySortOrder +from datadog_api_client.v2.model.segment_response import SegmentResponse +from datadog_api_client.v2.model.segment_create_request import SegmentCreateRequest +from datadog_api_client.v2.model.segment_delete_response import SegmentDeleteResponse +from datadog_api_client.v2.model.segment_update_request import SegmentUpdateRequest +from datadog_api_client.v2.model.segment_preview_response import SegmentPreviewResponse +from datadog_api_client.v2.model.segment_preview_request import SegmentPreviewRequest from datadog_api_client.v2.model.query_event_filtered_users_request import QueryEventFilteredUsersRequest from datadog_api_client.v2.model.query_users_request import QueryUsersRequest from datadog_api_client.v2.model.get_mapping_response import GetMappingResponse @@ -55,6 +69,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_product_analytics_segment_endpoint = _Endpoint( + settings={ + "response_type": (SegmentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segment", + "operation_id": "create_product_analytics_segment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (SegmentCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_connection_endpoint = _Endpoint( settings={ "response_type": None, @@ -84,6 +118,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_product_analytics_segment_endpoint = _Endpoint( + settings={ + "response_type": (SegmentDeleteResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segment/{id}", + "operation_id": "delete_product_analytics_segment", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._delete_user_profile_endpoint = _Endpoint( settings={ "response_type": None, @@ -150,6 +207,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_product_analytics_segment_endpoint = _Endpoint( + settings={ + "response_type": (SegmentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segment/{id}", + "operation_id": "get_product_analytics_segment", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_user_facet_info_endpoint = _Endpoint( settings={ "response_type": (FacetInfoResponse,), @@ -193,6 +273,81 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_product_analytics_segments_endpoint = _Endpoint( + settings={ + "response_type": (SegmentsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segment", + "operation_id": "list_product_analytics_segments", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_entity": { + "openapi_types": (SegmentEntity,), + "attribute": "filter[entity]", + "location": "query", + }, + "filter_type": { + "openapi_types": (str,), + "attribute": "filter[type]", + "location": "query", + }, + "filter_ids": { + "openapi_types": (str,), + "attribute": "filter[ids]", + "location": "query", + }, + "filter_disabled": { + "openapi_types": (bool,), + "attribute": "filter[disabled]", + "location": "query", + }, + "sort_column": { + "openapi_types": (SegmentSortColumn,), + "attribute": "sort[column]", + "location": "query", + }, + "sort_order": { + "openapi_types": (QuerySortOrder,), + "attribute": "sort[order]", + "location": "query", + }, + "limit": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._preview_product_analytics_segment_endpoint = _Endpoint( + settings={ + "response_type": (SegmentPreviewResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segments/preview", + "operation_id": "preview_product_analytics_segment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (SegmentPreviewRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._query_accounts_endpoint = _Endpoint( settings={ "response_type": (QueryResponse,), @@ -279,6 +434,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_product_analytics_segment_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/product-analytics/segment/{id}", + "operation_id": "update_product_analytics_segment", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SegmentUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def create_connection( self, entity: str, @@ -300,6 +481,23 @@ def create_connection( return self._create_connection_endpoint.call_with_http_info(**kwargs) + def create_product_analytics_segment( + self, + body: SegmentCreateRequest, + ) -> SegmentResponse: + """Create a segment. + + Create a user or account segment. The ``data_query`` defines who belongs to the segment. + Segment names must be unique in the organization. + + :type body: SegmentCreateRequest + :rtype: SegmentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_product_analytics_segment_endpoint.call_with_http_info(**kwargs) + def delete_connection( self, id: str, @@ -322,6 +520,24 @@ def delete_connection( return self._delete_connection_endpoint.call_with_http_info(**kwargs) + def delete_product_analytics_segment( + self, + id: str, + ) -> SegmentDeleteResponse: + """Delete a segment. + + Delete a segment. Segments created by users are deleted permanently. + Segments created by Datadog, and segments based on an uploaded list, are disabled instead. + + :param id: ID of the segment. + :type id: str + :rtype: SegmentDeleteResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._delete_product_analytics_segment_endpoint.call_with_http_info(**kwargs) + def delete_user_profile( self, user_id: str, @@ -374,6 +590,23 @@ def get_mapping( return self._get_mapping_endpoint.call_with_http_info(**kwargs) + def get_product_analytics_segment( + self, + id: str, + ) -> SegmentResponse: + """Get a segment. + + Get a segment by ID, including its definition. + + :param id: ID of the segment. + :type id: str + :rtype: SegmentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_product_analytics_segment_endpoint.call_with_http_info(**kwargs) + def get_user_facet_info( self, body: FacetInfoRequest, @@ -407,6 +640,80 @@ def list_connections( return self._list_connections_endpoint.call_with_http_info(**kwargs) + def list_product_analytics_segments( + self, + *, + filter_entity: Union[SegmentEntity, UnsetType] = unset, + filter_type: Union[str, UnsetType] = unset, + filter_ids: Union[str, UnsetType] = unset, + filter_disabled: Union[bool, UnsetType] = unset, + sort_column: Union[SegmentSortColumn, UnsetType] = unset, + sort_order: Union[QuerySortOrder, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + ) -> SegmentsResponse: + """List segments. + + List the user and account segments of your organization. Disabled segments are left out unless ``filter[disabled]`` is ``false``. + The list does not include segment definitions; get a segment by ID to see its ``data_query``. + + :param filter_entity: Return only segments of this entity kind. Other values are ignored. + :type filter_entity: SegmentEntity, optional + :param filter_type: Comma-separated segment kinds to return: ``event_platform`` , ``user_store`` , ``account_store`` , ``reference_table`` , + ``static`` , ``template`` , ``combination`` , ``journey`` , or ``retention``. + :type filter_type: str, optional + :param filter_ids: Comma-separated segment IDs to return, up to 1000. + :type filter_ids: str, optional + :param filter_disabled: Set to ``false`` to include disabled segments. + :type filter_disabled: bool, optional + :param sort_column: Column to sort by. Other values are ignored. + :type sort_column: SegmentSortColumn, optional + :param sort_order: Sort order. Only used with ``sort[column]``. + :type sort_order: QuerySortOrder, optional + :param limit: Maximum number of segments to return. Returns all segments when not set. + :type limit: int, optional + :rtype: SegmentsResponse + """ + kwargs: Dict[str, Any] = {} + if filter_entity is not unset: + kwargs["filter_entity"] = filter_entity + + if filter_type is not unset: + kwargs["filter_type"] = filter_type + + if filter_ids is not unset: + kwargs["filter_ids"] = filter_ids + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if sort_column is not unset: + kwargs["sort_column"] = sort_column + + if sort_order is not unset: + kwargs["sort_order"] = sort_order + + if limit is not unset: + kwargs["limit"] = limit + + return self._list_product_analytics_segments_endpoint.call_with_http_info(**kwargs) + + def preview_product_analytics_segment( + self, + body: SegmentPreviewRequest, + ) -> SegmentPreviewResponse: + """Preview a segment. + + Preview the users or accounts that match a segment definition, without saving it. + Returns up to 1000 rows and the total number of matching entities. + + :type body: SegmentPreviewRequest + :rtype: SegmentPreviewResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._preview_product_analytics_segment_endpoint.call_with_http_info(**kwargs) + def query_accounts( self, body: QueryAccountRequest, @@ -475,3 +782,25 @@ def update_connection( kwargs["body"] = body return self._update_connection_endpoint.call_with_http_info(**kwargs) + + def update_product_analytics_segment( + self, + id: str, + body: SegmentUpdateRequest, + ) -> None: + """Update a segment. + + Update a segment. Fields that are not set are left unchanged. The ``id`` in the body must match the one in the path. + The response has no body; get the segment to see the result. + + :param id: ID of the segment. + :type id: str + :type body: SegmentUpdateRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._update_product_analytics_segment_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_attributes.py b/src/datadog_api_client/v2/model/product_analytics_launch_attributes.py new file mode 100644 index 0000000000..e6750f8764 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_attributes.py @@ -0,0 +1,160 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_steps import ProductAnalyticsLaunchSteps + + +class ProductAnalyticsLaunchAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_steps import ProductAnalyticsLaunchSteps + + return { + "application_id": (str, none_type), + "context": (str, none_type), + "created_at": (datetime,), + "created_by": (str,), + "description": (str, none_type), + "feature_flag_id": (str, none_type), + "feature_flag_key": (str, none_type), + "kpis": ([ProductAnalyticsLaunchKPI], none_type), + "name": (str,), + "org_id": (int,), + "phase": (ProductAnalyticsLaunchPhase,), + "repository_id": (str,), + "steps": (ProductAnalyticsLaunchSteps,), + "updated_at": (datetime, none_type), + "updated_by": (str, none_type), + } + + attribute_map = { + "application_id": "application_id", + "context": "context", + "created_at": "created_at", + "created_by": "created_by", + "description": "description", + "feature_flag_id": "feature_flag_id", + "feature_flag_key": "feature_flag_key", + "kpis": "kpis", + "name": "name", + "org_id": "org_id", + "phase": "phase", + "repository_id": "repository_id", + "steps": "steps", + "updated_at": "updated_at", + "updated_by": "updated_by", + } + + def __init__( + self_, + created_at: datetime, + created_by: str, + name: str, + org_id: int, + phase: ProductAnalyticsLaunchPhase, + steps: ProductAnalyticsLaunchSteps, + application_id: Union[str, none_type, UnsetType] = unset, + context: Union[str, none_type, UnsetType] = unset, + description: Union[str, none_type, UnsetType] = unset, + feature_flag_id: Union[str, none_type, UnsetType] = unset, + feature_flag_key: Union[str, none_type, UnsetType] = unset, + kpis: Union[List[ProductAnalyticsLaunchKPI], none_type, UnsetType] = unset, + repository_id: Union[str, UnsetType] = unset, + updated_at: Union[datetime, none_type, UnsetType] = unset, + updated_by: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a launch. + + :param application_id: UUID of the RUM application that the launch belongs to. + :type application_id: str, none_type, optional + + :param context: Context of the feature being launched. + :type context: str, none_type, optional + + :param created_at: Time the launch was created. + :type created_at: datetime + + :param created_by: UUID of the user who created the launch. + :type created_by: str + + :param description: Description of the feature being launched. + :type description: str, none_type, optional + + :param feature_flag_id: UUID of the Datadog feature flag that gates the launch. + :type feature_flag_id: str, none_type, optional + + :param feature_flag_key: Key of a feature flag managed outside Datadog. + :type feature_flag_key: str, none_type, optional + + :param kpis: KPIs that the launch is meant to move. + :type kpis: [ProductAnalyticsLaunchKPI], none_type, optional + + :param name: Name of the launch. + :type name: str + + :param org_id: ID of the organization that owns the launch. + :type org_id: int + + :param phase: Lifecycle phase of a launch. A new launch starts in ``plan`` or ``setup`` , and defaults to ``plan``. + Allowed changes: ``plan`` to ``setup`` , ``setup`` to ``ready`` , ``ready`` to ``setup`` or ``launched`` , and ``launched`` to ``ready``. + :type phase: ProductAnalyticsLaunchPhase + + :param repository_id: ID of the code repository that implements the feature. + :type repository_id: str, optional + + :param steps: Steps of the launch. + :type steps: ProductAnalyticsLaunchSteps + + :param updated_at: Time the launch was last updated. + :type updated_at: datetime, none_type, optional + + :param updated_by: UUID of the user who last updated the launch. + :type updated_by: str, none_type, optional + """ + if application_id is not unset: + kwargs["application_id"] = application_id + if context is not unset: + kwargs["context"] = context + if description is not unset: + kwargs["description"] = description + if feature_flag_id is not unset: + kwargs["feature_flag_id"] = feature_flag_id + if feature_flag_key is not unset: + kwargs["feature_flag_key"] = feature_flag_key + if kpis is not unset: + kwargs["kpis"] = kpis + if repository_id is not unset: + kwargs["repository_id"] = repository_id + if updated_at is not unset: + kwargs["updated_at"] = updated_at + if updated_by is not unset: + kwargs["updated_by"] = updated_by + super().__init__(kwargs) + + self_.created_at = created_at + self_.created_by = created_by + self_.name = name + self_.org_id = org_id + self_.phase = phase + self_.steps = steps diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_code_analysis.py b/src/datadog_api_client/v2/model/product_analytics_launch_code_analysis.py new file mode 100644 index 0000000000..da305843cd --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_code_analysis.py @@ -0,0 +1,69 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_event_finding import ProductAnalyticsLaunchEventFinding + + +class ProductAnalyticsLaunchCodeAnalysis(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_event_finding import ( + ProductAnalyticsLaunchEventFinding, + ) + + return { + "analyzed_at": (datetime,), + "events": ([ProductAnalyticsLaunchEventFinding],), + "revision": (str,), + } + + attribute_map = { + "analyzed_at": "analyzed_at", + "events": "events", + "revision": "revision", + } + read_only_vars = { + "analyzed_at", + } + + def __init__( + self_, + analyzed_at: Union[datetime, UnsetType] = unset, + events: Union[List[ProductAnalyticsLaunchEventFinding], UnsetType] = unset, + revision: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Latest inspection of the repository for the tracking plan instrumentation. A new analysis replaces the stored one. + Events and properties that it does not list are not verified. + + :param analyzed_at: Time of the analysis. Set by the server. + :type analyzed_at: datetime, optional + + :param events: Results for the events of the tracking plan. List each event once. + :type events: [ProductAnalyticsLaunchEventFinding], optional + + :param revision: Code revision that was inspected, such as a commit SHA. + :type revision: str, optional + """ + if analyzed_at is not unset: + kwargs["analyzed_at"] = analyzed_at + if events is not unset: + kwargs["events"] = events + if revision is not unset: + kwargs["revision"] = revision + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_code_status.py b/src/datadog_api_client/v2/model/product_analytics_launch_code_status.py new file mode 100644 index 0000000000..da15001bae --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_code_status.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsLaunchCodeStatus(ModelSimple): + """ + Whether the inspected code sends the event, or attaches the property to the event. + + :param value: Must be one of ["found", "not_found"]. + :type value: str + """ + + allowed_values = { + "found", + "not_found", + } + FOUND: ClassVar["ProductAnalyticsLaunchCodeStatus"] + NOT_FOUND: ClassVar["ProductAnalyticsLaunchCodeStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsLaunchCodeStatus.FOUND = ProductAnalyticsLaunchCodeStatus("found") +ProductAnalyticsLaunchCodeStatus.NOT_FOUND = ProductAnalyticsLaunchCodeStatus("not_found") diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_create_data.py b/src/datadog_api_client/v2/model/product_analytics_launch_create_data.py new file mode 100644 index 0000000000..26ea189981 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_create_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_request_attributes import ( + ProductAnalyticsLaunchRequestAttributes, + ) + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + +class ProductAnalyticsLaunchCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_request_attributes import ( + ProductAnalyticsLaunchRequestAttributes, + ) + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + return { + "attributes": (ProductAnalyticsLaunchRequestAttributes,), + "type": (ProductAnalyticsLaunchType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsLaunchRequestAttributes, type: ProductAnalyticsLaunchType, **kwargs + ): + """ + Data of the launch to create. + + :param attributes: Attributes of a launch to create or replace. + :type attributes: ProductAnalyticsLaunchRequestAttributes + + :param type: Launch resource type. + :type type: ProductAnalyticsLaunchType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_create_request.py b/src/datadog_api_client/v2/model/product_analytics_launch_create_request.py new file mode 100644 index 0000000000..c506534f3f --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_create_data import ProductAnalyticsLaunchCreateData + + +class ProductAnalyticsLaunchCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_create_data import ProductAnalyticsLaunchCreateData + + return { + "data": (ProductAnalyticsLaunchCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsLaunchCreateData, **kwargs): + """ + Request to create a launch. + + :param data: Data of the launch to create. + :type data: ProductAnalyticsLaunchCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_dashboard_step.py b/src/datadog_api_client/v2/model/product_analytics_launch_dashboard_step.py new file mode 100644 index 0000000000..35cfb539d9 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_dashboard_step.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class ProductAnalyticsLaunchDashboardStep(ModelNormal): + @cached_property + def openapi_types(_): + return { + "dashboard_id": (str, none_type), + } + + attribute_map = { + "dashboard_id": "dashboard_id", + } + + def __init__(self_, dashboard_id: Union[str, none_type, UnsetType] = unset, **kwargs): + """ + Dashboard linked to the launch. + + :param dashboard_id: ID of the linked dashboard. + :type dashboard_id: str, none_type, optional + """ + if dashboard_id is not unset: + kwargs["dashboard_id"] = dashboard_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_data.py b/src/datadog_api_client/v2/model/product_analytics_launch_data.py new file mode 100644 index 0000000000..4c343a9b95 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_attributes import ProductAnalyticsLaunchAttributes + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + +class ProductAnalyticsLaunchData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_attributes import ProductAnalyticsLaunchAttributes + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + return { + "attributes": (ProductAnalyticsLaunchAttributes,), + "id": (str,), + "type": (ProductAnalyticsLaunchType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsLaunchAttributes, id: str, type: ProductAnalyticsLaunchType, **kwargs + ): + """ + A launch. + + :param attributes: Attributes of a launch. + :type attributes: ProductAnalyticsLaunchAttributes + + :param id: UUID of the launch. + :type id: str + + :param type: Launch resource type. + :type type: ProductAnalyticsLaunchType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_event.py b/src/datadog_api_client/v2/model/product_analytics_launch_event.py new file mode 100644 index 0000000000..f7c91725a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_event.py @@ -0,0 +1,88 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_event_property import ProductAnalyticsLaunchEventProperty + + +class ProductAnalyticsLaunchEvent(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_event_property import ( + ProductAnalyticsLaunchEventProperty, + ) + + return { + "description": (str,), + "kpis": ([str],), + "name": (str,), + "properties": ([ProductAnalyticsLaunchEventProperty],), + "trigger": (str,), + "views": ([str],), + } + + attribute_map = { + "description": "description", + "kpis": "kpis", + "name": "name", + "properties": "properties", + "trigger": "trigger", + "views": "views", + } + + def __init__( + self_, + name: str, + description: Union[str, UnsetType] = unset, + kpis: Union[List[str], UnsetType] = unset, + properties: Union[List[ProductAnalyticsLaunchEventProperty], UnsetType] = unset, + trigger: Union[str, UnsetType] = unset, + views: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + An event to instrument for the launch. + + :param description: What the event records. + :type description: str, optional + + :param kpis: IDs of the launch KPIs that the event measures. + :type kpis: [str], optional + + :param name: Name of the event, unique within the tracking plan. + :type name: str + + :param properties: Properties that the event carries. + :type properties: [ProductAnalyticsLaunchEventProperty], optional + + :param trigger: What causes the event to be sent. + :type trigger: str, optional + + :param views: Views where the event is sent. Each value must be unique and not blank. + :type views: [str], optional + """ + if description is not unset: + kwargs["description"] = description + if kpis is not unset: + kwargs["kpis"] = kpis + if properties is not unset: + kwargs["properties"] = properties + if trigger is not unset: + kwargs["trigger"] = trigger + if views is not unset: + kwargs["views"] = views + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_event_finding.py b/src/datadog_api_client/v2/model/product_analytics_launch_event_finding.py new file mode 100644 index 0000000000..09351a34dc --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_event_finding.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_property_finding import ( + ProductAnalyticsLaunchPropertyFinding, + ) + from datadog_api_client.v2.model.product_analytics_launch_code_status import ProductAnalyticsLaunchCodeStatus + + +class ProductAnalyticsLaunchEventFinding(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_property_finding import ( + ProductAnalyticsLaunchPropertyFinding, + ) + from datadog_api_client.v2.model.product_analytics_launch_code_status import ProductAnalyticsLaunchCodeStatus + + return { + "name": (str,), + "properties": ([ProductAnalyticsLaunchPropertyFinding],), + "status": (ProductAnalyticsLaunchCodeStatus,), + } + + attribute_map = { + "name": "name", + "properties": "properties", + "status": "status", + } + + def __init__( + self_, + name: str, + status: ProductAnalyticsLaunchCodeStatus, + properties: Union[List[ProductAnalyticsLaunchPropertyFinding], UnsetType] = unset, + **kwargs, + ): + """ + Code analysis result for an event of the tracking plan. + + :param name: Name of the event in the tracking plan. + :type name: str + + :param properties: Results for the properties of the event. Only allowed when the event is ``found``. + :type properties: [ProductAnalyticsLaunchPropertyFinding], optional + + :param status: Whether the inspected code sends the event, or attaches the property to the event. + :type status: ProductAnalyticsLaunchCodeStatus + """ + if properties is not unset: + kwargs["properties"] = properties + super().__init__(kwargs) + + self_.name = name + self_.status = status diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_event_property.py b/src/datadog_api_client/v2/model/product_analytics_launch_event_property.py new file mode 100644 index 0000000000..cd9fe6ca28 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_event_property.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsLaunchEventProperty(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "required": (bool,), + } + + attribute_map = { + "id": "id", + "required": "required", + } + + def __init__(self_, id: str, required: Union[bool, UnsetType] = unset, **kwargs): + """ + A reference from an event to a property of the tracking plan. + + :param id: ID of a property in the tracking plan ``properties``. + :type id: str + + :param required: Whether the event must always include the property. + :type required: bool, optional + """ + if required is not unset: + kwargs["required"] = required + super().__init__(kwargs) + + self_.id = id diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_experiment_step.py b/src/datadog_api_client/v2/model/product_analytics_launch_experiment_step.py new file mode 100644 index 0000000000..03ec98daea --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_experiment_step.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class ProductAnalyticsLaunchExperimentStep(ModelNormal): + @cached_property + def openapi_types(_): + return { + "experiment_id": (str, none_type), + "hypothesis": (str, none_type), + "name": (str, none_type), + "protocol_id": (str, none_type), + } + + attribute_map = { + "experiment_id": "experiment_id", + "hypothesis": "hypothesis", + "name": "name", + "protocol_id": "protocol_id", + } + + def __init__( + self_, + experiment_id: Union[str, none_type, UnsetType] = unset, + hypothesis: Union[str, none_type, UnsetType] = unset, + name: Union[str, none_type, UnsetType] = unset, + protocol_id: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Experiment linked to the launch. The draft fields are cleared when ``experiment_id`` is set. + + :param experiment_id: UUID of the linked experiment. + :type experiment_id: str, none_type, optional + + :param hypothesis: Hypothesis of a draft experiment. + :type hypothesis: str, none_type, optional + + :param name: Name of a draft experiment. + :type name: str, none_type, optional + + :param protocol_id: Protocol ID of a draft experiment. + :type protocol_id: str, none_type, optional + """ + if experiment_id is not unset: + kwargs["experiment_id"] = experiment_id + if hypothesis is not unset: + kwargs["hypothesis"] = hypothesis + if name is not unset: + kwargs["name"] = name + if protocol_id is not unset: + kwargs["protocol_id"] = protocol_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_funnel_step.py b/src/datadog_api_client/v2/model/product_analytics_launch_funnel_step.py new file mode 100644 index 0000000000..29e19ea5f6 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_funnel_step.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class ProductAnalyticsLaunchFunnelStep(ModelNormal): + @cached_property + def openapi_types(_): + return { + "funnel_tile_def": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "funnel_tile_def": "funnel_tile_def", + } + + def __init__(self_, funnel_tile_def: Union[Dict[str, Any], none_type, UnsetType] = unset, **kwargs): + """ + Funnel linked to the launch. + + :param funnel_tile_def: Definition of the funnel widget, as a JSON object. + :type funnel_tile_def: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if funnel_tile_def is not unset: + kwargs["funnel_tile_def"] = funnel_tile_def + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_kpi.py b/src/datadog_api_client/v2/model/product_analytics_launch_kpi.py new file mode 100644 index 0000000000..e230b29c55 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_kpi.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ProductAnalyticsLaunchKPI(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "title": (str,), + } + + attribute_map = { + "id": "id", + "title": "title", + } + + def __init__(self_, id: str, title: str, **kwargs): + """ + A KPI that the launch is meant to move. + + :param id: ID of the KPI, unique within the launch. Tracking plan events reference it. + :type id: str + + :param title: Name of the KPI. + :type title: str + """ + super().__init__(kwargs) + + self_.id = id + self_.title = title diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_list_scope.py b/src/datadog_api_client/v2/model/product_analytics_launch_list_scope.py new file mode 100644 index 0000000000..758db3ddca --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_list_scope.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsLaunchListScope(ModelSimple): + """ + Scope of a launch list. `liftoffs` leaves out launches in the `plan` phase. + + :param value: If omitted defaults to "liftoffs". Must be one of ["liftoffs"]. + :type value: str + """ + + allowed_values = { + "liftoffs", + } + LIFTOFFS: ClassVar["ProductAnalyticsLaunchListScope"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsLaunchListScope.LIFTOFFS = ProductAnalyticsLaunchListScope("liftoffs") diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_patch_attributes.py b/src/datadog_api_client/v2/model/product_analytics_launch_patch_attributes.py new file mode 100644 index 0000000000..14ff724879 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_patch_attributes.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ProductAnalyticsLaunchCodeAnalysis + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_patch_steps import ProductAnalyticsLaunchPatchSteps + + +class ProductAnalyticsLaunchPatchAttributes(ModelNormal): + validations = { + "feature_flag_key": { + "max_length": 256, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ( + ProductAnalyticsLaunchCodeAnalysis, + ) + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_patch_steps import ProductAnalyticsLaunchPatchSteps + + return { + "application_id": (str, none_type), + "code_analysis": (ProductAnalyticsLaunchCodeAnalysis,), + "context": (str,), + "description": (str, none_type), + "feature_flag_id": (str, none_type), + "feature_flag_key": (str, none_type), + "kpis": ([ProductAnalyticsLaunchKPI], none_type), + "name": (str,), + "phase": (ProductAnalyticsLaunchPhase,), + "repository_id": (str, none_type), + "steps": (ProductAnalyticsLaunchPatchSteps,), + } + + attribute_map = { + "application_id": "application_id", + "code_analysis": "code_analysis", + "context": "context", + "description": "description", + "feature_flag_id": "feature_flag_id", + "feature_flag_key": "feature_flag_key", + "kpis": "kpis", + "name": "name", + "phase": "phase", + "repository_id": "repository_id", + "steps": "steps", + } + + def __init__( + self_, + application_id: Union[str, none_type, UnsetType] = unset, + code_analysis: Union[ProductAnalyticsLaunchCodeAnalysis, UnsetType] = unset, + context: Union[str, UnsetType] = unset, + description: Union[str, none_type, UnsetType] = unset, + feature_flag_id: Union[str, none_type, UnsetType] = unset, + feature_flag_key: Union[str, none_type, UnsetType] = unset, + kpis: Union[List[ProductAnalyticsLaunchKPI], none_type, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + phase: Union[ProductAnalyticsLaunchPhase, UnsetType] = unset, + repository_id: Union[str, none_type, UnsetType] = unset, + steps: Union[ProductAnalyticsLaunchPatchSteps, UnsetType] = unset, + **kwargs, + ): + """ + Attributes to update on a launch. Fields that are not set are left unchanged, and ``null`` clears a nullable field. + Setting a non-empty ``feature_flag_id`` clears the stored ``feature_flag_key`` when ``feature_flag_key`` is not set. + + :param application_id: UUID of the RUM application that the launch belongs to. + :type application_id: str, none_type, optional + + :param code_analysis: Latest inspection of the repository for the tracking plan instrumentation. A new analysis replaces the stored one. + Events and properties that it does not list are not verified. + :type code_analysis: ProductAnalyticsLaunchCodeAnalysis, optional + + :param context: Context of the feature being launched. + :type context: str, optional + + :param description: Description of the feature being launched. + :type description: str, none_type, optional + + :param feature_flag_id: UUID of the Datadog feature flag that gates the launch. + :type feature_flag_id: str, none_type, optional + + :param feature_flag_key: Key of a feature flag managed outside Datadog. At most 256 characters, with no leading or trailing spaces. + :type feature_flag_key: str, none_type, optional + + :param kpis: KPIs that the launch is meant to move. Replaces the stored list, and ``null`` clears it. + :type kpis: [ProductAnalyticsLaunchKPI], none_type, optional + + :param name: Name of the launch. + :type name: str, optional + + :param phase: Lifecycle phase of a launch. A new launch starts in ``plan`` or ``setup`` , and defaults to ``plan``. + Allowed changes: ``plan`` to ``setup`` , ``setup`` to ``ready`` , ``ready`` to ``setup`` or ``launched`` , and ``launched`` to ``ready``. + :type phase: ProductAnalyticsLaunchPhase, optional + + :param repository_id: ID of the code repository that implements the feature. + :type repository_id: str, none_type, optional + + :param steps: Steps to update. Steps that are not set are left unchanged. + A ``tracking_plan`` replaces the whole stored tracking plan, so include every event and property to keep. + :type steps: ProductAnalyticsLaunchPatchSteps, optional + """ + if application_id is not unset: + kwargs["application_id"] = application_id + if code_analysis is not unset: + kwargs["code_analysis"] = code_analysis + if context is not unset: + kwargs["context"] = context + if description is not unset: + kwargs["description"] = description + if feature_flag_id is not unset: + kwargs["feature_flag_id"] = feature_flag_id + if feature_flag_key is not unset: + kwargs["feature_flag_key"] = feature_flag_key + if kpis is not unset: + kwargs["kpis"] = kpis + if name is not unset: + kwargs["name"] = name + if phase is not unset: + kwargs["phase"] = phase + if repository_id is not unset: + kwargs["repository_id"] = repository_id + if steps is not unset: + kwargs["steps"] = steps + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_patch_data.py b/src/datadog_api_client/v2/model/product_analytics_launch_patch_data.py new file mode 100644 index 0000000000..9d31df370f --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_patch_data.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_patch_attributes import ( + ProductAnalyticsLaunchPatchAttributes, + ) + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + +class ProductAnalyticsLaunchPatchData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_patch_attributes import ( + ProductAnalyticsLaunchPatchAttributes, + ) + from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType + + return { + "attributes": (ProductAnalyticsLaunchPatchAttributes,), + "id": (str,), + "type": (ProductAnalyticsLaunchType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsLaunchPatchAttributes, id: str, type: ProductAnalyticsLaunchType, **kwargs + ): + """ + Data of the launch update. + + :param attributes: Attributes to update on a launch. Fields that are not set are left unchanged, and ``null`` clears a nullable field. + Setting a non-empty ``feature_flag_id`` clears the stored ``feature_flag_key`` when ``feature_flag_key`` is not set. + :type attributes: ProductAnalyticsLaunchPatchAttributes + + :param id: UUID of the launch. It must match the ID in the path. + :type id: str + + :param type: Launch resource type. + :type type: ProductAnalyticsLaunchType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_patch_request.py b/src/datadog_api_client/v2/model/product_analytics_launch_patch_request.py new file mode 100644 index 0000000000..dddc3af7ee --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_patch_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_patch_data import ProductAnalyticsLaunchPatchData + + +class ProductAnalyticsLaunchPatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_patch_data import ProductAnalyticsLaunchPatchData + + return { + "data": (ProductAnalyticsLaunchPatchData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsLaunchPatchData, **kwargs): + """ + Request to update some fields of a launch. + + :param data: Data of the launch update. + :type data: ProductAnalyticsLaunchPatchData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_patch_steps.py b/src/datadog_api_client/v2/model/product_analytics_launch_patch_steps.py new file mode 100644 index 0000000000..6dab2e1056 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_patch_steps.py @@ -0,0 +1,87 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ProductAnalyticsLaunchDashboardStep + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, + ) + + +class ProductAnalyticsLaunchPatchSteps(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ( + ProductAnalyticsLaunchDashboardStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, + ) + + return { + "dashboard": (ProductAnalyticsLaunchDashboardStep,), + "experiment": (ProductAnalyticsLaunchExperimentStep,), + "funnel": (ProductAnalyticsLaunchFunnelStep,), + "tracking_plan": (ProductAnalyticsLaunchTrackingPlanRequest,), + } + + attribute_map = { + "dashboard": "dashboard", + "experiment": "experiment", + "funnel": "funnel", + "tracking_plan": "tracking_plan", + } + + def __init__( + self_, + dashboard: Union[ProductAnalyticsLaunchDashboardStep, UnsetType] = unset, + experiment: Union[ProductAnalyticsLaunchExperimentStep, UnsetType] = unset, + funnel: Union[ProductAnalyticsLaunchFunnelStep, UnsetType] = unset, + tracking_plan: Union[ProductAnalyticsLaunchTrackingPlanRequest, UnsetType] = unset, + **kwargs, + ): + """ + Steps to update. Steps that are not set are left unchanged. + A ``tracking_plan`` replaces the whole stored tracking plan, so include every event and property to keep. + + :param dashboard: Dashboard linked to the launch. + :type dashboard: ProductAnalyticsLaunchDashboardStep, optional + + :param experiment: Experiment linked to the launch. The draft fields are cleared when ``experiment_id`` is set. + :type experiment: ProductAnalyticsLaunchExperimentStep, optional + + :param funnel: Funnel linked to the launch. + :type funnel: ProductAnalyticsLaunchFunnelStep, optional + + :param tracking_plan: Tracking plan of a launch, listing the events and properties to instrument. + :type tracking_plan: ProductAnalyticsLaunchTrackingPlanRequest, optional + """ + if dashboard is not unset: + kwargs["dashboard"] = dashboard + if experiment is not unset: + kwargs["experiment"] = experiment + if funnel is not unset: + kwargs["funnel"] = funnel + if tracking_plan is not unset: + kwargs["tracking_plan"] = tracking_plan + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_phase.py b/src/datadog_api_client/v2/model/product_analytics_launch_phase.py new file mode 100644 index 0000000000..06c874812e --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_phase.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsLaunchPhase(ModelSimple): + """ + Lifecycle phase of a launch. A new launch starts in `plan` or `setup`, and defaults to `plan`. + Allowed changes: `plan` to `setup`, `setup` to `ready`, `ready` to `setup` or `launched`, and `launched` to `ready`. + + :param value: Must be one of ["plan", "setup", "ready", "launched"]. + :type value: str + """ + + allowed_values = { + "plan", + "setup", + "ready", + "launched", + } + PLAN: ClassVar["ProductAnalyticsLaunchPhase"] + SETUP: ClassVar["ProductAnalyticsLaunchPhase"] + READY: ClassVar["ProductAnalyticsLaunchPhase"] + LAUNCHED: ClassVar["ProductAnalyticsLaunchPhase"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsLaunchPhase.PLAN = ProductAnalyticsLaunchPhase("plan") +ProductAnalyticsLaunchPhase.SETUP = ProductAnalyticsLaunchPhase("setup") +ProductAnalyticsLaunchPhase.READY = ProductAnalyticsLaunchPhase("ready") +ProductAnalyticsLaunchPhase.LAUNCHED = ProductAnalyticsLaunchPhase("launched") diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_properties.py b/src/datadog_api_client/v2/model/product_analytics_launch_properties.py new file mode 100644 index 0000000000..685b3b6a34 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_properties.py @@ -0,0 +1,29 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + pass + + +class ProductAnalyticsLaunchProperties(ModelNormal): + @cached_property + def additional_properties_type(_): + from datadog_api_client.v2.model.product_analytics_launch_property import ProductAnalyticsLaunchProperty + + return (ProductAnalyticsLaunchProperty,) + + def __init__(self_, **kwargs): + """ + Event properties of the tracking plan, keyed by property ID. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_property.py b/src/datadog_api_client/v2/model/product_analytics_launch_property.py new file mode 100644 index 0000000000..471101ea20 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_property.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ProductAnalyticsLaunchProperty(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + } + + attribute_map = { + "description": "description", + } + + def __init__(self_, description: str, **kwargs): + """ + An event property of the tracking plan. + + :param description: What the property captures. + :type description: str + """ + super().__init__(kwargs) + + self_.description = description diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_property_finding.py b/src/datadog_api_client/v2/model/product_analytics_launch_property_finding.py new file mode 100644 index 0000000000..7544e671c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_property_finding.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_code_status import ProductAnalyticsLaunchCodeStatus + + +class ProductAnalyticsLaunchPropertyFinding(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_code_status import ProductAnalyticsLaunchCodeStatus + + return { + "id": (str,), + "status": (ProductAnalyticsLaunchCodeStatus,), + } + + attribute_map = { + "id": "id", + "status": "status", + } + + def __init__(self_, id: str, status: ProductAnalyticsLaunchCodeStatus, **kwargs): + """ + Code analysis result for a property of an event. + + :param id: ID of the property in the tracking plan. + :type id: str + + :param status: Whether the inspected code sends the event, or attaches the property to the event. + :type status: ProductAnalyticsLaunchCodeStatus + """ + super().__init__(kwargs) + + self_.id = id + self_.status = status diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_request_attributes.py b/src/datadog_api_client/v2/model/product_analytics_launch_request_attributes.py new file mode 100644 index 0000000000..1bcb11900d --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_request_attributes.py @@ -0,0 +1,132 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_steps_request import ProductAnalyticsLaunchStepsRequest + + +class ProductAnalyticsLaunchRequestAttributes(ModelNormal): + validations = { + "feature_flag_key": { + "max_length": 256, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI + from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase + from datadog_api_client.v2.model.product_analytics_launch_steps_request import ( + ProductAnalyticsLaunchStepsRequest, + ) + + return { + "application_id": (str, none_type), + "context": (str,), + "description": (str, none_type), + "feature_flag_id": (str, none_type), + "feature_flag_key": (str, none_type), + "kpis": ([ProductAnalyticsLaunchKPI],), + "name": (str,), + "phase": (ProductAnalyticsLaunchPhase,), + "repository_id": (str,), + "steps": (ProductAnalyticsLaunchStepsRequest,), + } + + attribute_map = { + "application_id": "application_id", + "context": "context", + "description": "description", + "feature_flag_id": "feature_flag_id", + "feature_flag_key": "feature_flag_key", + "kpis": "kpis", + "name": "name", + "phase": "phase", + "repository_id": "repository_id", + "steps": "steps", + } + + def __init__( + self_, + context: str, + name: str, + steps: ProductAnalyticsLaunchStepsRequest, + application_id: Union[str, none_type, UnsetType] = unset, + description: Union[str, none_type, UnsetType] = unset, + feature_flag_id: Union[str, none_type, UnsetType] = unset, + feature_flag_key: Union[str, none_type, UnsetType] = unset, + kpis: Union[List[ProductAnalyticsLaunchKPI], UnsetType] = unset, + phase: Union[ProductAnalyticsLaunchPhase, UnsetType] = unset, + repository_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a launch to create or replace. + + :param application_id: UUID of the RUM application that the launch belongs to. + :type application_id: str, none_type, optional + + :param context: Context of the feature being launched, used to build the tracking plan. + :type context: str + + :param description: Description of the feature being launched. + :type description: str, none_type, optional + + :param feature_flag_id: UUID of the Datadog feature flag that gates the launch. Do not set it together with ``feature_flag_key``. + :type feature_flag_id: str, none_type, optional + + :param feature_flag_key: Key of a feature flag managed outside Datadog, as evaluated in code. At most 256 characters, with no leading or trailing spaces. + Do not set it together with ``feature_flag_id``. ``null`` clears it. On replace, omitting it keeps the stored key unless ``feature_flag_id`` is set. + :type feature_flag_key: str, none_type, optional + + :param kpis: KPIs that the launch is meant to move. + :type kpis: [ProductAnalyticsLaunchKPI], optional + + :param name: Name of the launch. + :type name: str + + :param phase: Lifecycle phase of a launch. A new launch starts in ``plan`` or ``setup`` , and defaults to ``plan``. + Allowed changes: ``plan`` to ``setup`` , ``setup`` to ``ready`` , ``ready`` to ``setup`` or ``launched`` , and ``launched`` to ``ready``. + :type phase: ProductAnalyticsLaunchPhase, optional + + :param repository_id: ID of the code repository that implements the feature. + :type repository_id: str, optional + + :param steps: Steps of the launch. The tracking plan is required. + :type steps: ProductAnalyticsLaunchStepsRequest + """ + if application_id is not unset: + kwargs["application_id"] = application_id + if description is not unset: + kwargs["description"] = description + if feature_flag_id is not unset: + kwargs["feature_flag_id"] = feature_flag_id + if feature_flag_key is not unset: + kwargs["feature_flag_key"] = feature_flag_key + if kpis is not unset: + kwargs["kpis"] = kpis + if phase is not unset: + kwargs["phase"] = phase + if repository_id is not unset: + kwargs["repository_id"] = repository_id + super().__init__(kwargs) + + self_.context = context + self_.name = name + self_.steps = steps diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_response.py b/src/datadog_api_client/v2/model/product_analytics_launch_response.py new file mode 100644 index 0000000000..7016967526 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_data import ProductAnalyticsLaunchData + + +class ProductAnalyticsLaunchResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_data import ProductAnalyticsLaunchData + + return { + "data": (ProductAnalyticsLaunchData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsLaunchData, **kwargs): + """ + Response containing a launch. + + :param data: A launch. + :type data: ProductAnalyticsLaunchData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_steps.py b/src/datadog_api_client/v2/model/product_analytics_launch_steps.py new file mode 100644 index 0000000000..8e12f56c5a --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_steps.py @@ -0,0 +1,84 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ProductAnalyticsLaunchDashboardStep + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan import ProductAnalyticsLaunchTrackingPlan + + +class ProductAnalyticsLaunchSteps(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ( + ProductAnalyticsLaunchDashboardStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan import ( + ProductAnalyticsLaunchTrackingPlan, + ) + + return { + "dashboard": (ProductAnalyticsLaunchDashboardStep,), + "experiment": (ProductAnalyticsLaunchExperimentStep,), + "funnel": (ProductAnalyticsLaunchFunnelStep,), + "tracking_plan": (ProductAnalyticsLaunchTrackingPlan,), + } + + attribute_map = { + "dashboard": "dashboard", + "experiment": "experiment", + "funnel": "funnel", + "tracking_plan": "tracking_plan", + } + + def __init__( + self_, + dashboard: Union[ProductAnalyticsLaunchDashboardStep, UnsetType] = unset, + experiment: Union[ProductAnalyticsLaunchExperimentStep, UnsetType] = unset, + funnel: Union[ProductAnalyticsLaunchFunnelStep, UnsetType] = unset, + tracking_plan: Union[ProductAnalyticsLaunchTrackingPlan, UnsetType] = unset, + **kwargs, + ): + """ + Steps of the launch. + + :param dashboard: Dashboard linked to the launch. + :type dashboard: ProductAnalyticsLaunchDashboardStep, optional + + :param experiment: Experiment linked to the launch. The draft fields are cleared when ``experiment_id`` is set. + :type experiment: ProductAnalyticsLaunchExperimentStep, optional + + :param funnel: Funnel linked to the launch. + :type funnel: ProductAnalyticsLaunchFunnelStep, optional + + :param tracking_plan: Tracking plan of a launch, listing the events and properties to instrument. + :type tracking_plan: ProductAnalyticsLaunchTrackingPlan, optional + """ + if dashboard is not unset: + kwargs["dashboard"] = dashboard + if experiment is not unset: + kwargs["experiment"] = experiment + if funnel is not unset: + kwargs["funnel"] = funnel + if tracking_plan is not unset: + kwargs["tracking_plan"] = tracking_plan + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_steps_request.py b/src/datadog_api_client/v2/model/product_analytics_launch_steps_request.py new file mode 100644 index 0000000000..b879d2b964 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_steps_request.py @@ -0,0 +1,86 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ProductAnalyticsLaunchDashboardStep + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, + ) + + +class ProductAnalyticsLaunchStepsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ( + ProductAnalyticsLaunchDashboardStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ( + ProductAnalyticsLaunchExperimentStep, + ) + from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep + from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, + ) + + return { + "dashboard": (ProductAnalyticsLaunchDashboardStep,), + "experiment": (ProductAnalyticsLaunchExperimentStep,), + "funnel": (ProductAnalyticsLaunchFunnelStep,), + "tracking_plan": (ProductAnalyticsLaunchTrackingPlanRequest,), + } + + attribute_map = { + "dashboard": "dashboard", + "experiment": "experiment", + "funnel": "funnel", + "tracking_plan": "tracking_plan", + } + + def __init__( + self_, + tracking_plan: ProductAnalyticsLaunchTrackingPlanRequest, + dashboard: Union[ProductAnalyticsLaunchDashboardStep, UnsetType] = unset, + experiment: Union[ProductAnalyticsLaunchExperimentStep, UnsetType] = unset, + funnel: Union[ProductAnalyticsLaunchFunnelStep, UnsetType] = unset, + **kwargs, + ): + """ + Steps of the launch. The tracking plan is required. + + :param dashboard: Dashboard linked to the launch. + :type dashboard: ProductAnalyticsLaunchDashboardStep, optional + + :param experiment: Experiment linked to the launch. The draft fields are cleared when ``experiment_id`` is set. + :type experiment: ProductAnalyticsLaunchExperimentStep, optional + + :param funnel: Funnel linked to the launch. + :type funnel: ProductAnalyticsLaunchFunnelStep, optional + + :param tracking_plan: Tracking plan of a launch, listing the events and properties to instrument. + :type tracking_plan: ProductAnalyticsLaunchTrackingPlanRequest + """ + if dashboard is not unset: + kwargs["dashboard"] = dashboard + if experiment is not unset: + kwargs["experiment"] = experiment + if funnel is not unset: + kwargs["funnel"] = funnel + super().__init__(kwargs) + + self_.tracking_plan = tracking_plan diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan.py b/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan.py new file mode 100644 index 0000000000..8c65d6e2bc --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ProductAnalyticsLaunchCodeAnalysis + from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent + from datadog_api_client.v2.model.product_analytics_launch_properties import ProductAnalyticsLaunchProperties + + +class ProductAnalyticsLaunchTrackingPlan(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ( + ProductAnalyticsLaunchCodeAnalysis, + ) + from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent + from datadog_api_client.v2.model.product_analytics_launch_properties import ProductAnalyticsLaunchProperties + + return { + "code_analysis": (ProductAnalyticsLaunchCodeAnalysis,), + "codegen_session_id": (str,), + "created_at": (datetime,), + "created_by": (str,), + "events": ([ProductAnalyticsLaunchEvent],), + "id": (str,), + "jira_ticket_id": (str,), + "pr_link": (str,), + "properties": (ProductAnalyticsLaunchProperties,), + "updated_at": (datetime, none_type), + "updated_by": (str, none_type), + } + + attribute_map = { + "code_analysis": "code_analysis", + "codegen_session_id": "codegen_session_id", + "created_at": "created_at", + "created_by": "created_by", + "events": "events", + "id": "id", + "jira_ticket_id": "jira_ticket_id", + "pr_link": "pr_link", + "properties": "properties", + "updated_at": "updated_at", + "updated_by": "updated_by", + } + + def __init__( + self_, + created_at: datetime, + created_by: str, + id: str, + code_analysis: Union[ProductAnalyticsLaunchCodeAnalysis, UnsetType] = unset, + codegen_session_id: Union[str, UnsetType] = unset, + events: Union[List[ProductAnalyticsLaunchEvent], UnsetType] = unset, + jira_ticket_id: Union[str, UnsetType] = unset, + pr_link: Union[str, UnsetType] = unset, + properties: Union[ProductAnalyticsLaunchProperties, UnsetType] = unset, + updated_at: Union[datetime, none_type, UnsetType] = unset, + updated_by: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Tracking plan of a launch, listing the events and properties to instrument. + + :param code_analysis: Latest inspection of the repository for the tracking plan instrumentation. A new analysis replaces the stored one. + Events and properties that it does not list are not verified. + :type code_analysis: ProductAnalyticsLaunchCodeAnalysis, optional + + :param codegen_session_id: ID of the code generation session that implemented the plan. + :type codegen_session_id: str, optional + + :param created_at: Time the tracking plan was created. + :type created_at: datetime + + :param created_by: UUID of the user who created the tracking plan. + :type created_by: str + + :param events: Events to instrument. + :type events: [ProductAnalyticsLaunchEvent], optional + + :param id: ID of the tracking plan. + :type id: str + + :param jira_ticket_id: ID of the Jira ticket that tracks the instrumentation work. + :type jira_ticket_id: str, optional + + :param pr_link: Link to the pull request that implements the plan. + :type pr_link: str, optional + + :param properties: Event properties of the tracking plan, keyed by property ID. + :type properties: ProductAnalyticsLaunchProperties, optional + + :param updated_at: Time the tracking plan was last updated. + :type updated_at: datetime, none_type, optional + + :param updated_by: UUID of the user who last updated the tracking plan. + :type updated_by: str, none_type, optional + """ + if code_analysis is not unset: + kwargs["code_analysis"] = code_analysis + if codegen_session_id is not unset: + kwargs["codegen_session_id"] = codegen_session_id + if events is not unset: + kwargs["events"] = events + if jira_ticket_id is not unset: + kwargs["jira_ticket_id"] = jira_ticket_id + if pr_link is not unset: + kwargs["pr_link"] = pr_link + if properties is not unset: + kwargs["properties"] = properties + if updated_at is not unset: + kwargs["updated_at"] = updated_at + if updated_by is not unset: + kwargs["updated_by"] = updated_by + super().__init__(kwargs) + + self_.created_at = created_at + self_.created_by = created_by + self_.id = id diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan_request.py b/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan_request.py new file mode 100644 index 0000000000..7cbecab426 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_tracking_plan_request.py @@ -0,0 +1,93 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ProductAnalyticsLaunchCodeAnalysis + from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent + from datadog_api_client.v2.model.product_analytics_launch_properties import ProductAnalyticsLaunchProperties + + +class ProductAnalyticsLaunchTrackingPlanRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ( + ProductAnalyticsLaunchCodeAnalysis, + ) + from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent + from datadog_api_client.v2.model.product_analytics_launch_properties import ProductAnalyticsLaunchProperties + + return { + "code_analysis": (ProductAnalyticsLaunchCodeAnalysis,), + "codegen_session_id": (str,), + "events": ([ProductAnalyticsLaunchEvent],), + "jira_ticket_id": (str,), + "pr_link": (str,), + "properties": (ProductAnalyticsLaunchProperties,), + } + + attribute_map = { + "code_analysis": "code_analysis", + "codegen_session_id": "codegen_session_id", + "events": "events", + "jira_ticket_id": "jira_ticket_id", + "pr_link": "pr_link", + "properties": "properties", + } + + def __init__( + self_, + code_analysis: Union[ProductAnalyticsLaunchCodeAnalysis, UnsetType] = unset, + codegen_session_id: Union[str, UnsetType] = unset, + events: Union[List[ProductAnalyticsLaunchEvent], UnsetType] = unset, + jira_ticket_id: Union[str, UnsetType] = unset, + pr_link: Union[str, UnsetType] = unset, + properties: Union[ProductAnalyticsLaunchProperties, UnsetType] = unset, + **kwargs, + ): + """ + Tracking plan of a launch, listing the events and properties to instrument. + + :param code_analysis: Latest inspection of the repository for the tracking plan instrumentation. A new analysis replaces the stored one. + Events and properties that it does not list are not verified. + :type code_analysis: ProductAnalyticsLaunchCodeAnalysis, optional + + :param codegen_session_id: ID of the code generation session that implemented the plan. + :type codegen_session_id: str, optional + + :param events: Events to instrument. + :type events: [ProductAnalyticsLaunchEvent], optional + + :param jira_ticket_id: ID of the Jira ticket that tracks the instrumentation work. + :type jira_ticket_id: str, optional + + :param pr_link: Link to the pull request that implements the plan. + :type pr_link: str, optional + + :param properties: Event properties of the tracking plan, keyed by property ID. + :type properties: ProductAnalyticsLaunchProperties, optional + """ + if code_analysis is not unset: + kwargs["code_analysis"] = code_analysis + if codegen_session_id is not unset: + kwargs["codegen_session_id"] = codegen_session_id + if events is not unset: + kwargs["events"] = events + if jira_ticket_id is not unset: + kwargs["jira_ticket_id"] = jira_ticket_id + if pr_link is not unset: + kwargs["pr_link"] = pr_link + if properties is not unset: + kwargs["properties"] = properties + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_launch_type.py b/src/datadog_api_client/v2/model/product_analytics_launch_type.py new file mode 100644 index 0000000000..4942880f3c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launch_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsLaunchType(ModelSimple): + """ + Launch resource type. + + :param value: If omitted defaults to "liftoff". Must be one of ["liftoff"]. + :type value: str + """ + + allowed_values = { + "liftoff", + } + LIFTOFF: ClassVar["ProductAnalyticsLaunchType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsLaunchType.LIFTOFF = ProductAnalyticsLaunchType("liftoff") diff --git a/src/datadog_api_client/v2/model/product_analytics_launches_response.py b/src/datadog_api_client/v2/model/product_analytics_launches_response.py new file mode 100644 index 0000000000..fbe7a02c9c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_launches_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_launch_data import ProductAnalyticsLaunchData + + +class ProductAnalyticsLaunchesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_launch_data import ProductAnalyticsLaunchData + + return { + "data": ([ProductAnalyticsLaunchData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ProductAnalyticsLaunchData], **kwargs): + """ + Response containing a list of launches. + + :param data: The launches. + :type data: [ProductAnalyticsLaunchData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_attributes.py b/src/datadog_api_client/v2/model/product_analytics_monitor_attributes.py new file mode 100644 index 0000000000..1e22deb829 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_attributes.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_creator import ProductAnalyticsMonitorCreator + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_status import ProductAnalyticsMonitorStatus + + +class ProductAnalyticsMonitorAttributes(ModelNormal): + validations = { + "priority": { + "inclusive_maximum": 5, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_creator import ProductAnalyticsMonitorCreator + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_status import ProductAnalyticsMonitorStatus + + return { + "created_time": (datetime,), + "creator": (ProductAnalyticsMonitorCreator,), + "message": (str,), + "modified_time": (datetime,), + "name": (str,), + "options": (ProductAnalyticsMonitorOptions,), + "org_id": (int,), + "priority": (int,), + "query": (str,), + "status": (ProductAnalyticsMonitorStatus,), + "tags": ([str], none_type), + } + + attribute_map = { + "created_time": "created_time", + "creator": "creator", + "message": "message", + "modified_time": "modified_time", + "name": "name", + "options": "options", + "org_id": "org_id", + "priority": "priority", + "query": "query", + "status": "status", + "tags": "tags", + } + + def __init__( + self_, + message: str, + name: str, + options: ProductAnalyticsMonitorOptions, + org_id: int, + query: str, + status: ProductAnalyticsMonitorStatus, + created_time: Union[datetime, UnsetType] = unset, + creator: Union[ProductAnalyticsMonitorCreator, UnsetType] = unset, + modified_time: Union[datetime, UnsetType] = unset, + priority: Union[int, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a Product Analytics monitor. + + :param created_time: Time the monitor was created. + :type created_time: datetime, optional + + :param creator: The user who created the monitor. + :type creator: ProductAnalyticsMonitorCreator, optional + + :param message: Notification message sent when the monitor alerts. + :type message: str + + :param modified_time: Time the monitor was last modified. + :type modified_time: datetime, optional + + :param name: Name of the monitor. + :type name: str + + :param options: Options of a Product Analytics monitor. + :type options: ProductAnalyticsMonitorOptions + + :param org_id: ID of the organization that owns the monitor. + :type org_id: int + + :param priority: Priority of the monitor, from 1 (highest) to 5 (lowest). + :type priority: int, optional + + :param query: Monitor query. + :type query: str + + :param status: Current alert status of the monitor. ``No Data`` is returned when the monitor has not been evaluated yet. + :type status: ProductAnalyticsMonitorStatus + + :param tags: Monitor tags, as ``key:value`` strings. + :type tags: [str], none_type, optional + """ + if created_time is not unset: + kwargs["created_time"] = created_time + if creator is not unset: + kwargs["creator"] = creator + if modified_time is not unset: + kwargs["modified_time"] = modified_time + if priority is not unset: + kwargs["priority"] = priority + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.message = message + self_.name = name + self_.options = options + self_.org_id = org_id + self_.query = query + self_.status = status diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_create_attributes.py b/src/datadog_api_client/v2/model/product_analytics_monitor_create_attributes.py new file mode 100644 index 0000000000..59ccb9d71c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_create_attributes.py @@ -0,0 +1,95 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags + + +class ProductAnalyticsMonitorCreateAttributes(ModelNormal): + validations = { + "priority": { + "inclusive_maximum": 5, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags + + return { + "message": (str,), + "name": (str,), + "options": (ProductAnalyticsMonitorOptions,), + "priority": (int,), + "query": (str,), + "tags": (ProductAnalyticsMonitorTags,), + } + + attribute_map = { + "message": "message", + "name": "name", + "options": "options", + "priority": "priority", + "query": "query", + "tags": "tags", + } + + def __init__( + self_, + message: str, + name: str, + query: str, + options: Union[ProductAnalyticsMonitorOptions, UnsetType] = unset, + priority: Union[int, UnsetType] = unset, + tags: Union[ProductAnalyticsMonitorTags, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the Product Analytics monitor to create. + + :param message: Notification message sent when the monitor alerts. It can include ``@`` notification handles. + :type message: str + + :param name: Name of the monitor. + :type name: str + + :param options: Options of a Product Analytics monitor. + :type options: ProductAnalyticsMonitorOptions, optional + + :param priority: Priority of the monitor, from 1 (highest) to 5 (lowest). + :type priority: int, optional + + :param query: Monitor query, for example ``formula("query").rollup("sum").last("1h") < 1``. + Define the variables it references in ``options.variables``. + :type query: str + + :param tags: Monitor tags as key and value pairs. Each pair is stored as a ``key:value`` tag. + ``chart_id`` and ``dashboard_id`` link the monitor to the chart it was created from. ``dashboard_id`` requires ``chart_id``. + :type tags: ProductAnalyticsMonitorTags, optional + """ + if options is not unset: + kwargs["options"] = options + if priority is not unset: + kwargs["priority"] = priority + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.message = message + self_.name = name + self_.query = query diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_create_data.py b/src/datadog_api_client/v2/model/product_analytics_monitor_create_data.py new file mode 100644 index 0000000000..613be22efc --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_create_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_create_attributes import ( + ProductAnalyticsMonitorCreateAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_request_type import ProductAnalyticsMonitorRequestType + + +class ProductAnalyticsMonitorCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_create_attributes import ( + ProductAnalyticsMonitorCreateAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_request_type import ( + ProductAnalyticsMonitorRequestType, + ) + + return { + "attributes": (ProductAnalyticsMonitorCreateAttributes,), + "type": (ProductAnalyticsMonitorRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsMonitorCreateAttributes, type: ProductAnalyticsMonitorRequestType, **kwargs + ): + """ + Data of the Product Analytics monitor to create. + + :param attributes: Attributes of the Product Analytics monitor to create. + :type attributes: ProductAnalyticsMonitorCreateAttributes + + :param type: Product Analytics monitor request resource type. + :type type: ProductAnalyticsMonitorRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_create_request.py b/src/datadog_api_client/v2/model/product_analytics_monitor_create_request.py new file mode 100644 index 0000000000..c4214fc2e5 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_create_data import ProductAnalyticsMonitorCreateData + + +class ProductAnalyticsMonitorCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_create_data import ProductAnalyticsMonitorCreateData + + return { + "data": (ProductAnalyticsMonitorCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsMonitorCreateData, **kwargs): + """ + Request to create a Product Analytics monitor. + + :param data: Data of the Product Analytics monitor to create. + :type data: ProductAnalyticsMonitorCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_creator.py b/src/datadog_api_client/v2/model/product_analytics_monitor_creator.py new file mode 100644 index 0000000000..cdf9471a66 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_creator.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsMonitorCreator(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + "handle": (str,), + "id": (int,), + "name": (str,), + "uuid": (str,), + } + + attribute_map = { + "email": "email", + "handle": "handle", + "id": "id", + "name": "name", + "uuid": "uuid", + } + + def __init__( + self_, + email: Union[str, UnsetType] = unset, + handle: Union[str, UnsetType] = unset, + id: Union[int, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + uuid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The user who created the monitor. + + :param email: Email of the user. + :type email: str, optional + + :param handle: Handle of the user. + :type handle: str, optional + + :param id: Numeric ID of the user. + :type id: int, optional + + :param name: Name of the user. + :type name: str, optional + + :param uuid: UUID of the user. + :type uuid: str, optional + """ + if email is not unset: + kwargs["email"] = email + if handle is not unset: + kwargs["handle"] = handle + if id is not unset: + kwargs["id"] = id + if name is not unset: + kwargs["name"] = name + if uuid is not unset: + kwargs["uuid"] = uuid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_data.py b/src/datadog_api_client/v2/model/product_analytics_monitor_data.py new file mode 100644 index 0000000000..44725942d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_attributes import ProductAnalyticsMonitorAttributes + from datadog_api_client.v2.model.product_analytics_monitor_type import ProductAnalyticsMonitorType + + +class ProductAnalyticsMonitorData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_attributes import ProductAnalyticsMonitorAttributes + from datadog_api_client.v2.model.product_analytics_monitor_type import ProductAnalyticsMonitorType + + return { + "attributes": (ProductAnalyticsMonitorAttributes,), + "id": (str,), + "type": (ProductAnalyticsMonitorType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsMonitorAttributes, id: str, type: ProductAnalyticsMonitorType, **kwargs + ): + """ + A Product Analytics monitor. + + :param attributes: Attributes of a Product Analytics monitor. + :type attributes: ProductAnalyticsMonitorAttributes + + :param id: ID of the monitor. + :type id: str + + :param type: Product Analytics monitor resource type. + :type type: ProductAnalyticsMonitorType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_list_attributes.py b/src/datadog_api_client/v2/model/product_analytics_monitor_list_attributes.py new file mode 100644 index 0000000000..343a6f18a1 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_list_attributes.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_list_item import ProductAnalyticsMonitorListItem + + +class ProductAnalyticsMonitorListAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_list_item import ProductAnalyticsMonitorListItem + + return { + "monitors": ([ProductAnalyticsMonitorListItem],), + "total": (int,), + } + + attribute_map = { + "monitors": "monitors", + "total": "total", + } + + def __init__(self_, monitors: List[ProductAnalyticsMonitorListItem], total: int, **kwargs): + """ + A list of Product Analytics monitors. + + :param monitors: The monitors. + :type monitors: [ProductAnalyticsMonitorListItem] + + :param total: Total number of monitors that match, across all pages. + :type total: int + """ + super().__init__(kwargs) + + self_.monitors = monitors + self_.total = total diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_list_data.py b/src/datadog_api_client/v2/model/product_analytics_monitor_list_data.py new file mode 100644 index 0000000000..634643e8e2 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_list_data.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_list_attributes import ( + ProductAnalyticsMonitorListAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_list_type import ProductAnalyticsMonitorListType + + +class ProductAnalyticsMonitorListData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_list_attributes import ( + ProductAnalyticsMonitorListAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_list_type import ProductAnalyticsMonitorListType + + return { + "attributes": (ProductAnalyticsMonitorListAttributes,), + "id": (str,), + "type": (ProductAnalyticsMonitorListType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: ProductAnalyticsMonitorListAttributes, + id: str, + type: ProductAnalyticsMonitorListType, + **kwargs, + ): + """ + Data of a Product Analytics monitor list. + + :param attributes: A list of Product Analytics monitors. + :type attributes: ProductAnalyticsMonitorListAttributes + + :param id: ID of the list resource. Always ``list``. + :type id: str + + :param type: Product Analytics monitor list resource type. + :type type: ProductAnalyticsMonitorListType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_list_item.py b/src/datadog_api_client/v2/model/product_analytics_monitor_list_item.py new file mode 100644 index 0000000000..1e3bd22bbe --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_list_item.py @@ -0,0 +1,141 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_creator import ProductAnalyticsMonitorCreator + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_status import ProductAnalyticsMonitorStatus + + +class ProductAnalyticsMonitorListItem(ModelNormal): + validations = { + "priority": { + "inclusive_maximum": 5, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_creator import ProductAnalyticsMonitorCreator + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_status import ProductAnalyticsMonitorStatus + + return { + "created_time": (datetime,), + "creator": (ProductAnalyticsMonitorCreator,), + "id": (str,), + "message": (str,), + "modified_time": (datetime,), + "name": (str,), + "options": (ProductAnalyticsMonitorOptions,), + "org_id": (int,), + "priority": (int,), + "query": (str,), + "status": (ProductAnalyticsMonitorStatus,), + "tags": ([str], none_type), + } + + attribute_map = { + "created_time": "created_time", + "creator": "creator", + "id": "id", + "message": "message", + "modified_time": "modified_time", + "name": "name", + "options": "options", + "org_id": "org_id", + "priority": "priority", + "query": "query", + "status": "status", + "tags": "tags", + } + + def __init__( + self_, + id: str, + message: str, + name: str, + options: ProductAnalyticsMonitorOptions, + org_id: int, + query: str, + status: ProductAnalyticsMonitorStatus, + created_time: Union[datetime, UnsetType] = unset, + creator: Union[ProductAnalyticsMonitorCreator, UnsetType] = unset, + modified_time: Union[datetime, UnsetType] = unset, + priority: Union[int, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A Product Analytics monitor in a list. + + :param created_time: Time the monitor was created. + :type created_time: datetime, optional + + :param creator: The user who created the monitor. + :type creator: ProductAnalyticsMonitorCreator, optional + + :param id: ID of the monitor. + :type id: str + + :param message: Notification message sent when the monitor alerts. + :type message: str + + :param modified_time: Time the monitor was last modified. + :type modified_time: datetime, optional + + :param name: Name of the monitor. + :type name: str + + :param options: Options of a Product Analytics monitor. + :type options: ProductAnalyticsMonitorOptions + + :param org_id: ID of the organization that owns the monitor. + :type org_id: int + + :param priority: Priority of the monitor, from 1 (highest) to 5 (lowest). + :type priority: int, optional + + :param query: Monitor query. + :type query: str + + :param status: Current alert status of the monitor. ``No Data`` is returned when the monitor has not been evaluated yet. + :type status: ProductAnalyticsMonitorStatus + + :param tags: Monitor tags, as ``key:value`` strings. + :type tags: [str], none_type, optional + """ + if created_time is not unset: + kwargs["created_time"] = created_time + if creator is not unset: + kwargs["creator"] = creator + if modified_time is not unset: + kwargs["modified_time"] = modified_time + if priority is not unset: + kwargs["priority"] = priority + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.id = id + self_.message = message + self_.name = name + self_.options = options + self_.org_id = org_id + self_.query = query + self_.status = status diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_list_response.py b/src/datadog_api_client/v2/model/product_analytics_monitor_list_response.py new file mode 100644 index 0000000000..f5e65bbde3 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_list_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_list_data import ProductAnalyticsMonitorListData + + +class ProductAnalyticsMonitorListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_list_data import ProductAnalyticsMonitorListData + + return { + "data": (ProductAnalyticsMonitorListData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsMonitorListData, **kwargs): + """ + Response containing a list of Product Analytics monitors. + + :param data: Data of a Product Analytics monitor list. + :type data: ProductAnalyticsMonitorListData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_list_type.py b/src/datadog_api_client/v2/model/product_analytics_monitor_list_type.py new file mode 100644 index 0000000000..b5fcc0fa8e --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_list_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsMonitorListType(ModelSimple): + """ + Product Analytics monitor list resource type. + + :param value: If omitted defaults to "pa_monitor_list". Must be one of ["pa_monitor_list"]. + :type value: str + """ + + allowed_values = { + "pa_monitor_list", + } + PA_MONITOR_LIST: ClassVar["ProductAnalyticsMonitorListType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsMonitorListType.PA_MONITOR_LIST = ProductAnalyticsMonitorListType("pa_monitor_list") diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_options.py b/src/datadog_api_client/v2/model/product_analytics_monitor_options.py new file mode 100644 index 0000000000..c9da7e60cd --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_options.py @@ -0,0 +1,97 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_thresholds import ProductAnalyticsMonitorThresholds + from datadog_api_client.v2.model.product_analytics_monitor_variable import ProductAnalyticsMonitorVariable + + +class ProductAnalyticsMonitorOptions(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_thresholds import ProductAnalyticsMonitorThresholds + from datadog_api_client.v2.model.product_analytics_monitor_variable import ProductAnalyticsMonitorVariable + + return { + "chart_uuid": (str,), + "metric_selector": (str,), + "query_index": (int,), + "renotify_interval": (int,), + "thresholds": (ProductAnalyticsMonitorThresholds,), + "timeframe": (str,), + "variables": ([ProductAnalyticsMonitorVariable],), + } + + attribute_map = { + "chart_uuid": "chart_uuid", + "metric_selector": "metric_selector", + "query_index": "query_index", + "renotify_interval": "renotify_interval", + "thresholds": "thresholds", + "timeframe": "timeframe", + "variables": "variables", + } + + def __init__( + self_, + chart_uuid: Union[str, UnsetType] = unset, + metric_selector: Union[str, UnsetType] = unset, + query_index: Union[int, UnsetType] = unset, + renotify_interval: Union[int, UnsetType] = unset, + thresholds: Union[ProductAnalyticsMonitorThresholds, UnsetType] = unset, + timeframe: Union[str, UnsetType] = unset, + variables: Union[List[ProductAnalyticsMonitorVariable], UnsetType] = unset, + **kwargs, + ): + """ + Options of a Product Analytics monitor. + + :param chart_uuid: UUID of the chart the monitor was created from. + :type chart_uuid: str, optional + + :param metric_selector: Metric of the chart that the monitor evaluates. + :type metric_selector: str, optional + + :param query_index: Index of the chart query that the monitor evaluates. + :type query_index: int, optional + + :param renotify_interval: Number of minutes after the last notification before the monitor notifies again on the current status. ``0`` means it never notifies again. + :type renotify_interval: int, optional + + :param thresholds: Alert thresholds of a Product Analytics monitor. + Keep ``critical`` in sync with the comparison in the monitor query; the query is not derived from these values. + :type thresholds: ProductAnalyticsMonitorThresholds, optional + + :param timeframe: Time frame of the chart that the monitor evaluates. + :type timeframe: str, optional + + :param variables: Query variables referenced by the monitor query. + :type variables: [ProductAnalyticsMonitorVariable], optional + """ + if chart_uuid is not unset: + kwargs["chart_uuid"] = chart_uuid + if metric_selector is not unset: + kwargs["metric_selector"] = metric_selector + if query_index is not unset: + kwargs["query_index"] = query_index + if renotify_interval is not unset: + kwargs["renotify_interval"] = renotify_interval + if thresholds is not unset: + kwargs["thresholds"] = thresholds + if timeframe is not unset: + kwargs["timeframe"] = timeframe + if variables is not unset: + kwargs["variables"] = variables + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_request_type.py b/src/datadog_api_client/v2/model/product_analytics_monitor_request_type.py new file mode 100644 index 0000000000..acf5d12b9d --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_request_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsMonitorRequestType(ModelSimple): + """ + Product Analytics monitor request resource type. + + :param value: If omitted defaults to "pa_monitor_request". Must be one of ["pa_monitor_request"]. + :type value: str + """ + + allowed_values = { + "pa_monitor_request", + } + PA_MONITOR_REQUEST: ClassVar["ProductAnalyticsMonitorRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsMonitorRequestType.PA_MONITOR_REQUEST = ProductAnalyticsMonitorRequestType("pa_monitor_request") diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_response.py b/src/datadog_api_client/v2/model/product_analytics_monitor_response.py new file mode 100644 index 0000000000..13e217eab1 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_data import ProductAnalyticsMonitorData + + +class ProductAnalyticsMonitorResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_data import ProductAnalyticsMonitorData + + return { + "data": (ProductAnalyticsMonitorData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsMonitorData, **kwargs): + """ + Response containing a Product Analytics monitor. + + :param data: A Product Analytics monitor. + :type data: ProductAnalyticsMonitorData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_status.py b/src/datadog_api_client/v2/model/product_analytics_monitor_status.py new file mode 100644 index 0000000000..bad24c7f25 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_status.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsMonitorStatus(ModelSimple): + """ + Current alert status of the monitor. `No Data` is returned when the monitor has not been evaluated yet. + + :param value: Must be one of ["OK", "Alert", "Warn", "No Data"]. + :type value: str + """ + + allowed_values = { + "OK", + "Alert", + "Warn", + "No Data", + } + OK: ClassVar["ProductAnalyticsMonitorStatus"] + ALERT: ClassVar["ProductAnalyticsMonitorStatus"] + WARN: ClassVar["ProductAnalyticsMonitorStatus"] + NO_DATA: ClassVar["ProductAnalyticsMonitorStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsMonitorStatus.OK = ProductAnalyticsMonitorStatus("OK") +ProductAnalyticsMonitorStatus.ALERT = ProductAnalyticsMonitorStatus("Alert") +ProductAnalyticsMonitorStatus.WARN = ProductAnalyticsMonitorStatus("Warn") +ProductAnalyticsMonitorStatus.NO_DATA = ProductAnalyticsMonitorStatus("No Data") diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_tags.py b/src/datadog_api_client/v2/model/product_analytics_monitor_tags.py new file mode 100644 index 0000000000..044babf923 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_tags.py @@ -0,0 +1,23 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ProductAnalyticsMonitorTags(ModelNormal): + @cached_property + def additional_properties_type(_): + return (str,) + + def __init__(self_, **kwargs): + """ + Monitor tags as key and value pairs. Each pair is stored as a ``key:value`` tag. + ``chart_id`` and ``dashboard_id`` link the monitor to the chart it was created from. ``dashboard_id`` requires ``chart_id``. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_thresholds.py b/src/datadog_api_client/v2/model/product_analytics_monitor_thresholds.py new file mode 100644 index 0000000000..465513f380 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_thresholds.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsMonitorThresholds(ModelNormal): + @cached_property + def openapi_types(_): + return { + "critical": (float,), + "critical_recovery": (float,), + "warning": (float,), + "warning_recovery": (float,), + } + + attribute_map = { + "critical": "critical", + "critical_recovery": "critical_recovery", + "warning": "warning", + "warning_recovery": "warning_recovery", + } + + def __init__( + self_, + critical: Union[float, UnsetType] = unset, + critical_recovery: Union[float, UnsetType] = unset, + warning: Union[float, UnsetType] = unset, + warning_recovery: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + Alert thresholds of a Product Analytics monitor. + Keep ``critical`` in sync with the comparison in the monitor query; the query is not derived from these values. + + :param critical: Value that triggers a critical alert. + :type critical: float, optional + + :param critical_recovery: Value at which a critical alert recovers. + :type critical_recovery: float, optional + + :param warning: Value that triggers a warning. + :type warning: float, optional + + :param warning_recovery: Value at which a warning recovers. + :type warning_recovery: float, optional + """ + if critical is not unset: + kwargs["critical"] = critical + if critical_recovery is not unset: + kwargs["critical_recovery"] = critical_recovery + if warning is not unset: + kwargs["warning"] = warning + if warning_recovery is not unset: + kwargs["warning_recovery"] = warning_recovery + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_type.py b/src/datadog_api_client/v2/model/product_analytics_monitor_type.py new file mode 100644 index 0000000000..0ea8331252 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsMonitorType(ModelSimple): + """ + Product Analytics monitor resource type. + + :param value: If omitted defaults to "pa_monitor". Must be one of ["pa_monitor"]. + :type value: str + """ + + allowed_values = { + "pa_monitor", + } + PA_MONITOR: ClassVar["ProductAnalyticsMonitorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsMonitorType.PA_MONITOR = ProductAnalyticsMonitorType("pa_monitor") diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_attributes.py b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_attributes.py new file mode 100644 index 0000000000..aa25473c16 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_attributes.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProductAnalyticsMonitorUnlinkAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "chart_id": (str,), + "dashboard_id": (str,), + } + + attribute_map = { + "chart_id": "chart_id", + "dashboard_id": "dashboard_id", + } + + def __init__(self_, chart_id: str, dashboard_id: Union[str, UnsetType] = unset, **kwargs): + """ + The chart link to remove. It must match the stored link exactly: + ``chart_id`` alone for a saved chart, or ``chart_id`` and ``dashboard_id`` for a dashboard widget. + + :param chart_id: ID of the chart the monitor is linked to. + :type chart_id: str + + :param dashboard_id: ID of the dashboard the monitor is linked to. + :type dashboard_id: str, optional + """ + if dashboard_id is not unset: + kwargs["dashboard_id"] = dashboard_id + super().__init__(kwargs) + + self_.chart_id = chart_id diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_data.py b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_data.py new file mode 100644 index 0000000000..d0bff26f60 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_data.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_unlink_attributes import ( + ProductAnalyticsMonitorUnlinkAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_unlink_request_type import ( + ProductAnalyticsMonitorUnlinkRequestType, + ) + + +class ProductAnalyticsMonitorUnlinkData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_unlink_attributes import ( + ProductAnalyticsMonitorUnlinkAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_unlink_request_type import ( + ProductAnalyticsMonitorUnlinkRequestType, + ) + + return { + "attributes": (ProductAnalyticsMonitorUnlinkAttributes,), + "type": (ProductAnalyticsMonitorUnlinkRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: ProductAnalyticsMonitorUnlinkAttributes, + type: ProductAnalyticsMonitorUnlinkRequestType, + **kwargs, + ): + """ + Data of the Product Analytics monitor unlink request. + + :param attributes: The chart link to remove. It must match the stored link exactly: + ``chart_id`` alone for a saved chart, or ``chart_id`` and ``dashboard_id`` for a dashboard widget. + :type attributes: ProductAnalyticsMonitorUnlinkAttributes + + :param type: Product Analytics monitor unlink request resource type. + :type type: ProductAnalyticsMonitorUnlinkRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request.py b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request.py new file mode 100644 index 0000000000..cf1ae3bdaa --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_unlink_data import ProductAnalyticsMonitorUnlinkData + + +class ProductAnalyticsMonitorUnlinkRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_unlink_data import ProductAnalyticsMonitorUnlinkData + + return { + "data": (ProductAnalyticsMonitorUnlinkData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsMonitorUnlinkData, **kwargs): + """ + Request to unlink a Product Analytics monitor from its chart. + + :param data: Data of the Product Analytics monitor unlink request. + :type data: ProductAnalyticsMonitorUnlinkData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request_type.py b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request_type.py new file mode 100644 index 0000000000..d4cc4c3378 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_unlink_request_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProductAnalyticsMonitorUnlinkRequestType(ModelSimple): + """ + Product Analytics monitor unlink request resource type. + + :param value: If omitted defaults to "pa_monitor_unlink_request". Must be one of ["pa_monitor_unlink_request"]. + :type value: str + """ + + allowed_values = { + "pa_monitor_unlink_request", + } + PA_MONITOR_UNLINK_REQUEST: ClassVar["ProductAnalyticsMonitorUnlinkRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProductAnalyticsMonitorUnlinkRequestType.PA_MONITOR_UNLINK_REQUEST = ProductAnalyticsMonitorUnlinkRequestType( + "pa_monitor_unlink_request" +) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_update_attributes.py b/src/datadog_api_client/v2/model/product_analytics_monitor_update_attributes.py new file mode 100644 index 0000000000..cb296c88db --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_update_attributes.py @@ -0,0 +1,97 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags + + +class ProductAnalyticsMonitorUpdateAttributes(ModelNormal): + validations = { + "priority": { + "inclusive_maximum": 5, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions + from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags + + return { + "message": (str,), + "name": (str,), + "options": (ProductAnalyticsMonitorOptions,), + "priority": (int,), + "query": (str,), + "tags": (ProductAnalyticsMonitorTags,), + } + + attribute_map = { + "message": "message", + "name": "name", + "options": "options", + "priority": "priority", + "query": "query", + "tags": "tags", + } + + def __init__( + self_, + message: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + options: Union[ProductAnalyticsMonitorOptions, UnsetType] = unset, + priority: Union[int, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + tags: Union[ProductAnalyticsMonitorTags, UnsetType] = unset, + **kwargs, + ): + """ + Attributes to update on a Product Analytics monitor. Fields that are not set are left unchanged. + A set ``options`` or ``tags`` object replaces the stored value. + + :param message: Notification message sent when the monitor alerts. + :type message: str, optional + + :param name: Name of the monitor. + :type name: str, optional + + :param options: Options of a Product Analytics monitor. + :type options: ProductAnalyticsMonitorOptions, optional + + :param priority: Priority of the monitor, from 1 (highest) to 5 (lowest). + :type priority: int, optional + + :param query: Monitor query. + :type query: str, optional + + :param tags: Monitor tags as key and value pairs. Each pair is stored as a ``key:value`` tag. + ``chart_id`` and ``dashboard_id`` link the monitor to the chart it was created from. ``dashboard_id`` requires ``chart_id``. + :type tags: ProductAnalyticsMonitorTags, optional + """ + if message is not unset: + kwargs["message"] = message + if name is not unset: + kwargs["name"] = name + if options is not unset: + kwargs["options"] = options + if priority is not unset: + kwargs["priority"] = priority + if query is not unset: + kwargs["query"] = query + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_update_data.py b/src/datadog_api_client/v2/model/product_analytics_monitor_update_data.py new file mode 100644 index 0000000000..181ad8281c --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_update_data.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_update_attributes import ( + ProductAnalyticsMonitorUpdateAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_request_type import ProductAnalyticsMonitorRequestType + + +class ProductAnalyticsMonitorUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_update_attributes import ( + ProductAnalyticsMonitorUpdateAttributes, + ) + from datadog_api_client.v2.model.product_analytics_monitor_request_type import ( + ProductAnalyticsMonitorRequestType, + ) + + return { + "attributes": (ProductAnalyticsMonitorUpdateAttributes,), + "type": (ProductAnalyticsMonitorRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: ProductAnalyticsMonitorUpdateAttributes, type: ProductAnalyticsMonitorRequestType, **kwargs + ): + """ + Data of the Product Analytics monitor update. + + :param attributes: Attributes to update on a Product Analytics monitor. Fields that are not set are left unchanged. + A set ``options`` or ``tags`` object replaces the stored value. + :type attributes: ProductAnalyticsMonitorUpdateAttributes + + :param type: Product Analytics monitor request resource type. + :type type: ProductAnalyticsMonitorRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_update_request.py b/src/datadog_api_client/v2/model/product_analytics_monitor_update_request.py new file mode 100644 index 0000000000..54811cc7ff --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_monitor_update_data import ProductAnalyticsMonitorUpdateData + + +class ProductAnalyticsMonitorUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_monitor_update_data import ProductAnalyticsMonitorUpdateData + + return { + "data": (ProductAnalyticsMonitorUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProductAnalyticsMonitorUpdateData, **kwargs): + """ + Request to update a Product Analytics monitor. + + :param data: Data of the Product Analytics monitor update. + :type data: ProductAnalyticsMonitorUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/product_analytics_monitor_variable.py b/src/datadog_api_client/v2/model/product_analytics_monitor_variable.py new file mode 100644 index 0000000000..5316d2ced2 --- /dev/null +++ b/src/datadog_api_client/v2/model/product_analytics_monitor_variable.py @@ -0,0 +1,18 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class ProductAnalyticsMonitorVariable(ModelNormal): + def __init__(self_, **kwargs): + """ + A query variable of the monitor, referenced by name in the ``formula(...)`` of the monitor query. + Its shape depends on the ``data_source`` , for example ``product_analytics_journey`` for funnels. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_attributes.py b/src/datadog_api_client/v2/model/segment_attributes.py new file mode 100644 index 0000000000..2a049b156b --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_attributes.py @@ -0,0 +1,176 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_user import SegmentUser + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + +class SegmentAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_user import SegmentUser + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + return { + "created_at": (datetime,), + "created_by": (SegmentUser,), + "data_query": (SegmentDataQuery,), + "description": (str,), + "disabled_at": (datetime,), + "disabled_by": (SegmentUser,), + "entity": (str,), + "materialized_at": (datetime, none_type), + "modified_at": (datetime,), + "modified_by": (SegmentUser,), + "name": (str,), + "org_id": (int,), + "row_count": (int,), + "source": (int,), + "tags": ([str], none_type), + "type": (str,), + "version": (int,), + } + + attribute_map = { + "created_at": "created_at", + "created_by": "created_by", + "data_query": "data_query", + "description": "description", + "disabled_at": "disabled_at", + "disabled_by": "disabled_by", + "entity": "entity", + "materialized_at": "materialized_at", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "org_id": "org_id", + "row_count": "row_count", + "source": "source", + "tags": "tags", + "type": "type", + "version": "version", + } + + def __init__( + self_, + created_at: datetime, + data_query: SegmentDataQuery, + modified_at: datetime, + name: str, + created_by: Union[SegmentUser, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + disabled_at: Union[datetime, UnsetType] = unset, + disabled_by: Union[SegmentUser, UnsetType] = unset, + entity: Union[str, UnsetType] = unset, + materialized_at: Union[datetime, none_type, UnsetType] = unset, + modified_by: Union[SegmentUser, UnsetType] = unset, + org_id: Union[int, UnsetType] = unset, + row_count: Union[int, UnsetType] = unset, + source: Union[int, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + version: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a segment. + + :param created_at: Time the segment was created. + :type created_at: datetime + + :param created_by: A Datadog user who created, modified, or disabled a segment. + :type created_by: SegmentUser, optional + + :param data_query: Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use ``combination`` to combine named blocks with a boolean formula such as ``A AND NOT B``. + :type data_query: SegmentDataQuery + + :param description: Description of the segment. + :type description: str, optional + + :param disabled_at: Time the segment was disabled, if it was. + :type disabled_at: datetime, optional + + :param disabled_by: A Datadog user who created, modified, or disabled a segment. + :type disabled_by: SegmentUser, optional + + :param entity: Kind of entity that the segment contains, ``user`` or ``account``. + :type entity: str, optional + + :param materialized_at: Time the segment membership was last computed. + :type materialized_at: datetime, none_type, optional + + :param modified_at: Time the segment was last modified. + :type modified_at: datetime + + :param modified_by: A Datadog user who created, modified, or disabled a segment. + :type modified_by: SegmentUser, optional + + :param name: Name of the segment. + :type name: str + + :param org_id: ID of the organization that owns the segment. + :type org_id: int, optional + + :param row_count: Number of entities in the segment when its membership was last computed. ``-1`` when the count is not available yet. + :type row_count: int, optional + + :param source: Who created the segment. ``0`` for a user and ``1`` for Datadog. + :type source: int, optional + + :param tags: Tags of the segment. + :type tags: [str], none_type, optional + + :param type: Kind of segment, derived from its blocks, such as ``event_platform`` , ``user_store`` , or ``combination``. + :type type: str, optional + + :param version: Version of the segment, increased on each update. + :type version: int, optional + """ + if created_by is not unset: + kwargs["created_by"] = created_by + if description is not unset: + kwargs["description"] = description + if disabled_at is not unset: + kwargs["disabled_at"] = disabled_at + if disabled_by is not unset: + kwargs["disabled_by"] = disabled_by + if entity is not unset: + kwargs["entity"] = entity + if materialized_at is not unset: + kwargs["materialized_at"] = materialized_at + if modified_by is not unset: + kwargs["modified_by"] = modified_by + if org_id is not unset: + kwargs["org_id"] = org_id + if row_count is not unset: + kwargs["row_count"] = row_count + if source is not unset: + kwargs["source"] = source + if tags is not unset: + kwargs["tags"] = tags + if type is not unset: + kwargs["type"] = type + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.created_at = created_at + self_.data_query = data_query + self_.modified_at = modified_at + self_.name = name diff --git a/src/datadog_api_client/v2/model/segment_create_attributes.py b/src/datadog_api_client/v2/model/segment_create_attributes.py new file mode 100644 index 0000000000..59c1ddd293 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_create_attributes.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + +class SegmentCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + return { + "data_query": (SegmentDataQuery,), + "description": (str,), + "name": (str,), + "tags": ([str],), + } + + attribute_map = { + "data_query": "data_query", + "description": "description", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + data_query: SegmentDataQuery, + name: str, + description: Union[str, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the segment to create. + + :param data_query: Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use ``combination`` to combine named blocks with a boolean formula such as ``A AND NOT B``. + :type data_query: SegmentDataQuery + + :param description: Description of the segment. + :type description: str, optional + + :param name: Name of the segment. It must be unique in the organization. + :type name: str + + :param tags: Tags of the segment. Tags cannot contain commas. + :type tags: [str], optional + """ + if description is not unset: + kwargs["description"] = description + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.data_query = data_query + self_.name = name diff --git a/src/datadog_api_client/v2/model/segment_create_data.py b/src/datadog_api_client/v2/model/segment_create_data.py new file mode 100644 index 0000000000..3580c41d51 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_create_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_create_attributes import SegmentCreateAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + +class SegmentCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_create_attributes import SegmentCreateAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + return { + "attributes": (SegmentCreateAttributes,), + "type": (SegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: SegmentCreateAttributes, type: SegmentResourceType, **kwargs): + """ + Data of the segment to create. + + :param attributes: Attributes of the segment to create. + :type attributes: SegmentCreateAttributes + + :param type: Segment resource type. + :type type: SegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_create_request.py b/src/datadog_api_client/v2/model/segment_create_request.py new file mode 100644 index 0000000000..8751ad7feb --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_create_data import SegmentCreateData + + +class SegmentCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_create_data import SegmentCreateData + + return { + "data": (SegmentCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentCreateData, **kwargs): + """ + Request to create a segment. + + :param data: Data of the segment to create. + :type data: SegmentCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_data.py b/src/datadog_api_client/v2/model/segment_data.py new file mode 100644 index 0000000000..2763b93276 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_attributes import SegmentAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + +class SegmentData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_attributes import SegmentAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + return { + "attributes": (SegmentAttributes,), + "id": (str,), + "type": (SegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: SegmentAttributes, id: str, type: SegmentResourceType, **kwargs): + """ + A segment. + + :param attributes: Attributes of a segment. + :type attributes: SegmentAttributes + + :param id: ID of the segment. + :type id: str + + :param type: Segment resource type. + :type type: SegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_data_query.py b/src/datadog_api_client/v2/model/segment_data_query.py new file mode 100644 index 0000000000..ec2c80d0cc --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_data_query.py @@ -0,0 +1,123 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_profile_store_block import SegmentProfileStoreBlock + from datadog_api_client.v2.model.segment_event_platform_block import SegmentEventPlatformBlock + from datadog_api_client.v2.model.segment_journey_block import SegmentJourneyBlock + from datadog_api_client.v2.model.segment_reference_table_block import SegmentReferenceTableBlock + from datadog_api_client.v2.model.segment_retention_block import SegmentRetentionBlock + from datadog_api_client.v2.model.segment_static_block import SegmentStaticBlock + from datadog_api_client.v2.model.segment_template_block import SegmentTemplateBlock + + +class SegmentDataQuery(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_profile_store_block import SegmentProfileStoreBlock + from datadog_api_client.v2.model.segment_event_platform_block import SegmentEventPlatformBlock + from datadog_api_client.v2.model.segment_journey_block import SegmentJourneyBlock + from datadog_api_client.v2.model.segment_reference_table_block import SegmentReferenceTableBlock + from datadog_api_client.v2.model.segment_retention_block import SegmentRetentionBlock + from datadog_api_client.v2.model.segment_static_block import SegmentStaticBlock + from datadog_api_client.v2.model.segment_template_block import SegmentTemplateBlock + + return { + "account_store": ([SegmentProfileStoreBlock],), + "combination": (str,), + "event_platform": ([SegmentEventPlatformBlock],), + "journeys": ([SegmentJourneyBlock],), + "reference_table": ([SegmentReferenceTableBlock],), + "retentions": ([SegmentRetentionBlock],), + "static": ([SegmentStaticBlock],), + "templates": ([SegmentTemplateBlock],), + "user_store": ([SegmentProfileStoreBlock],), + } + + attribute_map = { + "account_store": "account_store", + "combination": "combination", + "event_platform": "event_platform", + "journeys": "journeys", + "reference_table": "reference_table", + "retentions": "retentions", + "static": "static", + "templates": "templates", + "user_store": "user_store", + } + + def __init__( + self_, + account_store: Union[List[SegmentProfileStoreBlock], UnsetType] = unset, + combination: Union[str, UnsetType] = unset, + event_platform: Union[List[SegmentEventPlatformBlock], UnsetType] = unset, + journeys: Union[List[SegmentJourneyBlock], UnsetType] = unset, + reference_table: Union[List[SegmentReferenceTableBlock], UnsetType] = unset, + retentions: Union[List[SegmentRetentionBlock], UnsetType] = unset, + static: Union[List[SegmentStaticBlock], UnsetType] = unset, + templates: Union[List[SegmentTemplateBlock], UnsetType] = unset, + user_store: Union[List[SegmentProfileStoreBlock], UnsetType] = unset, + **kwargs, + ): + """ + Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use ``combination`` to combine named blocks with a boolean formula such as ``A AND NOT B``. + + :param account_store: Account profile blocks. + :type account_store: [SegmentProfileStoreBlock], optional + + :param combination: Boolean formula that combines blocks by name. + :type combination: str, optional + + :param event_platform: Event blocks. + :type event_platform: [SegmentEventPlatformBlock], optional + + :param journeys: Funnel blocks. + :type journeys: [SegmentJourneyBlock], optional + + :param reference_table: Reference table blocks. + :type reference_table: [SegmentReferenceTableBlock], optional + + :param retentions: Retention blocks. + :type retentions: [SegmentRetentionBlock], optional + + :param static: Uploaded list blocks. + :type static: [SegmentStaticBlock], optional + + :param templates: Template blocks. + :type templates: [SegmentTemplateBlock], optional + + :param user_store: User profile blocks. + :type user_store: [SegmentProfileStoreBlock], optional + """ + if account_store is not unset: + kwargs["account_store"] = account_store + if combination is not unset: + kwargs["combination"] = combination + if event_platform is not unset: + kwargs["event_platform"] = event_platform + if journeys is not unset: + kwargs["journeys"] = journeys + if reference_table is not unset: + kwargs["reference_table"] = reference_table + if retentions is not unset: + kwargs["retentions"] = retentions + if static is not unset: + kwargs["static"] = static + if templates is not unset: + kwargs["templates"] = templates + if user_store is not unset: + kwargs["user_store"] = user_store + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_delete_attributes.py b/src/datadog_api_client/v2/model/segment_delete_attributes.py new file mode 100644 index 0000000000..a07082488c --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_delete_attributes.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_user import SegmentUser + + +class SegmentDeleteAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_user import SegmentUser + + return { + "disabled_at": (datetime,), + "disabled_by": (SegmentUser,), + "name": (str,), + } + + attribute_map = { + "disabled_at": "disabled_at", + "disabled_by": "disabled_by", + "name": "name", + } + + def __init__(self_, disabled_at: datetime, name: str, disabled_by: Union[SegmentUser, UnsetType] = unset, **kwargs): + """ + Attributes of a deleted segment. + + :param disabled_at: Time the segment was deleted. + :type disabled_at: datetime + + :param disabled_by: A Datadog user who created, modified, or disabled a segment. + :type disabled_by: SegmentUser, optional + + :param name: Name of the segment. + :type name: str + """ + if disabled_by is not unset: + kwargs["disabled_by"] = disabled_by + super().__init__(kwargs) + + self_.disabled_at = disabled_at + self_.name = name diff --git a/src/datadog_api_client/v2/model/segment_delete_data.py b/src/datadog_api_client/v2/model/segment_delete_data.py new file mode 100644 index 0000000000..bedbd34c80 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_delete_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_delete_attributes import SegmentDeleteAttributes + from datadog_api_client.v2.model.segment_deleted_type import SegmentDeletedType + + +class SegmentDeleteData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_delete_attributes import SegmentDeleteAttributes + from datadog_api_client.v2.model.segment_deleted_type import SegmentDeletedType + + return { + "attributes": (SegmentDeleteAttributes,), + "id": (str,), + "type": (SegmentDeletedType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: SegmentDeleteAttributes, id: str, type: SegmentDeletedType, **kwargs): + """ + A deleted segment. + + :param attributes: Attributes of a deleted segment. + :type attributes: SegmentDeleteAttributes + + :param id: ID of the segment. + :type id: str + + :param type: Deleted segment resource type. + :type type: SegmentDeletedType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_delete_response.py b/src/datadog_api_client/v2/model/segment_delete_response.py new file mode 100644 index 0000000000..f0d668ffe1 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_delete_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_delete_data import SegmentDeleteData + + +class SegmentDeleteResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_delete_data import SegmentDeleteData + + return { + "data": (SegmentDeleteData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentDeleteData, **kwargs): + """ + Response returned when a segment is deleted. + + :param data: A deleted segment. + :type data: SegmentDeleteData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_deleted_type.py b/src/datadog_api_client/v2/model/segment_deleted_type.py new file mode 100644 index 0000000000..d8eacbcd3c --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_deleted_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentDeletedType(ModelSimple): + """ + Deleted segment resource type. + + :param value: If omitted defaults to "deleted_segment". Must be one of ["deleted_segment"]. + :type value: str + """ + + allowed_values = { + "deleted_segment", + } + DELETED_SEGMENT: ClassVar["SegmentDeletedType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentDeletedType.DELETED_SEGMENT = SegmentDeletedType("deleted_segment") diff --git a/src/datadog_api_client/v2/model/segment_entity.py b/src/datadog_api_client/v2/model/segment_entity.py new file mode 100644 index 0000000000..ac0d7bc5bb --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_entity.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentEntity(ModelSimple): + """ + Kind of entity that a segment contains. + + :param value: Must be one of ["user", "account"]. + :type value: str + """ + + allowed_values = { + "user", + "account", + } + USER: ClassVar["SegmentEntity"] + ACCOUNT: ClassVar["SegmentEntity"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentEntity.USER = SegmentEntity("user") +SegmentEntity.ACCOUNT = SegmentEntity("account") diff --git a/src/datadog_api_client/v2/model/segment_event_platform_block.py b/src/datadog_api_client/v2/model/segment_event_platform_block.py new file mode 100644 index 0000000000..cea1d88152 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_event_platform_block.py @@ -0,0 +1,73 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentEventPlatformBlock(ModelNormal): + @cached_property + def openapi_types(_): + return { + "facet": (str,), + "_from": (str,), + "name": (str,), + "query": (str,), + "to": (str,), + } + + attribute_map = { + "facet": "facet", + "_from": "from", + "name": "name", + "query": "query", + "to": "to", + } + + def __init__( + self_, + facet: str, + _from: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + to: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Selects the users or accounts that sent matching RUM or Product Analytics events in a time range. + ``from`` and ``to`` are epoch milliseconds, or negative offsets in milliseconds relative to now. ``0`` means now. + + :param facet: Facet that identifies the entity, such as ``@usr.id``. + :type facet: str + + :param _from: Start of the time range. + :type _from: str, optional + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param query: Event search query. + :type query: str, optional + + :param to: End of the time range. + :type to: str, optional + """ + if _from is not unset: + kwargs["_from"] = _from + if name is not unset: + kwargs["name"] = name + if query is not unset: + kwargs["query"] = query + if to is not unset: + kwargs["to"] = to + super().__init__(kwargs) + + self_.facet = facet diff --git a/src/datadog_api_client/v2/model/segment_journey_block.py b/src/datadog_api_client/v2/model/segment_journey_block.py new file mode 100644 index 0000000000..85ba618cba --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_journey_block.py @@ -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. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.product_analytics_journey_conversion_type import ( + ProductAnalyticsJourneyConversionType, + ) + + +class SegmentJourneyBlock(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.product_analytics_journey_conversion_type import ( + ProductAnalyticsJourneyConversionType, + ) + + return { + "conversion_type": (ProductAnalyticsJourneyConversionType,), + "exclude_anonymous_traffic": (bool,), + "_from": (int,), + "group_by": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + "name": (str,), + "search": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "target": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "to": (int,), + } + + attribute_map = { + "conversion_type": "conversion_type", + "exclude_anonymous_traffic": "exclude_anonymous_traffic", + "_from": "from", + "group_by": "group_by", + "name": "name", + "search": "search", + "target": "target", + "to": "to", + } + + def __init__( + self_, + conversion_type: Union[ProductAnalyticsJourneyConversionType, UnsetType] = unset, + exclude_anonymous_traffic: Union[bool, UnsetType] = unset, + _from: Union[int, UnsetType] = unset, + group_by: Union[List[Dict[str, Any]], UnsetType] = unset, + name: Union[str, UnsetType] = unset, + search: Union[Dict[str, Any], UnsetType] = unset, + target: Union[Dict[str, Any], UnsetType] = unset, + to: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Selects the users who converted or dropped off in a funnel. + + :param conversion_type: Whether to return the entities that converted at the target step, or those that dropped off. + :type conversion_type: ProductAnalyticsJourneyConversionType, optional + + :param exclude_anonymous_traffic: Whether to leave out anonymous users. + :type exclude_anonymous_traffic: bool, optional + + :param _from: Start of the time range, in epoch milliseconds. + :type _from: int, optional + + :param group_by: Group-by definitions of the funnel query. + :type group_by: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}], optional + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param search: Funnel search, with the same shape as the ``search`` of a Product Analytics journey query. + :type search: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + + :param target: Funnel step or step range to evaluate. + :type target: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + + :param to: End of the time range, in epoch milliseconds. + :type to: int, optional + """ + if conversion_type is not unset: + kwargs["conversion_type"] = conversion_type + if exclude_anonymous_traffic is not unset: + kwargs["exclude_anonymous_traffic"] = exclude_anonymous_traffic + if _from is not unset: + kwargs["_from"] = _from + if group_by is not unset: + kwargs["group_by"] = group_by + if name is not unset: + kwargs["name"] = name + if search is not unset: + kwargs["search"] = search + if target is not unset: + kwargs["target"] = target + if to is not unset: + kwargs["to"] = to + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_preview_attributes.py b/src/datadog_api_client/v2/model/segment_preview_attributes.py new file mode 100644 index 0000000000..6ed57e4f2d --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_attributes.py @@ -0,0 +1,86 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + +class SegmentPreviewAttributes(ModelNormal): + validations = { + "limit": { + "inclusive_maximum": 1000, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + return { + "account_store_columns": ([str],), + "data_query": (SegmentDataQuery,), + "limit": (int,), + "reference_table_columns": ([str],), + "user_store_columns": ([str],), + } + + attribute_map = { + "account_store_columns": "account_store_columns", + "data_query": "data_query", + "limit": "limit", + "reference_table_columns": "reference_table_columns", + "user_store_columns": "user_store_columns", + } + + def __init__( + self_, + data_query: SegmentDataQuery, + account_store_columns: Union[List[str], UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + reference_table_columns: Union[List[str], UnsetType] = unset, + user_store_columns: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Segment definition to preview and the columns to return. + Without columns, the response returns the user ID, or the account ID for account segments. + + :param account_store_columns: Account profile columns to return. + :type account_store_columns: [str], optional + + :param data_query: Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use ``combination`` to combine named blocks with a boolean formula such as ``A AND NOT B``. + :type data_query: SegmentDataQuery + + :param limit: Maximum number of rows to return, up to 1000. Defaults to 1000. + :type limit: int, optional + + :param reference_table_columns: Reference table columns to return. + :type reference_table_columns: [str], optional + + :param user_store_columns: User profile columns to return. + :type user_store_columns: [str], optional + """ + if account_store_columns is not unset: + kwargs["account_store_columns"] = account_store_columns + if limit is not unset: + kwargs["limit"] = limit + if reference_table_columns is not unset: + kwargs["reference_table_columns"] = reference_table_columns + if user_store_columns is not unset: + kwargs["user_store_columns"] = user_store_columns + super().__init__(kwargs) + + self_.data_query = data_query diff --git a/src/datadog_api_client/v2/model/segment_preview_data.py b/src/datadog_api_client/v2/model/segment_preview_data.py new file mode 100644 index 0000000000..09f492ba4c --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_data.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_preview_attributes import SegmentPreviewAttributes + from datadog_api_client.v2.model.segment_preview_request_type import SegmentPreviewRequestType + + +class SegmentPreviewData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_preview_attributes import SegmentPreviewAttributes + from datadog_api_client.v2.model.segment_preview_request_type import SegmentPreviewRequestType + + return { + "attributes": (SegmentPreviewAttributes,), + "type": (SegmentPreviewRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: SegmentPreviewAttributes, type: SegmentPreviewRequestType, **kwargs): + """ + Data of the segment preview request. + + :param attributes: Segment definition to preview and the columns to return. + Without columns, the response returns the user ID, or the account ID for account segments. + :type attributes: SegmentPreviewAttributes + + :param type: Segment preview request resource type. + :type type: SegmentPreviewRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_preview_request.py b/src/datadog_api_client/v2/model/segment_preview_request.py new file mode 100644 index 0000000000..7d52362052 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_preview_data import SegmentPreviewData + + +class SegmentPreviewRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_preview_data import SegmentPreviewData + + return { + "data": (SegmentPreviewData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentPreviewData, **kwargs): + """ + Request to preview the members of a segment definition. + + :param data: Data of the segment preview request. + :type data: SegmentPreviewData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_preview_request_type.py b/src/datadog_api_client/v2/model/segment_preview_request_type.py new file mode 100644 index 0000000000..ed57868472 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_request_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentPreviewRequestType(ModelSimple): + """ + Segment preview request resource type. + + :param value: If omitted defaults to "segment_preview_request". Must be one of ["segment_preview_request"]. + :type value: str + """ + + allowed_values = { + "segment_preview_request", + } + SEGMENT_PREVIEW_REQUEST: ClassVar["SegmentPreviewRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentPreviewRequestType.SEGMENT_PREVIEW_REQUEST = SegmentPreviewRequestType("segment_preview_request") diff --git a/src/datadog_api_client/v2/model/segment_preview_response.py b/src/datadog_api_client/v2/model/segment_preview_response.py new file mode 100644 index 0000000000..b1ceb69631 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_preview_response_data import SegmentPreviewResponseData + + +class SegmentPreviewResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_preview_response_data import SegmentPreviewResponseData + + return { + "data": (SegmentPreviewResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentPreviewResponseData, **kwargs): + """ + Response containing a preview of the members of a segment. + + :param data: Data of the segment preview response. + :type data: SegmentPreviewResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_preview_response_attributes.py b/src/datadog_api_client/v2/model/segment_preview_response_attributes.py new file mode 100644 index 0000000000..2a118b798a --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_response_attributes.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class SegmentPreviewResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "hits": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + "total_rows": (int,), + } + + attribute_map = { + "hits": "hits", + "total_rows": "total_rows", + } + + def __init__(self_, hits: List[Dict[str, Any]], total_rows: int, **kwargs): + """ + Members of the previewed segment. + + :param hits: Rows of the preview, each as a map of column names to values. + :type hits: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}] + + :param total_rows: Total number of entities in the segment. + :type total_rows: int + """ + super().__init__(kwargs) + + self_.hits = hits + self_.total_rows = total_rows diff --git a/src/datadog_api_client/v2/model/segment_preview_response_data.py b/src/datadog_api_client/v2/model/segment_preview_response_data.py new file mode 100644 index 0000000000..594ebe2516 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_response_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_preview_response_attributes import SegmentPreviewResponseAttributes + from datadog_api_client.v2.model.segment_preview_response_type import SegmentPreviewResponseType + + +class SegmentPreviewResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_preview_response_attributes import SegmentPreviewResponseAttributes + from datadog_api_client.v2.model.segment_preview_response_type import SegmentPreviewResponseType + + return { + "attributes": (SegmentPreviewResponseAttributes,), + "id": (str,), + "type": (SegmentPreviewResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: SegmentPreviewResponseAttributes, id: str, type: SegmentPreviewResponseType, **kwargs + ): + """ + Data of the segment preview response. + + :param attributes: Members of the previewed segment. + :type attributes: SegmentPreviewResponseAttributes + + :param id: ID of the preview response. + :type id: str + + :param type: Segment preview response resource type. + :type type: SegmentPreviewResponseType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_preview_response_type.py b/src/datadog_api_client/v2/model/segment_preview_response_type.py new file mode 100644 index 0000000000..8b3b602a02 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_preview_response_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentPreviewResponseType(ModelSimple): + """ + Segment preview response resource type. + + :param value: If omitted defaults to "unified_segment_preview_response". Must be one of ["unified_segment_preview_response"]. + :type value: str + """ + + allowed_values = { + "unified_segment_preview_response", + } + UNIFIED_SEGMENT_PREVIEW_RESPONSE: ClassVar["SegmentPreviewResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentPreviewResponseType.UNIFIED_SEGMENT_PREVIEW_RESPONSE = SegmentPreviewResponseType( + "unified_segment_preview_response" +) diff --git a/src/datadog_api_client/v2/model/segment_profile_store_block.py b/src/datadog_api_client/v2/model/segment_profile_store_block.py new file mode 100644 index 0000000000..df3a7167ec --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_profile_store_block.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentProfileStoreBlock(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "query": (str,), + } + + attribute_map = { + "name": "name", + "query": "query", + } + + def __init__(self_, query: str, name: Union[str, UnsetType] = unset, **kwargs): + """ + Selects users or accounts by their profile attributes. + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param query: Profile attribute query. + :type query: str + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.query = query diff --git a/src/datadog_api_client/v2/model/segment_reference_table_block.py b/src/datadog_api_client/v2/model/segment_reference_table_block.py new file mode 100644 index 0000000000..0b49138177 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_reference_table_block.py @@ -0,0 +1,81 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_reference_table_column import SegmentReferenceTableColumn + from datadog_api_client.v2.model.segment_reference_table_join_condition import SegmentReferenceTableJoinCondition + + +class SegmentReferenceTableBlock(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_reference_table_column import SegmentReferenceTableColumn + from datadog_api_client.v2.model.segment_reference_table_join_condition import ( + SegmentReferenceTableJoinCondition, + ) + + return { + "columns": ([SegmentReferenceTableColumn],), + "filter_query": (str,), + "join_condition": (SegmentReferenceTableJoinCondition,), + "name": (str,), + "table_name": (str,), + } + + attribute_map = { + "columns": "columns", + "filter_query": "filter_query", + "join_condition": "join_condition", + "name": "name", + "table_name": "table_name", + } + + def __init__( + self_, + join_condition: SegmentReferenceTableJoinCondition, + table_name: str, + columns: Union[List[SegmentReferenceTableColumn], UnsetType] = unset, + filter_query: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Selects users or accounts from a reference table. + + :param columns: Columns to include. + :type columns: [SegmentReferenceTableColumn], optional + + :param filter_query: Query that filters the reference table rows. + :type filter_query: str, optional + + :param join_condition: How reference table rows are matched to entities. + :type join_condition: SegmentReferenceTableJoinCondition + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param table_name: Name of the reference table. + :type table_name: str + """ + if columns is not unset: + kwargs["columns"] = columns + if filter_query is not unset: + kwargs["filter_query"] = filter_query + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.join_condition = join_condition + self_.table_name = table_name diff --git a/src/datadog_api_client/v2/model/segment_reference_table_column.py b/src/datadog_api_client/v2/model/segment_reference_table_column.py new file mode 100644 index 0000000000..189569a347 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_reference_table_column.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentReferenceTableColumn(ModelNormal): + @cached_property + def openapi_types(_): + return { + "alias": (str,), + "name": (str,), + } + + attribute_map = { + "alias": "alias", + "name": "name", + } + + def __init__(self_, alias: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + """ + A reference table column to include. + + :param alias: Name to use for the column. + :type alias: str, optional + + :param name: Name of the column in the reference table. + :type name: str, optional + """ + if alias is not unset: + kwargs["alias"] = alias + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_reference_table_join_condition.py b/src/datadog_api_client/v2/model/segment_reference_table_join_condition.py new file mode 100644 index 0000000000..8205bac38b --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_reference_table_join_condition.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentReferenceTableJoinCondition(ModelNormal): + @cached_property + def openapi_types(_): + return { + "column_name": (str,), + "facet": (str,), + } + + attribute_map = { + "column_name": "column_name", + "facet": "facet", + } + + def __init__(self_, column_name: str, facet: Union[str, UnsetType] = unset, **kwargs): + """ + How reference table rows are matched to entities. + + :param column_name: Reference table column that holds the entity ID. + :type column_name: str + + :param facet: Facet that identifies the entity, such as ``@usr.id``. + :type facet: str, optional + """ + if facet is not unset: + kwargs["facet"] = facet + super().__init__(kwargs) + + self_.column_name = column_name diff --git a/src/datadog_api_client/v2/model/segment_resource_type.py b/src/datadog_api_client/v2/model/segment_resource_type.py new file mode 100644 index 0000000000..ef03f59ecd --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentResourceType(ModelSimple): + """ + Segment resource type. + + :param value: If omitted defaults to "segment". Must be one of ["segment"]. + :type value: str + """ + + allowed_values = { + "segment", + } + SEGMENT: ClassVar["SegmentResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentResourceType.SEGMENT = SegmentResourceType("segment") diff --git a/src/datadog_api_client/v2/model/segment_response.py b/src/datadog_api_client/v2/model/segment_response.py new file mode 100644 index 0000000000..f49664717f --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_data import SegmentData + + +class SegmentResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_data import SegmentData + + return { + "data": (SegmentData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentData, **kwargs): + """ + Response containing a segment. + + :param data: A segment. + :type data: SegmentData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_retention_block.py b/src/datadog_api_client/v2/model/segment_retention_block.py new file mode 100644 index 0000000000..fd19ab804f --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_retention_block.py @@ -0,0 +1,17 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class SegmentRetentionBlock(ModelNormal): + def __init__(self_, **kwargs): + """ + Selects users from a retention query. It has the same fields as a Product Analytics retention query, plus a ``name``. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_sort_column.py b/src/datadog_api_client/v2/model/segment_sort_column.py new file mode 100644 index 0000000000..d08409038d --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_sort_column.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SegmentSortColumn(ModelSimple): + """ + Column to sort segments by. + + :param value: Must be one of ["name", "description", "created_by", "created_at", "modified_by", "modified_at", "disabled_by", "disabled_at", "uuid"]. + :type value: str + """ + + allowed_values = { + "name", + "description", + "created_by", + "created_at", + "modified_by", + "modified_at", + "disabled_by", + "disabled_at", + "uuid", + } + NAME: ClassVar["SegmentSortColumn"] + DESCRIPTION: ClassVar["SegmentSortColumn"] + CREATED_BY: ClassVar["SegmentSortColumn"] + CREATED_AT: ClassVar["SegmentSortColumn"] + MODIFIED_BY: ClassVar["SegmentSortColumn"] + MODIFIED_AT: ClassVar["SegmentSortColumn"] + DISABLED_BY: ClassVar["SegmentSortColumn"] + DISABLED_AT: ClassVar["SegmentSortColumn"] + UUID: ClassVar["SegmentSortColumn"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SegmentSortColumn.NAME = SegmentSortColumn("name") +SegmentSortColumn.DESCRIPTION = SegmentSortColumn("description") +SegmentSortColumn.CREATED_BY = SegmentSortColumn("created_by") +SegmentSortColumn.CREATED_AT = SegmentSortColumn("created_at") +SegmentSortColumn.MODIFIED_BY = SegmentSortColumn("modified_by") +SegmentSortColumn.MODIFIED_AT = SegmentSortColumn("modified_at") +SegmentSortColumn.DISABLED_BY = SegmentSortColumn("disabled_by") +SegmentSortColumn.DISABLED_AT = SegmentSortColumn("disabled_at") +SegmentSortColumn.UUID = SegmentSortColumn("uuid") diff --git a/src/datadog_api_client/v2/model/segment_static_block.py b/src/datadog_api_client/v2/model/segment_static_block.py new file mode 100644 index 0000000000..c436b640bf --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_static_block.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentStaticBlock(ModelNormal): + validations = { + "user_count": { + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + return { + "id": (str,), + "name": (str,), + "user_count": (int,), + } + + attribute_map = { + "id": "id", + "name": "name", + "user_count": "user_count", + } + + def __init__( + self_, + id: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + user_count: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A fixed list of users uploaded to Datadog. + + :param id: ID of the uploaded list. + :type id: str, optional + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param user_count: Number of users in the list. + :type user_count: int, optional + """ + if id is not unset: + kwargs["id"] = id + if name is not unset: + kwargs["name"] = name + if user_count is not unset: + kwargs["user_count"] = user_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_summary_attributes.py b/src/datadog_api_client/v2/model/segment_summary_attributes.py new file mode 100644 index 0000000000..17fc08174f --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_summary_attributes.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_user import SegmentUser + + +class SegmentSummaryAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_user import SegmentUser + + return { + "created_at": (datetime,), + "created_by": (SegmentUser,), + "description": (str,), + "entity": (str,), + "modified_at": (datetime,), + "modified_by": (SegmentUser,), + "name": (str,), + "org_id": (int,), + "row_count": (int,), + "source": (int,), + "tags": ([str], none_type), + "type": (str,), + } + + attribute_map = { + "created_at": "created_at", + "created_by": "created_by", + "description": "description", + "entity": "entity", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "org_id": "org_id", + "row_count": "row_count", + "source": "source", + "tags": "tags", + "type": "type", + } + + def __init__( + self_, + created_at: datetime, + modified_at: datetime, + name: str, + created_by: Union[SegmentUser, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + entity: Union[str, UnsetType] = unset, + modified_by: Union[SegmentUser, UnsetType] = unset, + org_id: Union[int, UnsetType] = unset, + row_count: Union[int, UnsetType] = unset, + source: Union[int, UnsetType] = unset, + tags: Union[List[str], none_type, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a segment in a list. The segment definition is not included. + + :param created_at: Time the segment was created. + :type created_at: datetime + + :param created_by: A Datadog user who created, modified, or disabled a segment. + :type created_by: SegmentUser, optional + + :param description: Description of the segment. + :type description: str, optional + + :param entity: Kind of entity that the segment contains, ``user`` or ``account``. + :type entity: str, optional + + :param modified_at: Time the segment was last modified. + :type modified_at: datetime + + :param modified_by: A Datadog user who created, modified, or disabled a segment. + :type modified_by: SegmentUser, optional + + :param name: Name of the segment. + :type name: str + + :param org_id: ID of the organization that owns the segment. + :type org_id: int, optional + + :param row_count: Number of entities in the segment when its membership was last computed. ``-1`` when the count is not available yet. + :type row_count: int, optional + + :param source: Who created the segment. ``0`` for a user and ``1`` for Datadog. + :type source: int, optional + + :param tags: Tags of the segment. + :type tags: [str], none_type, optional + + :param type: Kind of segment, derived from its blocks. + :type type: str, optional + """ + if created_by is not unset: + kwargs["created_by"] = created_by + if description is not unset: + kwargs["description"] = description + if entity is not unset: + kwargs["entity"] = entity + if modified_by is not unset: + kwargs["modified_by"] = modified_by + if org_id is not unset: + kwargs["org_id"] = org_id + if row_count is not unset: + kwargs["row_count"] = row_count + if source is not unset: + kwargs["source"] = source + if tags is not unset: + kwargs["tags"] = tags + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) + + self_.created_at = created_at + self_.modified_at = modified_at + self_.name = name diff --git a/src/datadog_api_client/v2/model/segment_summary_data.py b/src/datadog_api_client/v2/model/segment_summary_data.py new file mode 100644 index 0000000000..78bbb61926 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_summary_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_summary_attributes import SegmentSummaryAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + +class SegmentSummaryData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_summary_attributes import SegmentSummaryAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + return { + "attributes": (SegmentSummaryAttributes,), + "id": (str,), + "type": (SegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: SegmentSummaryAttributes, id: str, type: SegmentResourceType, **kwargs): + """ + A segment in a list. + + :param attributes: Attributes of a segment in a list. The segment definition is not included. + :type attributes: SegmentSummaryAttributes + + :param id: ID of the segment. + :type id: str + + :param type: Segment resource type. + :type type: SegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_template_block.py b/src/datadog_api_client/v2/model/segment_template_block.py new file mode 100644 index 0000000000..45d7a031cf --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_template_block.py @@ -0,0 +1,90 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class SegmentTemplateBlock(ModelNormal): + @cached_property + def openapi_types(_): + return { + "_from": (str,), + "name": (str,), + "parameters": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "template_id": (str,), + "to": (str,), + } + + attribute_map = { + "_from": "from", + "name": "name", + "parameters": "parameters", + "template_id": "template_id", + "to": "to", + } + + def __init__( + self_, + parameters: Dict[str, Any], + template_id: str, + _from: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + to: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Selects users or accounts with a segment template. + + :param _from: Start of the time range, in epoch milliseconds. + :type _from: str, optional + + :param name: Name of the block, used in ``combination``. + :type name: str, optional + + :param parameters: Template parameter values, keyed by parameter name. + :type parameters: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + + :param template_id: ID of the segment template, such as ``time-spent-v1``. + :type template_id: str + + :param to: End of the time range, in epoch milliseconds. + :type to: str, optional + """ + if _from is not unset: + kwargs["_from"] = _from + if name is not unset: + kwargs["name"] = name + if to is not unset: + kwargs["to"] = to + super().__init__(kwargs) + + self_.parameters = parameters + self_.template_id = template_id diff --git a/src/datadog_api_client/v2/model/segment_update_attributes.py b/src/datadog_api_client/v2/model/segment_update_attributes.py new file mode 100644 index 0000000000..623c391199 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_update_attributes.py @@ -0,0 +1,71 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + +class SegmentUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery + + return { + "data_query": (SegmentDataQuery,), + "description": (str,), + "name": (str,), + "tags": ([str],), + } + + attribute_map = { + "data_query": "data_query", + "description": "description", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + data_query: Union[SegmentDataQuery, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes to update on a segment. Fields that are not set are left unchanged. + + :param data_query: Defines who belongs to the segment. It contains one or more blocks, up to 20 in total. + Use ``combination`` to combine named blocks with a boolean formula such as ``A AND NOT B``. + :type data_query: SegmentDataQuery, optional + + :param description: Description of the segment. + :type description: str, optional + + :param name: Name of the segment. It must be unique in the organization. + :type name: str, optional + + :param tags: Tags of the segment. Replaces the stored tags. + :type tags: [str], optional + """ + if data_query is not unset: + kwargs["data_query"] = data_query + if description is not unset: + kwargs["description"] = description + if name is not unset: + kwargs["name"] = name + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segment_update_data.py b/src/datadog_api_client/v2/model/segment_update_data.py new file mode 100644 index 0000000000..e9d31e194a --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_update_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_update_attributes import SegmentUpdateAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + +class SegmentUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_update_attributes import SegmentUpdateAttributes + from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType + + return { + "attributes": (SegmentUpdateAttributes,), + "id": (str,), + "type": (SegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: SegmentUpdateAttributes, id: str, type: SegmentResourceType, **kwargs): + """ + Data of the segment update. + + :param attributes: Attributes to update on a segment. Fields that are not set are left unchanged. + :type attributes: SegmentUpdateAttributes + + :param id: ID of the segment. It must match the ID in the path. + :type id: str + + :param type: Segment resource type. + :type type: SegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/segment_update_request.py b/src/datadog_api_client/v2/model/segment_update_request.py new file mode 100644 index 0000000000..be9d09cb38 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_update_data import SegmentUpdateData + + +class SegmentUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_update_data import SegmentUpdateData + + return { + "data": (SegmentUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SegmentUpdateData, **kwargs): + """ + Request to update a segment. + + :param data: Data of the segment update. + :type data: SegmentUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/segment_user.py b/src/datadog_api_client/v2/model/segment_user.py new file mode 100644 index 0000000000..9c9d5e73c3 --- /dev/null +++ b/src/datadog_api_client/v2/model/segment_user.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SegmentUser(ModelNormal): + @cached_property + def openapi_types(_): + return { + "handle": (str,), + "icon": (str,), + "id": (str,), + "name": (str,), + "uuid": (str,), + } + + attribute_map = { + "handle": "handle", + "icon": "icon", + "id": "id", + "name": "name", + "uuid": "uuid", + } + + def __init__( + self_, + handle: Union[str, UnsetType] = unset, + icon: Union[str, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + uuid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A Datadog user who created, modified, or disabled a segment. + + :param handle: Handle of the user. + :type handle: str, optional + + :param icon: URL of the user avatar. + :type icon: str, optional + + :param id: Numeric ID of the user, as a string. + :type id: str, optional + + :param name: Name of the user. + :type name: str, optional + + :param uuid: UUID of the user. + :type uuid: str, optional + """ + if handle is not unset: + kwargs["handle"] = handle + if icon is not unset: + kwargs["icon"] = icon + if id is not unset: + kwargs["id"] = id + if name is not unset: + kwargs["name"] = name + if uuid is not unset: + kwargs["uuid"] = uuid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/segments_response.py b/src/datadog_api_client/v2/model/segments_response.py new file mode 100644 index 0000000000..7cf2bd7a94 --- /dev/null +++ b/src/datadog_api_client/v2/model/segments_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.segment_summary_data import SegmentSummaryData + + +class SegmentsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.segment_summary_data import SegmentSummaryData + + return { + "data": ([SegmentSummaryData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[SegmentSummaryData], **kwargs): + """ + Response containing a list of segments. + + :param data: The segments. + :type data: [SegmentSummaryData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index f64e232c78..01564246e5 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -9450,6 +9450,74 @@ from datadog_api_client.v2.model.product_analytics_journey_timeseries_response_type import ( ProductAnalyticsJourneyTimeseriesResponseType, ) +from datadog_api_client.v2.model.product_analytics_launch_attributes import ProductAnalyticsLaunchAttributes +from datadog_api_client.v2.model.product_analytics_launch_code_analysis import ProductAnalyticsLaunchCodeAnalysis +from datadog_api_client.v2.model.product_analytics_launch_code_status import ProductAnalyticsLaunchCodeStatus +from datadog_api_client.v2.model.product_analytics_launch_create_data import ProductAnalyticsLaunchCreateData +from datadog_api_client.v2.model.product_analytics_launch_create_request import ProductAnalyticsLaunchCreateRequest +from datadog_api_client.v2.model.product_analytics_launch_dashboard_step import ProductAnalyticsLaunchDashboardStep +from datadog_api_client.v2.model.product_analytics_launch_data import ProductAnalyticsLaunchData +from datadog_api_client.v2.model.product_analytics_launch_event import ProductAnalyticsLaunchEvent +from datadog_api_client.v2.model.product_analytics_launch_event_finding import ProductAnalyticsLaunchEventFinding +from datadog_api_client.v2.model.product_analytics_launch_event_property import ProductAnalyticsLaunchEventProperty +from datadog_api_client.v2.model.product_analytics_launch_experiment_step import ProductAnalyticsLaunchExperimentStep +from datadog_api_client.v2.model.product_analytics_launch_funnel_step import ProductAnalyticsLaunchFunnelStep +from datadog_api_client.v2.model.product_analytics_launch_kpi import ProductAnalyticsLaunchKPI +from datadog_api_client.v2.model.product_analytics_launch_list_scope import ProductAnalyticsLaunchListScope +from datadog_api_client.v2.model.product_analytics_launch_patch_attributes import ProductAnalyticsLaunchPatchAttributes +from datadog_api_client.v2.model.product_analytics_launch_patch_data import ProductAnalyticsLaunchPatchData +from datadog_api_client.v2.model.product_analytics_launch_patch_request import ProductAnalyticsLaunchPatchRequest +from datadog_api_client.v2.model.product_analytics_launch_patch_steps import ProductAnalyticsLaunchPatchSteps +from datadog_api_client.v2.model.product_analytics_launch_phase import ProductAnalyticsLaunchPhase +from datadog_api_client.v2.model.product_analytics_launch_properties import ProductAnalyticsLaunchProperties +from datadog_api_client.v2.model.product_analytics_launch_property import ProductAnalyticsLaunchProperty +from datadog_api_client.v2.model.product_analytics_launch_property_finding import ProductAnalyticsLaunchPropertyFinding +from datadog_api_client.v2.model.product_analytics_launch_request_attributes import ( + ProductAnalyticsLaunchRequestAttributes, +) +from datadog_api_client.v2.model.product_analytics_launch_response import ProductAnalyticsLaunchResponse +from datadog_api_client.v2.model.product_analytics_launch_steps import ProductAnalyticsLaunchSteps +from datadog_api_client.v2.model.product_analytics_launch_steps_request import ProductAnalyticsLaunchStepsRequest +from datadog_api_client.v2.model.product_analytics_launch_tracking_plan import ProductAnalyticsLaunchTrackingPlan +from datadog_api_client.v2.model.product_analytics_launch_tracking_plan_request import ( + ProductAnalyticsLaunchTrackingPlanRequest, +) +from datadog_api_client.v2.model.product_analytics_launch_type import ProductAnalyticsLaunchType +from datadog_api_client.v2.model.product_analytics_launches_response import ProductAnalyticsLaunchesResponse +from datadog_api_client.v2.model.product_analytics_monitor_attributes import ProductAnalyticsMonitorAttributes +from datadog_api_client.v2.model.product_analytics_monitor_create_attributes import ( + ProductAnalyticsMonitorCreateAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_create_data import ProductAnalyticsMonitorCreateData +from datadog_api_client.v2.model.product_analytics_monitor_create_request import ProductAnalyticsMonitorCreateRequest +from datadog_api_client.v2.model.product_analytics_monitor_creator import ProductAnalyticsMonitorCreator +from datadog_api_client.v2.model.product_analytics_monitor_data import ProductAnalyticsMonitorData +from datadog_api_client.v2.model.product_analytics_monitor_list_attributes import ProductAnalyticsMonitorListAttributes +from datadog_api_client.v2.model.product_analytics_monitor_list_data import ProductAnalyticsMonitorListData +from datadog_api_client.v2.model.product_analytics_monitor_list_item import ProductAnalyticsMonitorListItem +from datadog_api_client.v2.model.product_analytics_monitor_list_response import ProductAnalyticsMonitorListResponse +from datadog_api_client.v2.model.product_analytics_monitor_list_type import ProductAnalyticsMonitorListType +from datadog_api_client.v2.model.product_analytics_monitor_options import ProductAnalyticsMonitorOptions +from datadog_api_client.v2.model.product_analytics_monitor_request_type import ProductAnalyticsMonitorRequestType +from datadog_api_client.v2.model.product_analytics_monitor_response import ProductAnalyticsMonitorResponse +from datadog_api_client.v2.model.product_analytics_monitor_status import ProductAnalyticsMonitorStatus +from datadog_api_client.v2.model.product_analytics_monitor_tags import ProductAnalyticsMonitorTags +from datadog_api_client.v2.model.product_analytics_monitor_thresholds import ProductAnalyticsMonitorThresholds +from datadog_api_client.v2.model.product_analytics_monitor_type import ProductAnalyticsMonitorType +from datadog_api_client.v2.model.product_analytics_monitor_unlink_attributes import ( + ProductAnalyticsMonitorUnlinkAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_unlink_data import ProductAnalyticsMonitorUnlinkData +from datadog_api_client.v2.model.product_analytics_monitor_unlink_request import ProductAnalyticsMonitorUnlinkRequest +from datadog_api_client.v2.model.product_analytics_monitor_unlink_request_type import ( + ProductAnalyticsMonitorUnlinkRequestType, +) +from datadog_api_client.v2.model.product_analytics_monitor_update_attributes import ( + ProductAnalyticsMonitorUpdateAttributes, +) +from datadog_api_client.v2.model.product_analytics_monitor_update_data import ProductAnalyticsMonitorUpdateData +from datadog_api_client.v2.model.product_analytics_monitor_update_request import ProductAnalyticsMonitorUpdateRequest +from datadog_api_client.v2.model.product_analytics_monitor_variable import ProductAnalyticsMonitorVariable from datadog_api_client.v2.model.product_analytics_occurrence_filter import ProductAnalyticsOccurrenceFilter from datadog_api_client.v2.model.product_analytics_occurrence_query import ProductAnalyticsOccurrenceQuery from datadog_api_client.v2.model.product_analytics_occurrence_query_data_source import ( @@ -11611,6 +11679,44 @@ from datadog_api_client.v2.model.security_monitoring_user import SecurityMonitoringUser from datadog_api_client.v2.model.security_trigger import SecurityTrigger from datadog_api_client.v2.model.security_trigger_wrapper import SecurityTriggerWrapper +from datadog_api_client.v2.model.segment_attributes import SegmentAttributes +from datadog_api_client.v2.model.segment_create_attributes import SegmentCreateAttributes +from datadog_api_client.v2.model.segment_create_data import SegmentCreateData +from datadog_api_client.v2.model.segment_create_request import SegmentCreateRequest +from datadog_api_client.v2.model.segment_data import SegmentData +from datadog_api_client.v2.model.segment_data_query import SegmentDataQuery +from datadog_api_client.v2.model.segment_delete_attributes import SegmentDeleteAttributes +from datadog_api_client.v2.model.segment_delete_data import SegmentDeleteData +from datadog_api_client.v2.model.segment_delete_response import SegmentDeleteResponse +from datadog_api_client.v2.model.segment_deleted_type import SegmentDeletedType +from datadog_api_client.v2.model.segment_entity import SegmentEntity +from datadog_api_client.v2.model.segment_event_platform_block import SegmentEventPlatformBlock +from datadog_api_client.v2.model.segment_journey_block import SegmentJourneyBlock +from datadog_api_client.v2.model.segment_preview_attributes import SegmentPreviewAttributes +from datadog_api_client.v2.model.segment_preview_data import SegmentPreviewData +from datadog_api_client.v2.model.segment_preview_request import SegmentPreviewRequest +from datadog_api_client.v2.model.segment_preview_request_type import SegmentPreviewRequestType +from datadog_api_client.v2.model.segment_preview_response import SegmentPreviewResponse +from datadog_api_client.v2.model.segment_preview_response_attributes import SegmentPreviewResponseAttributes +from datadog_api_client.v2.model.segment_preview_response_data import SegmentPreviewResponseData +from datadog_api_client.v2.model.segment_preview_response_type import SegmentPreviewResponseType +from datadog_api_client.v2.model.segment_profile_store_block import SegmentProfileStoreBlock +from datadog_api_client.v2.model.segment_reference_table_block import SegmentReferenceTableBlock +from datadog_api_client.v2.model.segment_reference_table_column import SegmentReferenceTableColumn +from datadog_api_client.v2.model.segment_reference_table_join_condition import SegmentReferenceTableJoinCondition +from datadog_api_client.v2.model.segment_resource_type import SegmentResourceType +from datadog_api_client.v2.model.segment_response import SegmentResponse +from datadog_api_client.v2.model.segment_retention_block import SegmentRetentionBlock +from datadog_api_client.v2.model.segment_sort_column import SegmentSortColumn +from datadog_api_client.v2.model.segment_static_block import SegmentStaticBlock +from datadog_api_client.v2.model.segment_summary_attributes import SegmentSummaryAttributes +from datadog_api_client.v2.model.segment_summary_data import SegmentSummaryData +from datadog_api_client.v2.model.segment_template_block import SegmentTemplateBlock +from datadog_api_client.v2.model.segment_update_attributes import SegmentUpdateAttributes +from datadog_api_client.v2.model.segment_update_data import SegmentUpdateData +from datadog_api_client.v2.model.segment_update_request import SegmentUpdateRequest +from datadog_api_client.v2.model.segment_user import SegmentUser +from datadog_api_client.v2.model.segments_response import SegmentsResponse from datadog_api_client.v2.model.selectors import Selectors from datadog_api_client.v2.model.self_service_trigger_wrapper import SelfServiceTriggerWrapper from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction @@ -20344,6 +20450,62 @@ "ProductAnalyticsJourneyTimeseriesResponse", "ProductAnalyticsJourneyTimeseriesResponseData", "ProductAnalyticsJourneyTimeseriesResponseType", + "ProductAnalyticsLaunchAttributes", + "ProductAnalyticsLaunchCodeAnalysis", + "ProductAnalyticsLaunchCodeStatus", + "ProductAnalyticsLaunchCreateData", + "ProductAnalyticsLaunchCreateRequest", + "ProductAnalyticsLaunchDashboardStep", + "ProductAnalyticsLaunchData", + "ProductAnalyticsLaunchEvent", + "ProductAnalyticsLaunchEventFinding", + "ProductAnalyticsLaunchEventProperty", + "ProductAnalyticsLaunchExperimentStep", + "ProductAnalyticsLaunchFunnelStep", + "ProductAnalyticsLaunchKPI", + "ProductAnalyticsLaunchListScope", + "ProductAnalyticsLaunchPatchAttributes", + "ProductAnalyticsLaunchPatchData", + "ProductAnalyticsLaunchPatchRequest", + "ProductAnalyticsLaunchPatchSteps", + "ProductAnalyticsLaunchPhase", + "ProductAnalyticsLaunchProperties", + "ProductAnalyticsLaunchProperty", + "ProductAnalyticsLaunchPropertyFinding", + "ProductAnalyticsLaunchRequestAttributes", + "ProductAnalyticsLaunchResponse", + "ProductAnalyticsLaunchSteps", + "ProductAnalyticsLaunchStepsRequest", + "ProductAnalyticsLaunchTrackingPlan", + "ProductAnalyticsLaunchTrackingPlanRequest", + "ProductAnalyticsLaunchType", + "ProductAnalyticsLaunchesResponse", + "ProductAnalyticsMonitorAttributes", + "ProductAnalyticsMonitorCreateAttributes", + "ProductAnalyticsMonitorCreateData", + "ProductAnalyticsMonitorCreateRequest", + "ProductAnalyticsMonitorCreator", + "ProductAnalyticsMonitorData", + "ProductAnalyticsMonitorListAttributes", + "ProductAnalyticsMonitorListData", + "ProductAnalyticsMonitorListItem", + "ProductAnalyticsMonitorListResponse", + "ProductAnalyticsMonitorListType", + "ProductAnalyticsMonitorOptions", + "ProductAnalyticsMonitorRequestType", + "ProductAnalyticsMonitorResponse", + "ProductAnalyticsMonitorStatus", + "ProductAnalyticsMonitorTags", + "ProductAnalyticsMonitorThresholds", + "ProductAnalyticsMonitorType", + "ProductAnalyticsMonitorUnlinkAttributes", + "ProductAnalyticsMonitorUnlinkData", + "ProductAnalyticsMonitorUnlinkRequest", + "ProductAnalyticsMonitorUnlinkRequestType", + "ProductAnalyticsMonitorUpdateAttributes", + "ProductAnalyticsMonitorUpdateData", + "ProductAnalyticsMonitorUpdateRequest", + "ProductAnalyticsMonitorVariable", "ProductAnalyticsOccurrenceFilter", "ProductAnalyticsOccurrenceQuery", "ProductAnalyticsOccurrenceQueryDataSource", @@ -21699,6 +21861,44 @@ "SecurityMonitoringUser", "SecurityTrigger", "SecurityTriggerWrapper", + "SegmentAttributes", + "SegmentCreateAttributes", + "SegmentCreateData", + "SegmentCreateRequest", + "SegmentData", + "SegmentDataQuery", + "SegmentDeleteAttributes", + "SegmentDeleteData", + "SegmentDeleteResponse", + "SegmentDeletedType", + "SegmentEntity", + "SegmentEventPlatformBlock", + "SegmentJourneyBlock", + "SegmentPreviewAttributes", + "SegmentPreviewData", + "SegmentPreviewRequest", + "SegmentPreviewRequestType", + "SegmentPreviewResponse", + "SegmentPreviewResponseAttributes", + "SegmentPreviewResponseData", + "SegmentPreviewResponseType", + "SegmentProfileStoreBlock", + "SegmentReferenceTableBlock", + "SegmentReferenceTableColumn", + "SegmentReferenceTableJoinCondition", + "SegmentResourceType", + "SegmentResponse", + "SegmentRetentionBlock", + "SegmentSortColumn", + "SegmentStaticBlock", + "SegmentSummaryAttributes", + "SegmentSummaryData", + "SegmentTemplateBlock", + "SegmentUpdateAttributes", + "SegmentUpdateData", + "SegmentUpdateRequest", + "SegmentUser", + "SegmentsResponse", "Selectors", "SelfServiceTriggerWrapper", "SendSlackMessageAction", diff --git a/tests/v2/features/product_analytics.feature b/tests/v2/features/product_analytics.feature index 1af45e54a7..db44330b8a 100644 --- a/tests/v2/features/product_analytics.feature +++ b/tests/v2/features/product_analytics.feature @@ -172,6 +172,166 @@ Feature: Product Analytics When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Create a Product Analytics monitor returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "CreateProductAnalyticsMonitor" enabled + And new "CreateProductAnalyticsMonitor" request + And body with value {"data": {"attributes": {"message": "Conversion from /a to /b dropped over the last hour\n\n@slack-my-alerts-channel", "name": "Funnel conversion drop", "options": {"thresholds": {"critical": 1, "warning": 2}, "variables": [{"data_source": "product_analytics_journey", "name": "query", "search": {"expression": "node_0->node_1", "filters": {"graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "value": 86400000}]}, "join_keys": {"primary": "@usr.id"}, "node_objects": {"node_0": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:/a"}}, "node_1": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:/b"}}}}}]}, "priority": 3, "query": "formula(\"query\").rollup(\"sum\").last(\"1h\") < 1", "tags": {"chart_id": "chart-1", "query_type": "funnel"}}, "type": "pa_monitor_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Create a Product Analytics monitor returns "Created" response + Given a valid "appKeyAuth" key in the system + And operation "CreateProductAnalyticsMonitor" enabled + And new "CreateProductAnalyticsMonitor" request + And body with value {"data": {"attributes": {"message": "Conversion from /a to /b dropped over the last hour\n\n@slack-my-alerts-channel", "name": "Funnel conversion drop", "options": {"thresholds": {"critical": 1, "warning": 2}, "variables": [{"data_source": "product_analytics_journey", "name": "query", "search": {"expression": "node_0->node_1", "filters": {"graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "value": 86400000}]}, "join_keys": {"primary": "@usr.id"}, "node_objects": {"node_0": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:/a"}}, "node_1": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:/b"}}}}}]}, "priority": 3, "query": "formula(\"query\").rollup(\"sum\").last(\"1h\") < 1", "tags": {"chart_id": "chart-1", "query_type": "funnel"}}, "type": "pa_monitor_request"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Create a launch returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "CreateProductAnalyticsLaunch" enabled + And new "CreateProductAnalyticsLaunch" request + And body with value {"data": {"attributes": {"context": "Let users apply promo codes at checkout.", "description": "Promo codes at checkout.", "kpis": [{"id": "7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", "title": "Checkout conversion rate"}], "name": "checkout_promo_codes", "phase": "plan", "steps": {"tracking_plan": {"events": [{"kpis": ["7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10"], "name": "promo_code_applied", "trigger": "The user applies a valid promo code.", "views": ["/checkout"]}]}}}, "type": "liftoff"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Create a launch returns "Created" response + Given a valid "appKeyAuth" key in the system + And operation "CreateProductAnalyticsLaunch" enabled + And new "CreateProductAnalyticsLaunch" request + And body with value {"data": {"attributes": {"context": "Let users apply promo codes at checkout.", "description": "Promo codes at checkout.", "kpis": [{"id": "7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", "title": "Checkout conversion rate"}], "name": "checkout_promo_codes", "phase": "plan", "steps": {"tracking_plan": {"events": [{"kpis": ["7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10"], "name": "promo_code_applied", "trigger": "The user applies a valid promo code.", "views": ["/checkout"]}]}}}, "type": "liftoff"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Delete a Product Analytics monitor returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsMonitor" enabled + And new "DeleteProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Delete a Product Analytics monitor returns "No Content" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsMonitor" enabled + And new "DeleteProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Delete a Product Analytics monitor returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsMonitor" enabled + And new "DeleteProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Delete a launch returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsLaunch" enabled + And new "DeleteProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Delete a launch returns "No Content" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsLaunch" enabled + And new "DeleteProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Delete a launch returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "DeleteProductAnalyticsLaunch" enabled + And new "DeleteProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Get a Product Analytics monitor returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsMonitor" enabled + And new "GetProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Get a Product Analytics monitor returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsMonitor" enabled + And new "GetProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Get a Product Analytics monitor returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsMonitor" enabled + And new "GetProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Get a launch returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsLaunch" enabled + And new "GetProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Get a launch returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsLaunch" enabled + And new "GetProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Get a launch returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "GetProductAnalyticsLaunch" enabled + And new "GetProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: List Product Analytics monitors returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "ListProductAnalyticsMonitors" enabled + And new "ListProductAnalyticsMonitors" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: List Product Analytics monitors returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "ListProductAnalyticsMonitors" enabled + And new "ListProductAnalyticsMonitors" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/product-analytics-platform Scenario: List analytics events returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -208,6 +368,22 @@ Feature: Product Analytics When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: List launches returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "ListProductAnalyticsLaunches" enabled + And new "ListProductAnalyticsLaunches" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: List launches returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "ListProductAnalyticsLaunches" enabled + And new "ListProductAnalyticsLaunches" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/product-analytics-platform Scenario: List the entities behind a retention cell returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -253,3 +429,113 @@ Feature: Product Analytics And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 202 Request accepted for processing (always 202 empty JSON). + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Unlink a Product Analytics monitor from its chart returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "RemoveChartFromProductAnalyticsMonitor" enabled + And new "RemoveChartFromProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"chart_id": "chart-1", "dashboard_id": "dash-1"}, "type": "pa_monitor_unlink_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Unlink a Product Analytics monitor from its chart returns "Conflict" response + Given a valid "appKeyAuth" key in the system + And operation "RemoveChartFromProductAnalyticsMonitor" enabled + And new "RemoveChartFromProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"chart_id": "chart-1", "dashboard_id": "dash-1"}, "type": "pa_monitor_unlink_request"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Unlink a Product Analytics monitor from its chart returns "No Content" response + Given a valid "appKeyAuth" key in the system + And operation "RemoveChartFromProductAnalyticsMonitor" enabled + And new "RemoveChartFromProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"chart_id": "chart-1", "dashboard_id": "dash-1"}, "type": "pa_monitor_unlink_request"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Unlink a Product Analytics monitor from its chart returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "RemoveChartFromProductAnalyticsMonitor" enabled + And new "RemoveChartFromProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"chart_id": "chart-1", "dashboard_id": "dash-1"}, "type": "pa_monitor_unlink_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Update a Product Analytics monitor returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "UpdateProductAnalyticsMonitor" enabled + And new "UpdateProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Funnel conversion drop", "options": {"thresholds": {"critical": 1, "warning": 1.5}}}, "type": "pa_monitor_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Update a Product Analytics monitor returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "UpdateProductAnalyticsMonitor" enabled + And new "UpdateProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Funnel conversion drop", "options": {"thresholds": {"critical": 1, "warning": 1.5}}}, "type": "pa_monitor_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-ingestion + Scenario: Update a Product Analytics monitor returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "UpdateProductAnalyticsMonitor" enabled + And new "UpdateProductAnalyticsMonitor" request + And request contains "monitor_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Funnel conversion drop", "options": {"thresholds": {"critical": 1, "warning": 1.5}}}, "type": "pa_monitor_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Update a launch returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "PatchProductAnalyticsLaunch" enabled + And new "PatchProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"phase": "setup"}, "id": "5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", "type": "liftoff"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Update a launch returns "Conflict" response + Given a valid "appKeyAuth" key in the system + And operation "PatchProductAnalyticsLaunch" enabled + And new "PatchProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"phase": "setup"}, "id": "5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", "type": "liftoff"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Update a launch returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "PatchProductAnalyticsLaunch" enabled + And new "PatchProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"phase": "setup"}, "id": "5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", "type": "liftoff"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/product-analytics-activation @team:ddoghq/product-analytics-query + Scenario: Update a launch returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "PatchProductAnalyticsLaunch" enabled + And new "PatchProductAnalyticsLaunch" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"phase": "setup"}, "id": "5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", "type": "liftoff"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/rum_audience_management.feature b/tests/v2/features/rum_audience_management.feature index e4514231df..85d6be9d86 100644 --- a/tests/v2/features/rum_audience_management.feature +++ b/tests/v2/features/rum_audience_management.feature @@ -7,6 +7,30 @@ Feature: Rum Audience Management And a valid "appKeyAuth" key in the system And an instance of "RumAudienceManagement" API + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Create a segment returns "Bad Request" response + Given operation "CreateProductAnalyticsSegment" enabled + And new "CreateProductAnalyticsSegment" request + And body with value {"data": {"attributes": {"data_query": {"event_platform": [{"facet": "@usr.id", "from": "-2592000000", "name": "viewed_logs", "query": "@type:view @view.name:/logs", "to": "0"}]}, "description": "Users who viewed the logs page in the last 30 days.", "name": "High-value users", "tags": ["team:growth"]}, "type": "segment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Create a segment returns "Conflict" response + Given operation "CreateProductAnalyticsSegment" enabled + And new "CreateProductAnalyticsSegment" request + And body with value {"data": {"attributes": {"data_query": {"event_platform": [{"facet": "@usr.id", "from": "-2592000000", "name": "viewed_logs", "query": "@type:view @view.name:/logs", "to": "0"}]}, "description": "Users who viewed the logs page in the last 30 days.", "name": "High-value users", "tags": ["team:growth"]}, "type": "segment"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Create a segment returns "Created" response + Given operation "CreateProductAnalyticsSegment" enabled + And new "CreateProductAnalyticsSegment" request + And body with value {"data": {"attributes": {"data_query": {"event_platform": [{"facet": "@usr.id", "from": "-2592000000", "name": "viewed_logs", "query": "@type:view @view.name:/logs", "to": "0"}]}, "description": "Users who viewed the logs page in the last 30 days.", "name": "High-value users", "tags": ["team:growth"]}, "type": "segment"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Create connection returns "Connection created successfully" response Given operation "CreateConnection" enabled @@ -16,6 +40,22 @@ Feature: Rum Audience Management When the request is sent Then the response status is 201 Connection created successfully + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Delete a segment returns "Not Found" response + Given operation "DeleteProductAnalyticsSegment" enabled + And new "DeleteProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Delete a segment returns "OK" response + Given operation "DeleteProductAnalyticsSegment" enabled + And new "DeleteProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Delete a user profile returns "Bad Request" response Given operation "DeleteUserProfile" enabled @@ -41,6 +81,30 @@ Feature: Rum Audience Management When the request is sent Then the response status is 204 Connection deleted successfully + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Get a segment returns "Bad Request" response + Given operation "GetProductAnalyticsSegment" enabled + And new "GetProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Get a segment returns "Not Found" response + Given operation "GetProductAnalyticsSegment" enabled + And new "GetProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Get a segment returns "OK" response + Given operation "GetProductAnalyticsSegment" enabled + And new "GetProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Get account facet info returns "Successful response with facet information" response Given operation "GetAccountFacetInfo" enabled @@ -73,6 +137,36 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with list of connections + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: List segments returns "Bad Request" response + Given operation "ListProductAnalyticsSegments" enabled + And new "ListProductAnalyticsSegments" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: List segments returns "OK" response + Given operation "ListProductAnalyticsSegments" enabled + And new "ListProductAnalyticsSegments" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Preview a segment returns "Bad Request" response + Given operation "PreviewProductAnalyticsSegment" enabled + And new "PreviewProductAnalyticsSegment" request + And body with value {"data": {"attributes": {"data_query": {"event_platform": [{"facet": "@usr.id", "from": "-2592000000", "query": "@type:view @view.name:/logs", "to": "0"}]}, "limit": 50, "user_store_columns": ["user_id", "user_email", "user_name"]}, "type": "segment_preview_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Preview a segment returns "OK" response + Given operation "PreviewProductAnalyticsSegment" enabled + And new "PreviewProductAnalyticsSegment" request + And body with value {"data": {"attributes": {"data_query": {"event_platform": [{"facet": "@usr.id", "from": "-2592000000", "query": "@type:view @view.name:/logs", "to": "0"}]}, "limit": 50, "user_store_columns": ["user_id", "user_email", "user_name"]}, "type": "segment_preview_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Query accounts returns "Successful response with account data" response Given operation "QueryAccounts" enabled @@ -97,6 +191,42 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with user data + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Update a segment returns "Bad Request" response + Given operation "UpdateProductAnalyticsSegment" enabled + And new "UpdateProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Users who viewed the logs page in the last 7 days.", "name": "High-value users"}, "id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", "type": "segment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Update a segment returns "Conflict" response + Given operation "UpdateProductAnalyticsSegment" enabled + And new "UpdateProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Users who viewed the logs page in the last 7 days.", "name": "High-value users"}, "id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", "type": "segment"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Update a segment returns "No Content" response + Given operation "UpdateProductAnalyticsSegment" enabled + And new "UpdateProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Users who viewed the logs page in the last 7 days.", "name": "High-value users"}, "id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", "type": "segment"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion + Scenario: Update a segment returns "Not Found" response + Given operation "UpdateProductAnalyticsSegment" enabled + And new "UpdateProductAnalyticsSegment" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Users who viewed the logs page in the last 7 days.", "name": "High-value users"}, "id": "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", "type": "segment"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/audience-management-backend @team:ddoghq/product-analytics-ingestion Scenario: Update connection returns "Connection updated successfully" response Given operation "UpdateConnection" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 0d9b33aa46..14d4ebb492 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7552,6 +7552,86 @@ "type": "safe" } }, + "ListProductAnalyticsLaunches": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "CreateProductAnalyticsLaunch": { + "tag": "Product Analytics", + "undo": { + "operationId": "DeleteProductAnalyticsLaunch", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProductAnalyticsLaunch": { + "tag": "Product Analytics", + "undo": { + "type": "idempotent" + } + }, + "GetProductAnalyticsLaunch": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "PatchProductAnalyticsLaunch": { + "tag": "Product Analytics", + "undo": { + "type": "idempotent" + } + }, + "ListProductAnalyticsMonitors": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "CreateProductAnalyticsMonitor": { + "tag": "Product Analytics", + "undo": { + "operationId": "DeleteProductAnalyticsMonitor", + "parameters": [ + { + "name": "monitor_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProductAnalyticsMonitor": { + "tag": "Product Analytics", + "undo": { + "type": "idempotent" + } + }, + "GetProductAnalyticsMonitor": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "UpdateProductAnalyticsMonitor": { + "tag": "Product Analytics", + "undo": { + "type": "idempotent" + } + }, + "RemoveChartFromProductAnalyticsMonitor": { + "tag": "Product Analytics", + "undo": { + "type": "idempotent" + } + }, "QueryProductAnalyticsRetentionGrid": { "tag": "Product Analytics", "undo": { @@ -7582,6 +7662,49 @@ "type": "safe" } }, + "ListProductAnalyticsSegments": { + "tag": "Rum Audience Management", + "undo": { + "type": "safe" + } + }, + "CreateProductAnalyticsSegment": { + "tag": "Rum Audience Management", + "undo": { + "operationId": "DeleteProductAnalyticsSegment", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProductAnalyticsSegment": { + "tag": "Rum Audience Management", + "undo": { + "type": "idempotent" + } + }, + "GetProductAnalyticsSegment": { + "tag": "Rum Audience Management", + "undo": { + "type": "safe" + } + }, + "UpdateProductAnalyticsSegment": { + "tag": "Rum Audience Management", + "undo": { + "type": "idempotent" + } + }, + "PreviewProductAnalyticsSegment": { + "tag": "Rum Audience Management", + "undo": { + "type": "safe" + } + }, "QueryEventFilteredUsers": { "tag": "Rum Audience Management", "undo": {